source: extensions/AdditionalPages/admin/config.inc.php @ 9263

Last change on this file since 9263 was 9263, checked in by patdenice, 10 years ago

Bugs corrected

File size: 1.5 KB
Line 
1<?php
2
3if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
4
5// Enregistrement de la configuration
6if (isset($_POST['submit']))
7{
8  $params = array('show_home', 'group_perm', 'user_perm');
9
10  $new_conf = array();
11  foreach ($params as $param)
12  {
13    $new_conf[$param] = isset($_POST[$param]);
14  }
15
16  $new_conf['languages'] = array();
17        foreach($_POST['menu_lang'] as $language_code => $name)
18  {
19                if (!empty($name))
20      $new_conf['languages'][$language_code] = $name;
21        }
22
23  $new_conf['homepage'] = $conf['additional_pages']['homepage'];
24
25    $query = '
26UPDATE ' . CONFIG_TABLE . '
27  SET value="'.addslashes(serialize($new_conf)).'"
28  WHERE param="additional_pages"
29  LIMIT 1';
30    pwg_query($query);
31    array_push($page['infos'], l10n('ap_conf_saved'));
32    $conf['additional_pages'] = $new_conf;
33}
34
35// Gestion des langues pour le bloc menu
36$template->assign('LANG_DEFAULT_VALUE', @$conf['additional_pages']['languages']['default']);
37foreach (get_languages() as $language_code => $language_name)
38{
39        $template->append('language', array(
40    'LANGUAGE_NAME' => $language_name,
41    'LANGUAGE_CODE' => $language_code,
42    'VALUE' => isset($conf['additional_pages']['languages'][$language_code]) ? $conf['additional_pages']['languages'][$language_code] : '',
43    )
44  );
45}
46
47// Parametrage du template
48$template->assign('ap_conf', $conf['additional_pages']);
49
50$template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/template/config.tpl'));
51$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
52
53?>
Note: See TracBrowser for help on using the repository browser.