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

Last change on this file since 6768 was 6768, checked in by mistic100, 14 years ago
File size: 1.9 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' => ($_POST['menubar_mode_link']) ? 1 : 0,
11                        'block' => ($_POST['menubar_mode_block']) ? 1 : 0
12                ),
13                'menubar_link' => array(
14                        'menu' => ($_POST['menubar_link_menu']) ? 1 : 0,
15                        'specials' => ($_POST['menubar_link_specials']) ? 1 : 0
16                ),
17                'menubar_block' => array(
18                        'number' => $_POST['menubar_block_number']
19                )
20        );
21       
22        $query = "UPDATE " . CONFIG_TABLE . " SET `value` = '" . serialize($user_config) . "' WHERE `param` = 'ContestResults';";
23        pwg_query($query);
24        redirect(CR_ADMIN . '&tab=config');
25}       
26
27// +-----------------------------------------------------------------------+
28//              Définition des variables template
29// +-----------------------------------------------------------------------+
30$conf['ContestResults'] = unserialize($conf['ContestResults']);
31
32$template->assign(array(
33        'MODE_LINK' => ($conf['ContestResults']['menubar_mode']['link']) ? 'checked="checked"' : '',
34        'MODE_BLOCK' => ($conf['ContestResults']['menubar_mode']['block']) ? 'checked="checked"' : '',
35        'LINK_MENU' => ($conf['ContestResults']['menubar_link']['menu']) ? 'checked="checked"' : '',
36        'LINK_SPECIALS' => ($conf['ContestResults']['menubar_link']['specials']) ? 'checked="checked"' : '',
37        'BLOCK_NUMBER' => $conf['ContestResults']['menubar_block']['number'],
38));
39
40// +-----------------------------------------------------------------------+
41//                              Template
42// +-----------------------------------------------------------------------+
43$template->set_filenames(array('plugin_admin_content' => dirname(__FILE__).'/template/config.tpl'));
44$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
45?>
Note: See TracBrowser for help on using the repository browser.