source: extensions/bbcode_bar/admin.php @ 9965

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

[extentions] BBCode Bar

  • uses markItUp!
File size: 1.2 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    $query = "UPDATE " . CONFIG_TABLE . "
27                SET value='" . serialize($conf_bbcode_bar) . "'
28                WHERE param='bbcode_bar'";
29    pwg_query($query);
30    array_push($page['infos'], l10n('Information data registered in database'));
31}
32
33// Parametrage du template
34foreach(unserialize(BBcode_codes) as $key) {
35        $template->assign(strtoupper($key).'_STATUS', ($conf_bbcode_bar[$key] == 1) ? 'checked="checked"' : null);
36}
37
38$template->assign('BBCODE_PATH', BBcode_PATH);
39$template->set_filename('bbcode_bar_conf', dirname(__FILE__) . '/template/bbcode_bar_admin.tpl');
40$template->assign_var_from_handle('ADMIN_CONTENT', 'bbcode_bar_conf');
41
42?>
Note: See TracBrowser for help on using the repository browser.