1 | <?php |
---|
2 | |
---|
3 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
4 | |
---|
5 | global $conf, $template; |
---|
6 | |
---|
7 | load_language('plugin.lang', dirname(__FILE__) . '/'); |
---|
8 | |
---|
9 | $conf_bbcode_bar = explode("," , $conf['bbcode_bar']); |
---|
10 | // Enregistrement de la configuration |
---|
11 | if (isset($_POST['submit'])) { |
---|
12 | if (!isset($_POST['chkb00'])) $_POST['chkb00'] = '0'; |
---|
13 | if (!isset($_POST['chkb01'])) $_POST['chkb01'] = '0'; |
---|
14 | if (!isset($_POST['chkb02'])) $_POST['chkb02'] = '0'; |
---|
15 | if (!isset($_POST['chkb03'])) $_POST['chkb03'] = '0'; |
---|
16 | if (!isset($_POST['chkb04'])) $_POST['chkb04'] = '0'; |
---|
17 | if (!isset($_POST['chkb05'])) $_POST['chkb05'] = '0'; |
---|
18 | if (!isset($_POST['chkb06'])) $_POST['chkb06'] = '0'; |
---|
19 | if (!isset($_POST['chkb07'])) $_POST['chkb07'] = '0'; |
---|
20 | if (!isset($_POST['chkb08'])) $_POST['chkb08'] = '0'; |
---|
21 | if (!isset($_POST['chkb09'])) $_POST['chkb09'] = '0'; |
---|
22 | if (!isset($_POST['chkb10'])) $_POST['chkb10'] = '0'; |
---|
23 | if (!isset($_POST['chkb11'])) $_POST['chkb11'] = '0'; |
---|
24 | if (!isset($_POST['chkb12'])) $_POST['chkb12'] = '0'; |
---|
25 | if (!isset($_POST['chkb13'])) $_POST['chkb13'] = '0'; |
---|
26 | if (!isset($_POST['chkb14'])) $_POST['chkb14'] = '0'; |
---|
27 | if (!isset($_POST['chkb15'])) $_POST['chkb15'] = '0'; |
---|
28 | if (!isset($_POST['chkb16'])) $_POST['chkb16'] = '0'; |
---|
29 | if (!isset($_POST['text17'])) $_POST['text17'] = 'plugins/bbcode_bar/icon'; |
---|
30 | |
---|
31 | $conf_bbcode_bar=array( |
---|
32 | $_POST['chkb00'], |
---|
33 | $_POST['chkb01'], |
---|
34 | $_POST['chkb02'], |
---|
35 | $_POST['chkb03'], |
---|
36 | $_POST['chkb04'], |
---|
37 | $_POST['chkb05'], |
---|
38 | $_POST['chkb06'], |
---|
39 | $_POST['chkb07'], |
---|
40 | $_POST['chkb08'], |
---|
41 | $_POST['chkb09'], |
---|
42 | $_POST['chkb10'], |
---|
43 | $_POST['chkb11'], |
---|
44 | $_POST['chkb12'], |
---|
45 | $_POST['chkb13'], |
---|
46 | $_POST['chkb14'], |
---|
47 | $_POST['chkb15'], |
---|
48 | $_POST['chkb16'], |
---|
49 | $_POST['text17'] |
---|
50 | ); |
---|
51 | |
---|
52 | $new_value_bbcode_bar = implode ("," , $conf_bbcode_bar); |
---|
53 | $query = ' |
---|
54 | UPDATE ' . CONFIG_TABLE . ' |
---|
55 | SET value="' . $new_value_bbcode_bar . '" |
---|
56 | WHERE param="bbcode_bar" |
---|
57 | LIMIT 1'; |
---|
58 | pwg_query($query); |
---|
59 | array_push($page['infos'], l10n('bbcb_config_saved')); |
---|
60 | |
---|
61 | } |
---|
62 | // Parametrage du template |
---|
63 | if ($conf_bbcode_bar[0] == 1) $template->assign(array('CHKB00_STATUS' => 'checked="checked"')); |
---|
64 | if ($conf_bbcode_bar[1] == 1) $template->assign(array('CHKB01_STATUS' => 'checked="checked"')); |
---|
65 | if ($conf_bbcode_bar[2] == 1) $template->assign(array('CHKB02_STATUS' => 'checked="checked"')); |
---|
66 | if ($conf_bbcode_bar[3] == 1) $template->assign(array('CHKB03_STATUS' => 'checked="checked"')); |
---|
67 | if ($conf_bbcode_bar[4] == 1) $template->assign(array('CHKB04_STATUS' => 'checked="checked"')); |
---|
68 | if ($conf_bbcode_bar[5] == 1) $template->assign(array('CHKB05_STATUS' => 'checked="checked"')); |
---|
69 | if ($conf_bbcode_bar[6] == 1) $template->assign(array('CHKB06_STATUS' => 'checked="checked"')); |
---|
70 | if ($conf_bbcode_bar[7] == 1) $template->assign(array('CHKB07_STATUS' => 'checked="checked"')); |
---|
71 | if ($conf_bbcode_bar[8] == 1) $template->assign(array('CHKB08_STATUS' => 'checked="checked"')); |
---|
72 | if ($conf_bbcode_bar[9] == 1) $template->assign(array('CHKB09_STATUS' => 'checked="checked"')); |
---|
73 | if ($conf_bbcode_bar[10] == 1) $template->assign(array('CHKB10_STATUS' => 'checked="checked"')); |
---|
74 | if ($conf_bbcode_bar[11] == 1) $template->assign(array('CHKB11_STATUS' => 'checked="checked"')); |
---|
75 | if ($conf_bbcode_bar[12] == 1) $template->assign(array('CHKB12_STATUS' => 'checked="checked"')); |
---|
76 | if ($conf_bbcode_bar[13] == 1) $template->assign(array('CHKB13_STATUS' => 'checked="checked"')); |
---|
77 | if ($conf_bbcode_bar[14] == 1) $template->assign(array('CHKB14_STATUS' => 'checked="checked"')); |
---|
78 | if ($conf_bbcode_bar[15] == 1) $template->assign(array('CHKB15_STATUS' => 'checked="checked"')); |
---|
79 | //if ($conf_bbcode_bar[16] == 1) $template->assign(array('CHKB16_STATUS' => 'checked="checked"')); |
---|
80 | |
---|
81 | $template->assign(array('TEXT17_STATUS' => $conf_bbcode_bar[17])); |
---|
82 | |
---|
83 | $template->set_filename('bbcode_bar_conf', dirname(__FILE__) . '/bbcode_bar_admin.tpl'); |
---|
84 | $template->assign_var_from_handle('ADMIN_CONTENT', 'bbcode_bar_conf'); |
---|
85 | |
---|
86 | ?> |
---|