Dotclear

source: plugins/periodical/index.php @ 2160

Revision 2160, 2.1 KB checked in by JcDenis, 14 years ago (diff)

periodical 0.1:

  • First lab release
Line 
1<?php
2# -- BEGIN LICENSE BLOCK ----------------------------------
3# This file is part of periodical, a plugin for Dotclear 2.
4#
5# Copyright (c) 2009-2010 JC Denis and contributors
6# jcdenis@gdwd.com
7#
8# Licensed under the GPL version 2.0 license.
9# A copy of this license is available in LICENSE file or at
10# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
11# -- END LICENSE BLOCK ------------------------------------
12
13if (!defined('DC_CONTEXT_ADMIN')){return;}
14
15dcPage::check('contentadmin');
16
17# Objects
18$s = $core->blog->settings;
19$per = new periodical($core);
20
21# Default values
22$echo = '';
23$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
24
25# Messages
26$msg = isset($_REQUEST['msg']) ? $_REQUEST['msg'] : '';
27$msg_list = array(
28     'savesetting' => __('Configuration successfully saved'),
29     'deleteperiods' => __('Periods successfully deleted'),
30     'emptyperiods' => __('Periods successfully emptied'),
31     'updateperiod' => __('Period successfully updated'),
32     'addperiod' => __('Period successfully created'),
33     'publish' => __('Entries successfully published'),
34     'unpublish' => __('Entries successfully unpublished'),
35     'remove_post_periodical' => __('Entries successfully removed from periodical')
36);
37if (isset($msg_list[$msg])) {
38     $msg = sprintf('<p class="message">%s</p>',$msg_list[$msg]);
39}
40
41# Pages
42$parts = array(
43     'setting' => __('Settings'),
44     'periods' => __('Periods'),
45     'editperiod' => __('Edit period'),
46     'addperiod' => __('New period')
47);
48$start_part = $s->periodical_active ? 'periods' : 'setting';
49$default_part = isset($_REQUEST['part']) && isset($parts[$_REQUEST['part']]) ? $_REQUEST['part'] : $start_part;
50
51require dirname(__FILE__).'/inc/index.'.$default_part.'.php';
52
53# Footer
54dcPage::helpBlock('periodical');
55echo '
56<hr class="clear"/>
57<p class="right">
58<a class="button" href="'.$p_url.'&amp;part=setting">'.__('Settings').'</a> -
59periodical - '.$core->plugins->moduleInfo('periodical','version').'&nbsp;
60<img alt="'.__('Periodical').'" src="index.php?pf=periodical/icon.png" />
61</p></body></html>';
62?>
Note: See TracBrowser for help on using the repository browser.

Sites map