source: extensions/bbcode_bar/admin.php @ 9787

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

[extentions] BBCode Bar

File size: 1.3 KB
Line 
1<?php
2if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
3
4global $conf, $template;
5load_language('plugin.lang', BBcode_PATH);
6$conf_bbcode_bar = explode("," , $conf['bbcode_bar']);
7
8// Enregistrement de la configuration
9if (isset($_POST['submit']))
10{       
11        // nouveau tableau de config
12        unset($conf_bbcode_bar);
13        for ($i=0; $i<=15; $i++) {
14                $conf_bbcode_bar[] = (isset($_POST['chkb'.sprintf("%02d", $i)])) ? $_POST['chkb'.sprintf("%02d", $i)] : 0;
15        }
16        $conf_bbcode_bar[] = (isset($_POST['text17'])) ? rtrim($_POST['text17'],'/') : 'plugins/bbcode_bar/icon';
17       
18        // enregistrement
19    $new_value_bbcode_bar = implode ("," , $conf_bbcode_bar);
20    $query = 'UPDATE ' . CONFIG_TABLE . '
21                SET value="' . $new_value_bbcode_bar . '"
22                WHERE param="bbcode_bar"';
23    pwg_query($query);
24    array_push($page['infos'], l10n('Information data registered in database'));
25}
26
27// Parametrage du template
28for ($i=0; $i<=15; $i++) {
29        $template->assign('CHKB'.sprintf("%02d", $i).'_STATUS', ($conf_bbcode_bar[$i] == 1) ? 'checked="checked"' : null);
30}
31$template->assign('TEXT17_STATUS', $conf_bbcode_bar[16]);
32
33$template->assign('BBCODE_PATH', BBcode_PATH);
34$template->set_filename('bbcode_bar_conf', dirname(__FILE__) . '/template/bbcode_bar_admin.tpl');
35$template->assign_var_from_handle('ADMIN_CONTENT', 'bbcode_bar_conf');
36
37?>
Note: See TracBrowser for help on using the repository browser.