source: extensions/bbcode_bar/admin.php @ 24278

Last change on this file since 24278 was 10983, checked in by mistic100, 14 years ago

code cleanup

File size: 1.1 KB
Line 
1<?php
2if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
3
4global $conf, $template;
5load_language('plugin.lang', BBcode_PATH);
6
7// Met à jour la configuration si necessaire
8if (strpos($conf['bbcode_bar'],',') !== false)
9{
10  include(BBcode_PATH .'maintain.inc.php');
11  plugin_activate();
12}
13
14$conf_bbcode_bar = unserialize($conf['bbcode_bar']);
15
16// Enregistrement de la configuration
17if (isset($_POST['submit']))
18{ 
19  // nouveau tableau de config
20  unset($conf_bbcode_bar);
21  foreach(unserialize(BBcode_codes) as $key) {
22    $conf_bbcode_bar[$key] = (isset($_POST[$key])) ? true : false;
23  }
24 
25  // enregistrement
26  conf_update_param('bbcode_bar', serialize($conf_bbcode_bar));
27  array_push($page['infos'], l10n('Information data registered in database'));
28}
29
30// Parametrage du template
31foreach(unserialize(BBcode_codes) as $key) {
32  $template->assign(strtoupper($key).'_STATUS', ($conf_bbcode_bar[$key] == 1) ? 'checked="checked"' : null);
33}
34
35$template->assign('BBCODE_PATH', BBcode_PATH);
36$template->set_filename('bbcode_bar_conf', dirname(__FILE__) . '/template/bbcode_bar_admin.tpl');
37$template->assign_var_from_handle('ADMIN_CONTENT', 'bbcode_bar_conf');
38
39?>
Note: See TracBrowser for help on using the repository browser.