source: extensions/Front2Back/admin.php @ 10165

Last change on this file since 10165 was 9784, checked in by mistic100, 13 years ago

[extensions] Front2Back

  • new admin page
  • some changes in config
File size: 1.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
8// Enregistrement de la configuration
9if (isset($_POST['submit']))
10{
11        $conf['Front2Back'] = array(
12                !empty($_POST['path']) ? rtrim($_POST['path'],'/').'/' : '',
13                !empty($_POST['parent']) ? rtrim($_POST['parent'],'/').'/' : '',
14                !empty($_POST['hd_parent']) ? rtrim($_POST['hd_parent'],'/').'/' : '',
15                !empty($_POST['suffix']) ? $_POST['suffix'] : '',
16        );
17                       
18    $query = 'UPDATE ' . CONFIG_TABLE . '
19                SET value="' . implode (',', $conf['Front2Back']) . '"
20                WHERE param="Front2Back"';
21    pwg_query($query);
22       
23        array_push($page['infos'], l10n('Information data registered in database'));
24}
25
26$template->assign(array(
27        'PATH' => $conf['Front2Back'][0],
28        'PARENT' => $conf['Front2Back'][1],
29        'HD_PARENT' => $conf['Front2Back'][2],
30        'SUFFIX' => $conf['Front2Back'][3],
31));
32       
33$template->set_filename('Front2Back_conf', dirname(__FILE__).'/template/admin.tpl');
34$template->assign_var_from_handle('ADMIN_CONTENT', 'Front2Back_conf');
35
36?>
Note: See TracBrowser for help on using the repository browser.