Line | |
---|
1 | <?php |
---|
2 | |
---|
3 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
4 | |
---|
5 | global $conf, $template, $lang, $page; |
---|
6 | load_language('plugin.lang', IMGP_PATH); |
---|
7 | |
---|
8 | |
---|
9 | $page['infos'] = array(); |
---|
10 | |
---|
11 | if (isset($_POST['envoi_config']) and $_POST['envoi_config']=='imgpreview') |
---|
12 | { |
---|
13 | $conf_imgp = explode("#" , $conf['imgpreview']); |
---|
14 | check_pwg_token(); |
---|
15 | $newconf_plugin = (isset($_POST['max-width']) and preg_match("#^[0-9]+$#",$_POST['max-width'])) ? $_POST['max-width'] : $conf_imgp[0]; |
---|
16 | $newconf_plugin .= '#'; |
---|
17 | $newconf_plugin .= (isset($_POST['max-height']) and preg_match("#^[0-9]+$#",$_POST['max-height'])) ? $_POST['max-height'] : $conf_imgp[1]; |
---|
18 | conf_update_param('imgpreview', pwg_db_real_escape_string($newconf_plugin)); |
---|
19 | array_push($page['infos'], l10n('imgp_conf_updated')); |
---|
20 | } |
---|
21 | |
---|
22 | load_conf_from_db(); |
---|
23 | $conf_imgp = explode("#" , $conf['imgpreview']); |
---|
24 | |
---|
25 | $template->assign( |
---|
26 | array( |
---|
27 | 'MAX_W' => 'value="'.$conf_imgp[0].'"', |
---|
28 | 'MAX_H' => 'value="'.$conf_imgp[1].'"', |
---|
29 | 'PWG_TOKEN' => get_pwg_token() |
---|
30 | ) |
---|
31 | ); |
---|
32 | $template->set_filename('plugin_admin_content', dirname(__FILE__).'/admin.tpl'); |
---|
33 | $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); |
---|
34 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.