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 | $newconf_plugin .= '#'; |
---|
19 | $newconf_plugin .= (isset($_POST['show-title'])) ? "true" : "false"; |
---|
20 | $newconf_plugin .= '#'; |
---|
21 | $newconf_plugin .= (isset($_POST['opacity'])) ? "true" : "false"; |
---|
22 | conf_update_param('imgpreview', pwg_db_real_escape_string($newconf_plugin)); |
---|
23 | array_push($page['infos'], l10n('imgp_conf_updated')); |
---|
24 | } |
---|
25 | |
---|
26 | load_conf_from_db(); |
---|
27 | $conf_imgp = explode("#" , $conf['imgpreview']); |
---|
28 | $val_title=(isset($conf_imgp[2]) and $conf_imgp[2]=="true") ? "checked" : ""; |
---|
29 | $val_opacity=(isset($conf_imgp[3]) and $conf_imgp[3]=="true") ? "checked" : ""; |
---|
30 | $template->assign( |
---|
31 | array( |
---|
32 | 'MAX_W' => 'value="'.$conf_imgp[0].'"', |
---|
33 | 'MAX_H' => 'value="'.$conf_imgp[1].'"', |
---|
34 | 'SHOW_TITTLE' => $val_title, |
---|
35 | 'OPACITY' => $val_opacity, |
---|
36 | 'PWG_TOKEN' => get_pwg_token() |
---|
37 | ) |
---|
38 | ); |
---|
39 | $template->set_filename('plugin_admin_content', dirname(__FILE__).'/admin.tpl'); |
---|
40 | $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); |
---|
41 | ?> |
---|