source: extensions/Back2Front/admin.php @ 27153

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

use serialized array for config + custom upgrade process

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