source: extensions/Back2Front/admin.php @ 11516

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

add some options, better intégration

File size: 1.6 KB
Line 
1<?php
2if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
3
4global $conf, $template;
5load_language('plugin.lang', B2F_PATH);
6$conf['back2front'] = explode(',', $conf['back2front']);
7
8include_once(B2F_PATH.'functions.inc.php');
9
10// Enregistrement de la configuration
11if (isset($_POST['submit']))
12{
13        $conf['back2front'] = array(
14    $conf['back2front'][0], 
15    $_POST['switch_mode'], 
16    $_POST['transition'],
17    $_POST['position'],
18    serialize(stripslashes_deep(str_replace(array("'",'"',','), null, $_POST['link_name']))),
19  );
20       
21  conf_update_param('back2front', implode (',', $conf['back2front']));
22        array_push($page['infos'], l10n('Information data registered in database'));
23}
24
25// Gestion des langues pour le bloc menu
26$conf['back2front'][4] = unserialize($conf['back2front'][4]);
27$template->append('link_name', array(
28  'LANGUAGE_NAME' => l10n('Default'),
29  'LANGUAGE_CODE' => 'default',
30  'VALUE' => @$conf['back2front'][4]['default'],
31  )
32);
33foreach (get_languages() as $language_code => $language_name)
34{
35        $template->append('link_name', array(
36    'LANGUAGE_NAME' => $language_name,
37    'LANGUAGE_CODE' => $language_code,
38    'VALUE' => isset($conf['back2front'][4][$language_code]) ? $conf['back2front'][4][$language_code] : '',
39    )
40  );
41}
42
43$template->assign(array(
44  'B2F_PATH' => B2F_PATH,
45        'SWITCH_MODE' => $conf['back2front'][1],
46        'TRANSITION' => $conf['back2front'][2],
47  'POSITION' => $conf['back2front'][3],
48));
49       
50$template->set_filename('back2front_conf', dirname(__FILE__).'/template/admin.tpl');
51$template->assign_var_from_handle('ADMIN_CONTENT', 'back2front_conf');
52
53?>
Note: See TracBrowser for help on using the repository browser.