1 | <?php |
---|
2 | |
---|
3 | if (!defined('PHPWG_ROOT_PATH')) |
---|
4 | die('Hacking attempt!'); |
---|
5 | global $template, $conf, $user; |
---|
6 | include_once(PHPWG_ROOT_PATH . 'admin/include/tabsheet.class.php'); |
---|
7 | load_language('plugin.lang', SPBA_PATH); |
---|
8 | $my_base_url = get_admin_plugin_menu_link(__FILE__); |
---|
9 | |
---|
10 | // +-----------------------------------------------------------------------+ |
---|
11 | // | Check Access and exit when user status is not ok | |
---|
12 | // +-----------------------------------------------------------------------+ |
---|
13 | check_status(ACCESS_ADMINISTRATOR); |
---|
14 | |
---|
15 | global $conf, $page; |
---|
16 | |
---|
17 | $template->assign( |
---|
18 | array( |
---|
19 | 'SPBU1' => $conf['see_photos_by_user_nbphotos'], |
---|
20 | 'SPBU2' => $conf['see_photos_by_user_limit'], |
---|
21 | 'SPBU3' => $conf['see_photos_by_user_order'], |
---|
22 | 'SPBU4' => $conf['see_photos_by_user_show'], |
---|
23 | 'SPBU5' => $conf['see_photos_by_user_color'], |
---|
24 | 'SPBU6' => $conf['see_photos_by_user_show_user_home'], |
---|
25 | 'SPBU7' => $conf['see_photos_by_user_shape'], |
---|
26 | 'SPBA_PATH2'=> get_root_url() . SPBA_PATH, |
---|
27 | ) |
---|
28 | ); |
---|
29 | |
---|
30 | $SPBU3T = array( |
---|
31 | l10n('users in alphabetical order'), |
---|
32 | l10n('users by reverse alphabetical order'), |
---|
33 | l10n('by increasing number of photos'), |
---|
34 | l10n('by decreasing number of photos'), |
---|
35 | ); |
---|
36 | |
---|
37 | $SPBU3 = array( |
---|
38 | 'username ASC', |
---|
39 | 'username DESC', |
---|
40 | 'PBU ASC', |
---|
41 | 'PBU DESC', |
---|
42 | ); |
---|
43 | |
---|
44 | $template->assign('spbu', $SPBU3); |
---|
45 | $template->assign('spbuT', $SPBU3T); |
---|
46 | |
---|
47 | $PAPAB = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'Photo_add_by';")); |
---|
48 | if($PAPAB['state'] == 'active') |
---|
49 | { |
---|
50 | $SPBU3T2 = array( |
---|
51 | l10n('nothing'), |
---|
52 | l10n('link Specials menu'), |
---|
53 | l10n('bloc menu users'), |
---|
54 | ); |
---|
55 | $SPBU32 = array( |
---|
56 | '-1', |
---|
57 | '1', |
---|
58 | '2', |
---|
59 | ); |
---|
60 | }else{ |
---|
61 | $SPBU3T2 = array( |
---|
62 | l10n('link Specials menu'), |
---|
63 | l10n('bloc menu users'), |
---|
64 | ); |
---|
65 | $SPBU32 = array( |
---|
66 | '1', |
---|
67 | '2', |
---|
68 | ); |
---|
69 | } |
---|
70 | |
---|
71 | $template->assign('spbu2', $SPBU32); |
---|
72 | $template->assign('spbuT2', $SPBU3T2); |
---|
73 | |
---|
74 | $SPBU4T2 = array( |
---|
75 | // l10n('nothing'), |
---|
76 | l10n('users cloud'), |
---|
77 | l10n('cumulus users cloud'), |
---|
78 | l10n('select users box'), |
---|
79 | ); |
---|
80 | |
---|
81 | $SPBU42 = array( |
---|
82 | // '-1', |
---|
83 | '1', |
---|
84 | '2', |
---|
85 | '3' |
---|
86 | ); |
---|
87 | |
---|
88 | $template->assign('spbu6', $SPBU42); |
---|
89 | $template->assign('spbuT6', $SPBU4T2); |
---|
90 | |
---|
91 | $SPBU7 = array( |
---|
92 | 'sphere', |
---|
93 | 'vcylinder', |
---|
94 | 'hcylinder', |
---|
95 | 'vring', |
---|
96 | 'hring', |
---|
97 | ); |
---|
98 | |
---|
99 | $SPBUT7 = array( |
---|
100 | l10n('sphere'), |
---|
101 | l10n('vertical cylinder'), |
---|
102 | l10n('horizontal cylinder'), |
---|
103 | l10n('vertical ring'), |
---|
104 | l10n('horizontal ring'), |
---|
105 | ); |
---|
106 | |
---|
107 | $template->assign('spbu7', $SPBU7); |
---|
108 | $template->assign('spbuT7', $SPBUT7); |
---|
109 | |
---|
110 | if (isset($_POST['submitspbu'])) { |
---|
111 | if (is_numeric($_POST['insspbu1'])) { |
---|
112 | conf_update_param('see_photos_by_user_nbphotos', $_POST['insspbu1']); |
---|
113 | } else { |
---|
114 | array_push($page['errors'], l10n('Maximal number users is incorrect !')); |
---|
115 | } |
---|
116 | if (is_numeric($_POST['insspbu2'])) |
---|
117 | conf_update_param('see_photos_by_user_limit', $_POST['insspbu2']); |
---|
118 | else { |
---|
119 | array_push($page['errors'], l10n('Minimal number photos for show users is incorrect !')); |
---|
120 | } |
---|
121 | conf_update_param('see_photos_by_user_order', $_POST['insspbu3']); |
---|
122 | conf_update_param('see_photos_by_user_show', $_POST['insspbu4']); |
---|
123 | conf_update_param('see_photos_by_user_color', $_POST['insspbu5']); |
---|
124 | conf_update_param('see_photos_by_user_show_user_home', $_POST['insspbu6']); |
---|
125 | conf_update_param('see_photos_by_user_shape', $_POST['insspbu7']); |
---|
126 | if (!$page['errors']) { |
---|
127 | array_push($page['infos'], l10n('Update Complete')); |
---|
128 | } |
---|
129 | |
---|
130 | $template->assign( |
---|
131 | array( |
---|
132 | 'SPBU1' => stripslashes($_POST['insspbu1']), |
---|
133 | 'SPBU2' => stripslashes($_POST['insspbu2']), |
---|
134 | 'SPBU3' => stripslashes($_POST['insspbu3']), |
---|
135 | 'SPBU4' => stripslashes($_POST['insspbu4']), |
---|
136 | 'SPBU5' => stripslashes($_POST['insspbu5']), |
---|
137 | 'SPBU6' => stripslashes($_POST['insspbu6']), |
---|
138 | 'SPBU7' => stripslashes($_POST['insspbu7']), |
---|
139 | ) |
---|
140 | ); |
---|
141 | } |
---|
142 | |
---|
143 | $template->set_filenames(array('plugin_admin_content' => dirname(__FILE__).'/admin.tpl')); |
---|
144 | $template->assign_var_from_handle('ADMIN_CONTENT','plugin_admin_content'); |
---|
145 | ?> |
---|