source: extensions/bbcode_bar/admin.php @ 9682

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

[extentions] BBcode Bar

  • compatibility with Piwigo 2.2.0
  • many corrections
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$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        {
15                $conf_bbcode_bar[] = (isset($_POST['chkb'.sprintf("%02d", $i)])) ? $_POST['chkb'.sprintf("%02d", $i)] : 0;
16        }
17        $conf_bbcode_bar[] = (isset($_POST['text17'])) ? $_POST['text17'] : 'plugins/bbcode_bar/icon';
18       
19        // enregistrement
20    $new_value_bbcode_bar = implode ("," , $conf_bbcode_bar);
21    $query = 'UPDATE ' . CONFIG_TABLE . '
22                SET value="' . $new_value_bbcode_bar . '"
23                WHERE param="bbcode_bar"';
24    pwg_query($query);
25    array_push($page['infos'], l10n('Information data registered in database'));
26       
27}
28
29// Parametrage du template
30for ($i=0; $i<=15; $i++)
31{
32        $template->assign('CHKB'.sprintf("%02d", $i).'_STATUS', ($conf_bbcode_bar[$i] == 1) ? 'checked="checked"' : null);
33}
34$template->assign(array('TEXT17_STATUS' => $conf_bbcode_bar[16]));
35
36$template->set_filename('bbcode_bar_conf', dirname(__FILE__) . '/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.