Dotclear

source: plugins/pollsFactory/index.php @ 2338

Revision 2338, 3.3 KB checked in by JcDenis, 13 years ago (diff)

pollsFactory 1.3

  • Switched to DC 2.2
  • Fixed minor bugs
RevLine 
[2139]1<?php
2# -- BEGIN LICENSE BLOCK ----------------------------------
3# This file is part of pollsFactory, 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
15# Check user perms
16dcPage::check('usage,contentadmin');
17
18# Objects
[2338]19$s = $core->blog->settings->pollsFactory;
[2139]20$factory = new pollsFactory($core);
21
22# Default values
23$echo = '';
24$show_filters = false;
25$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
26
27$header = 
28dcPage::jsLoad('index.php?pf=pollsFactory/js/main.js').
29'<script type="text/javascript">'."\n//<![CDATA[\n".
30"jcToolsBox.prototype.text_wait = '".html::escapeJS(__('Please wait'))."';\n".
31"\n//]]>\n</script>\n".
32'<link rel="stylesheet" type="text/css" href="index.php?pf=pollsFactory/style.css" />';
33
34$footer = '<hr class="clear"/><p class="right">
35<a class="button" href="'.$p_url.'&amp;tab=setting">'.__('Settings').'</a> -
36pollsFactory - '.$core->plugins->moduleInfo('pollsFactory','version').'&nbsp;
37<img alt="'.__('Polls manager').'" src="index.php?pf=pollsFactory/icon.png" />
38</p>';
39
40# Messages
41$msg = isset($_REQUEST['msg']) ? $_REQUEST['msg'] : '';
42$msg_list = array(
43     'savesetting' => __('Configuration successfully saved'),
44     'createpoll' => __('Poll successfully created'),
45     'editpoll' => __('Poll successfully updated'),
46     'deletepoll' => __('Poll successfully deleted'),
47     'removeentries' => __('Entries successfully removed'),
48     'open' => __('Votes successfully opened'),
49     'close' => __('Votes successfully closed'),
50     'delete' => __('Polls successfully deleted'),
51     'publish' => __('Polls status successfully updated'),
52     'unpublish' => __('Polls status successfully updated'),
53     'scheduled' => __('Polls status successfully updated'),
54     'pending' => __('Polls status successfully updated'),
55     'selected' => __('Polls successfuly mark as selected'),
56     'unselected' => __('Polls successfuly mark as unselected'),
57     'deletequery' => __('Queries successfully deleted'),
58     'reorderquery' => __('Queries successfully reordered'),
59     'createquery' => __('Query successfully created'),
60     'editquery' => __('Query successfully updated'),
61     'deletenewquery' => __('New query successfully deleted'),
62     'deleteselection' => __('Options successfully deleted'),
63     'reorderselection' => __('Options successfully reordered'),
64     'createselection' => __('Option successfully created'),
65     'editselection' => __('Option successfully updated'),
66     'selectresponses' => __('Responses succesfully selected'),
67     'selectresponse' => __('Response successfully selected'),
68     'unselectresponse' => __('Response successfully unselected'),
69     'deletepeoples' => __('Users successfully deleted')
70);
71if (isset($msg_list[$msg])) {
72     $msg = sprintf('<p class="message">%s</p>',$msg_list[$msg]);
73}
74
75# Pages
76$start_tab = $s->pollsFactory_active ? 'polls' : 'setting';
77$default_tab = isset($_REQUEST['tab']) ? $_REQUEST['tab'] : $start_tab;
78
79if (!file_exists(dirname(__FILE__).'/inc/index.'.$default_tab.'.php')) {
80     $default_tab = 'setting';
81}
[2146]82include dirname(__FILE__).'/inc/index.'.$default_tab.'.php';
[2139]83
84?>
Note: See TracBrowser for help on using the repository browser.

Sites map