source: extensions/Back2Front/admin.php @ 23177

Last change on this file since 23177 was 23177, checked in by mistic100, 7 years ago

use serialized array for config + custom upgrade process

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