source: extensions/ContestResults/admin/config.php @ 9419

Last change on this file since 9419 was 9419, checked in by mistic100, 13 years ago

[extensions] ContestResults

  • add messages on admin pages
File size: 2.0 KB
Line 
1<?php
2if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
3
4// +-----------------------------------------------------------------------+
5//                              Modification de la configuration
6// +-----------------------------------------------------------------------+
7if (isset($_POST['config_submit'])) {
8        $user_config = array(
9                'menubar_mode' => array(
10                        'link' => (isset($_POST['menubar_mode_link'])) ? 1 : 0,
11                        'block' => (isset($_POST['menubar_mode_block'])) ? 1 : 0,
12                ),
13                'menubar_link' => array(
14                        'menu' => (isset($_POST['menubar_link_menu'])) ? 1 : 0,
15                        'specials' => (isset($_POST['menubar_link_specials'])) ? 1 : 0,
16                ),
17                'menubar_block' => array(
18                        'number' => $_POST['menubar_block_number'],
19                ),
20        );
21       
22        pwg_query("UPDATE " . CONFIG_TABLE . " SET `value` = '" . serialize($user_config) . "' WHERE `param` = 'ContestResults';");
23        redirect(CR_ADMIN . '&amp;tab=config&amp;msg=saved');
24}       
25
26// +-----------------------------------------------------------------------+
27//                              Définition des variables template
28// +-----------------------------------------------------------------------+
29if (isset($_GET['msg']) AND $_GET['msg'] == 'saved')
30        array_push($page['infos'], l10n('Information data registered in database'));
31       
32
33$template->assign(array(
34        'MODE_LINK' => ($conf['ContestResults']['menubar_mode']['link']) ? 'checked="checked"' : '',
35        'MODE_BLOCK' => ($conf['ContestResults']['menubar_mode']['block']) ? 'checked="checked"' : '',
36        'LINK_MENU' => ($conf['ContestResults']['menubar_link']['menu']) ? 'checked="checked"' : '',
37        'LINK_SPECIALS' => ($conf['ContestResults']['menubar_link']['specials']) ? 'checked="checked"' : '',
38        'BLOCK_NUMBER' => $conf['ContestResults']['menubar_block']['number'],
39));
40
41// +-----------------------------------------------------------------------+
42//                              Template
43// +-----------------------------------------------------------------------+
44$template->set_filenames(array('plugin_admin_content' => dirname(__FILE__).'/template/config.tpl'));
45$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
46?>
Note: See TracBrowser for help on using the repository browser.