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

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

[extensions] Contest Results

  • New bloc for PWG Stuffs
  • Use new admin links and javascript implementation
  • Distinguish pending and running contests (both pending before)
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        $conf['ContestResults'] = 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                'truncate_summary' => $_POST['truncate_summary'],
21        );
22       
23        pwg_query("UPDATE " . CONFIG_TABLE . " SET `value` = '" . serialize($conf['ContestResults']) . "' WHERE `param` = 'ContestResults';");
24        $page['infos'][] = l10n('Information data registered in database');
25}       
26
27// +-----------------------------------------------------------------------+
28//                              Définition des variables template
29// +-----------------------------------------------------------------------+
30$template->assign(array(
31        'MODE_LINK' => ($conf['ContestResults']['menubar_mode']['link']) ? 'checked="checked"' : '',
32        'MODE_BLOCK' => ($conf['ContestResults']['menubar_mode']['block']) ? 'checked="checked"' : '',
33        'LINK_MENU' => ($conf['ContestResults']['menubar_link']['menu']) ? 'checked="checked"' : '',
34        'LINK_SPECIALS' => ($conf['ContestResults']['menubar_link']['specials']) ? 'checked="checked"' : '',
35        'BLOCK_NUMBER' => $conf['ContestResults']['menubar_block']['number'],
36        'TRUNCATE_SUMMARY' => $conf['ContestResults']['truncate_summary'],
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
45?>
Note: See TracBrowser for help on using the repository browser.