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

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

ContestResults :

  • Code revision
  • Add Letton (lv_LV) language, thanks to Aivars Baldone
  • Delete display options
  • Fix languages bugs
  • Improve public appearence
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' => (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 . '&tab=config');
24}       
25
26// +-----------------------------------------------------------------------+
27//                              Définition des variables template
28// +-----------------------------------------------------------------------+
29$conf['ContestResults'] = unserialize($conf['ContestResults']);
30
31$template->assign(array(
32        'MODE_LINK' => ($conf['ContestResults']['menubar_mode']['link']) ? 'checked="checked"' : '',
33        'MODE_BLOCK' => ($conf['ContestResults']['menubar_mode']['block']) ? 'checked="checked"' : '',
34        'LINK_MENU' => ($conf['ContestResults']['menubar_link']['menu']) ? 'checked="checked"' : '',
35        'LINK_SPECIALS' => ($conf['ContestResults']['menubar_link']['specials']) ? 'checked="checked"' : '',
36        'BLOCK_NUMBER' => $conf['ContestResults']['menubar_block']['number'],
37));
38
39// +-----------------------------------------------------------------------+
40//                              Template
41// +-----------------------------------------------------------------------+
42$template->set_filenames(array('plugin_admin_content' => dirname(__FILE__).'/template/config.tpl'));
43$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
44?>
Note: See TracBrowser for help on using the repository browser.