source: extensions/Front2Back/admin.php @ 27949

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

some tests to avoid errors, css bug with IE

File size: 2.1 KB
Line 
1<?php
2if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
3
4global $conf, $template;
5load_language('plugin.lang', F2B_PATH);
6$conf['Front2Back'] = explode(',', $conf['Front2Back']);
7
8if (!function_exists('stripslashes_deep'))
9{
10  function stripslashes_deep($value)
11  {
12    return is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value);
13  }
14}
15
16// Enregistrement de la configuration
17if (isset($_POST['submit']))
18{
19  $conf['Front2Back'] = array(
20    !empty($_POST['path']) ? rtrim($_POST['path'],'/').'/' : '',
21    !empty($_POST['parent']) ? rtrim($_POST['parent'],'/').'/' : '',
22    !empty($_POST['hd_parent']) ? rtrim($_POST['hd_parent'],'/').'/' : '',
23    !empty($_POST['suffix']) ? $_POST['suffix'] : '',
24    $_POST['position'],
25    $_POST['switch_mode'],
26    $_POST['transition'],
27    serialize(stripslashes_deep(str_replace(array("'",'"',','), null, $_POST['link_name']))),
28  );
29     
30  conf_update_param('Front2Back', implode (',', $conf['Front2Back'])); 
31  array_push($page['infos'], l10n('Information data registered in database'));
32}
33
34// Gestion des langues pour le bloc menu
35$conf['Front2Back'][7] = unserialize($conf['Front2Back'][7]);
36$template->append('link_name', array(
37  'LANGUAGE_NAME' => l10n('Default'),
38  'LANGUAGE_CODE' => 'default',
39  'VALUE' => @$conf['Front2Back'][7]['default'],
40  )
41);
42foreach (get_languages() as $language_code => $language_name)
43{
44        $template->append('link_name', array(
45    'LANGUAGE_NAME' => $language_name,
46    'LANGUAGE_CODE' => $language_code,
47    'VALUE' => isset($conf['Front2Back'][7][$language_code]) ? $conf['Front2Back'][7][$language_code] : '',
48    )
49  );
50}
51
52$template->assign(array(
53  'F2B_PATH' => F2B_PATH,
54  'PATH' => $conf['Front2Back'][0],
55  'PARENT' => $conf['Front2Back'][1],
56  'HD_PARENT' => $conf['Front2Back'][2],
57  'SUFFIX' => $conf['Front2Back'][3],
58  'POSITION' => $conf['Front2Back'][4],
59  'SWITCH_MODE' => $conf['Front2Back'][5],
60  'TRANSITION' => $conf['Front2Back'][6],
61));
62 
63$template->set_filename('Front2Back_conf', dirname(__FILE__).'/template/admin.tpl');
64$template->assign_var_from_handle('ADMIN_CONTENT', 'Front2Back_conf');
65
66?>
Note: See TracBrowser for help on using the repository browser.