source: extensions/adult_content/admin/admin.php @ 9530

Last change on this file since 9530 was 9530, checked in by flop25, 13 years ago

[adult_content]
bug:0001900

admin page added, the menu block can be disabled just for guest or for all.
translation needed

File size: 1.3 KB
Line 
1<?php
2
3if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
4$ad_c = get_plugin_data('adult_content');
5
6global $conf, $template, $lang, $page;
7global $prefixeTable;
8load_language('plugin.lang', $ad_c->plugin_path);
9$conf_ad_c = explode("," , $conf['ad_c_plugin']);
10
11
12$page['infos'] = array();
13
14if (isset($_POST['option_ad_c']))
15{
16        $newconf_plugin = array(
17                $_POST['menublock_for_guest'],
18                $_POST['block_on_index'],
19        );
20        $newconf_plugin = implode ("," , $newconf_plugin);
21        $query = '
22                UPDATE '.CONFIG_TABLE.'
23                SET value="'.$newconf_plugin.'"
24                WHERE param="ad_c_plugin"
25                LIMIT 1';
26        pwg_query($query);
27                               
28        array_push($page['infos'], l10n('ad_c_msg_admin_1'));
29}
30
31load_conf_from_db();
32$conf_ad_c = explode("," , $conf['ad_c_plugin']);
33
34$check='checked="checked"';
35if ($conf_ad_c[0]=='true') { $menublock=$check; } else { $menublock=NULL; } 
36if ($conf_ad_c[1]=='true') { $index=$check; } else { $index=NULL; }
37$disabled='disabled="disabled"';
38        $template->assign(
39                array(
40                  'AD_C_menublock_for_guest' => $menublock,
41                  'AD_C_block_on_index' => $index,
42                  'AD_C_block_on_index_disabled' => $disabled,
43                )
44          );
45
46$template->set_filename('plugin_admin_content', $ad_c->plugin_path.'admin/admin.tpl');
47$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
48?>
Note: See TracBrowser for help on using the repository browser.