[6768] | 1 | <?php |
---|
| 2 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
| 3 | |
---|
| 4 | // +-----------------------------------------------------------------------+ |
---|
[9200] | 5 | // Modification de la configuration |
---|
[6768] | 6 | // +-----------------------------------------------------------------------+ |
---|
[9200] | 7 | if (isset($_POST['config_submit'])) { |
---|
[9745] | 8 | $conf['ContestResults'] = array( |
---|
[6768] | 9 | 'menubar_mode' => array( |
---|
[6782] | 10 | 'link' => (isset($_POST['menubar_mode_link'])) ? 1 : 0, |
---|
[9200] | 11 | 'block' => (isset($_POST['menubar_mode_block'])) ? 1 : 0, |
---|
[6768] | 12 | ), |
---|
| 13 | 'menubar_link' => array( |
---|
[6782] | 14 | 'menu' => (isset($_POST['menubar_link_menu'])) ? 1 : 0, |
---|
[9200] | 15 | 'specials' => (isset($_POST['menubar_link_specials'])) ? 1 : 0, |
---|
[6768] | 16 | ), |
---|
| 17 | 'menubar_block' => array( |
---|
[9200] | 18 | 'number' => $_POST['menubar_block_number'], |
---|
[9975] | 19 | 'display_days' => (isset($_POST['menubar_block_display_days'])) ? 1 : 0, |
---|
[9200] | 20 | ), |
---|
[9745] | 21 | 'truncate_summary' => $_POST['truncate_summary'], |
---|
[6768] | 22 | ); |
---|
| 23 | |
---|
[9745] | 24 | pwg_query("UPDATE " . CONFIG_TABLE . " SET `value` = '" . serialize($conf['ContestResults']) . "' WHERE `param` = 'ContestResults';"); |
---|
| 25 | $page['infos'][] = l10n('Information data registered in database'); |
---|
[6768] | 26 | } |
---|
| 27 | |
---|
| 28 | // +-----------------------------------------------------------------------+ |
---|
[9200] | 29 | // Définition des variables template |
---|
[6768] | 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'], |
---|
[9975] | 37 | 'BLOCK_DISPLAY_DAYS' => ($conf['ContestResults']['menubar_block']['display_days']) ? 'checked="checked"' : '', |
---|
[9745] | 38 | 'TRUNCATE_SUMMARY' => $conf['ContestResults']['truncate_summary'], |
---|
[6768] | 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'); |
---|
[9745] | 46 | |
---|
[6768] | 47 | ?> |
---|