1 | <?php |
---|
2 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
3 | global $template, $conf, $user; |
---|
4 | include_once(PHPWG_ROOT_PATH .'admin/include/tabsheet.class.php'); |
---|
5 | load_language('plugin.lang', TITLE_PATH); |
---|
6 | $my_base_url = get_admin_plugin_menu_link(__FILE__); |
---|
7 | |
---|
8 | // +-----------------------------------------------------------------------+ |
---|
9 | // | Check Access and exit when user status is not ok | |
---|
10 | // +-----------------------------------------------------------------------+ |
---|
11 | check_status(ACCESS_ADMINISTRATOR); |
---|
12 | |
---|
13 | // Gestion des onglets |
---|
14 | if (!isset($_GET['tab'])) |
---|
15 | $page['tab'] = 'plugtitle'; |
---|
16 | else |
---|
17 | $page['tab'] = $_GET['tab']; |
---|
18 | |
---|
19 | $tabsheet = new tabsheet(); |
---|
20 | $tabsheet->add('plugtitle', |
---|
21 | l10n('title_tab_plgtitle'), |
---|
22 | $my_base_url.'&tab=plugtitle'); |
---|
23 | $PAC = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'ContactForm';")); |
---|
24 | if($PAC['state'] == 'active') |
---|
25 | { |
---|
26 | $tabsheet->add('contacttitle', |
---|
27 | l10n('Contact Title'), |
---|
28 | $my_base_url.'&tab=contacttitle'); |
---|
29 | } |
---|
30 | $PAAP = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'AdditionalPages';")); |
---|
31 | if($PAAP['state'] == 'active') |
---|
32 | { |
---|
33 | $tabsheet->add('AdditionalPagestitle', |
---|
34 | l10n('Additional Pages Title'), |
---|
35 | $my_base_url.'&tab=AdditionalPagestitle'); |
---|
36 | } |
---|
37 | $tabsheet->select($page['tab']); |
---|
38 | $tabsheet->assign(); |
---|
39 | |
---|
40 | // Tab Title on specials pages |
---|
41 | switch ($page['tab']) |
---|
42 | { |
---|
43 | case 'plugtitle': |
---|
44 | |
---|
45 | $titlepagelistT = array( |
---|
46 | l10n('title_select'), |
---|
47 | '----------------------', |
---|
48 | l10n('Home'), |
---|
49 | l10n('Best rated'), |
---|
50 | l10n('Most visited'), |
---|
51 | l10n('Recent pictures'), |
---|
52 | l10n('Recent categories'), |
---|
53 | l10n('Favorites'), |
---|
54 | l10n('Tags'), |
---|
55 | l10n('Comments'), |
---|
56 | l10n('About'), |
---|
57 | l10n('search'), |
---|
58 | l10n('Random pictures'), |
---|
59 | l10n('Notification'), |
---|
60 | ); |
---|
61 | |
---|
62 | $titlepagelist = array( |
---|
63 | '', |
---|
64 | '', |
---|
65 | 'home', |
---|
66 | 'best_rated', |
---|
67 | 'most_visited', |
---|
68 | 'recent_pics', |
---|
69 | 'recent_cats', |
---|
70 | 'favorites', |
---|
71 | 'tags', |
---|
72 | 'comments', |
---|
73 | 'about', |
---|
74 | 'search', |
---|
75 | 'random', |
---|
76 | 'notification', |
---|
77 | ); |
---|
78 | |
---|
79 | $template->assign( |
---|
80 | 'gestionA', |
---|
81 | array( |
---|
82 | )); |
---|
83 | |
---|
84 | $template->assign('titlepagelist', $titlepagelist); |
---|
85 | $template->assign('titlepagelistT', $titlepagelistT); |
---|
86 | |
---|
87 | if (isset($_POST['subtitlespecialET']) and (!$_POST['titlelist'])==0 and !is_adviser()) |
---|
88 | { |
---|
89 | $lire=$_POST['titlelist']; |
---|
90 | $query = ' |
---|
91 | select id,page,title |
---|
92 | FROM ' . TITLE_TABLE . ' |
---|
93 | WHERE page = \''.$lire.'\' |
---|
94 | ;'; |
---|
95 | $result = pwg_query($query); |
---|
96 | |
---|
97 | $row = pwg_db_fetch_assoc($result); |
---|
98 | $titlepage=$row['page']; |
---|
99 | $titletitle=$row['title']; |
---|
100 | |
---|
101 | $selected2 = ""; |
---|
102 | |
---|
103 | $template->assign( |
---|
104 | 'title_edit', |
---|
105 | array( |
---|
106 | 'VALUE' => $titlepage, |
---|
107 | 'CONTENT' => $titletitle, |
---|
108 | 'SELECTED' => $selected2 |
---|
109 | )); |
---|
110 | } |
---|
111 | |
---|
112 | if (isset($_POST['subtitlespecial']) and !is_adviser()) |
---|
113 | { |
---|
114 | $query = ' |
---|
115 | UPDATE ' . TITLE_TABLE . ' |
---|
116 | SET title= \''.$_POST['inser'].'\' |
---|
117 | WHERE page = \''.$_POST['invisible'].'\' |
---|
118 | ;'; |
---|
119 | $result = pwg_query($query); |
---|
120 | } |
---|
121 | |
---|
122 | break; |
---|
123 | |
---|
124 | case 'contacttitle': |
---|
125 | |
---|
126 | $template->assign('gestB', |
---|
127 | array('CTBASE' => $conf['contacttitle'],)); |
---|
128 | |
---|
129 | if (isset($_POST['submitct'])) |
---|
130 | { |
---|
131 | conf_update_param('contacttitle', $_POST['contacttitle']); |
---|
132 | $template->assign( |
---|
133 | 'gestB', |
---|
134 | array('CTBASE' => stripslashes($_POST['contacttitle']),)); |
---|
135 | } |
---|
136 | |
---|
137 | break; |
---|
138 | |
---|
139 | case 'AdditionalPagestitle': |
---|
140 | if (!defined('TITLE_AP_TABLE')) define('TITLE_AP_TABLE', $prefixeTable.'title_ap'); |
---|
141 | $groups = array(); |
---|
142 | $query = ' |
---|
143 | select id,title |
---|
144 | FROM ' . ADD_PAGES_TABLE . ' |
---|
145 | ORDER BY id ASC;'; |
---|
146 | $result = pwg_query($query); |
---|
147 | |
---|
148 | while ($row = pwg_db_fetch_assoc($result)) |
---|
149 | { |
---|
150 | $groups[$row['id']] = $row['id'].' : '.$row['title']; |
---|
151 | } |
---|
152 | |
---|
153 | $selected = 0; |
---|
154 | $options[] = l10n('Choose it page'); |
---|
155 | $options['a'] = '----------------------'; |
---|
156 | |
---|
157 | foreach($groups as $listid => $listid2) |
---|
158 | { |
---|
159 | $options[$listid] = $listid2; |
---|
160 | } |
---|
161 | $template->assign( |
---|
162 | 'gestionC', |
---|
163 | array( |
---|
164 | 'OPTIONS' => $options, |
---|
165 | 'SELECTED' => $selected |
---|
166 | )); |
---|
167 | |
---|
168 | if (isset($_POST['submitchoixAP'])and is_numeric($_POST['APchoix']) and (!$_POST['APchoix'])==0) |
---|
169 | { |
---|
170 | $lire=$_POST['APchoix']; |
---|
171 | $query = ' |
---|
172 | select id,title |
---|
173 | FROM ' . TITLE_AP_TABLE . ' |
---|
174 | WHERE id = \''.$lire.'\' |
---|
175 | ;'; |
---|
176 | $result = pwg_query($query); |
---|
177 | $row = pwg_db_fetch_assoc($result); |
---|
178 | $idap=$row['id']; |
---|
179 | $titleap=$row['title']; |
---|
180 | |
---|
181 | $query = ' |
---|
182 | select id,title |
---|
183 | FROM ' . ADD_PAGES_TABLE . ' |
---|
184 | WHERE id = \''.$lire.'\' |
---|
185 | ;'; |
---|
186 | $result = pwg_query($query); |
---|
187 | $row = pwg_db_fetch_assoc($result); |
---|
188 | $idap=$row['id']; |
---|
189 | $nameap=$row['title']; |
---|
190 | |
---|
191 | $selected3 = 0; |
---|
192 | |
---|
193 | $template->assign( |
---|
194 | 'ap_edit', |
---|
195 | array( |
---|
196 | 'VALUE' => $idap, |
---|
197 | 'VALUEN' => $nameap, |
---|
198 | 'CONTENT' => $titleap, |
---|
199 | 'SELECTED' => $selected3 |
---|
200 | )); |
---|
201 | } |
---|
202 | |
---|
203 | if (isset($_POST['submitinsapt'])) |
---|
204 | { |
---|
205 | $query = ' |
---|
206 | DELETE |
---|
207 | FROM ' . TITLE_AP_TABLE . ' |
---|
208 | WHERE id = \''.$_POST['invisible'].'\' |
---|
209 | ;'; |
---|
210 | $result = pwg_query($query); |
---|
211 | $q = ' |
---|
212 | INSERT INTO ' . $prefixeTable . 'title_ap(id,title)VALUES ('.$_POST['invisible'].',"'.$_POST['insertitle'].'");'; |
---|
213 | pwg_query($q); |
---|
214 | } |
---|
215 | |
---|
216 | break; |
---|
217 | |
---|
218 | } |
---|
219 | |
---|
220 | $template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/admin.tpl')); |
---|
221 | $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); |
---|
222 | ?> |
---|