Changeset 25655 for extensions/AdminTools/include
- Timestamp:
- Nov 23, 2013, 5:47:04 PM (11 years ago)
- Location:
- extensions/AdminTools/include
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/AdminTools/include/MultiView.class.php
r25619 r25655 1 1 <?php 2 defined('ADMINTOOLS_ ID') or die('Hacking attempt!');2 defined('ADMINTOOLS_PATH') or die('Hacking attempt!'); 3 3 4 4 /** … … 129 129 130 130 // view_as 131 if (isset($_GET[' view_as']))132 { 133 $this->data['view_as'] = (int)$_GET[' view_as'];131 if (isset($_GET['ato_view_as'])) 132 { 133 $this->data['view_as'] = (int)$_GET['ato_view_as']; 134 134 } 135 135 if ($this->data['view_as'] != $user['id']) … … 141 141 142 142 // theme 143 if (isset($_GET[' theme']))144 { 145 $this->data['theme'] = $_GET[' theme'];143 if (isset($_GET['ato_theme'])) 144 { 145 $this->data['theme'] = $_GET['ato_theme']; 146 146 } 147 147 $user['theme'] = $this->data['theme']; 148 148 149 149 // lang 150 if (isset($_GET[' lang']))151 { 152 $this->data['lang'] = $_GET[' lang'];150 if (isset($_GET['ato_lang'])) 151 { 152 $this->data['lang'] = $_GET['ato_lang']; 153 153 } 154 154 $user['language'] = $this->data['lang']; 155 155 156 156 // show_queries 157 if (isset($_GET[' show_queries']))158 { 159 $this->data['show_queries'] = (bool)$_GET[' show_queries'];157 if (isset($_GET['ato_show_queries'])) 158 { 159 $this->data['show_queries'] = (bool)$_GET['ato_show_queries']; 160 160 } 161 161 $conf['show_queries'] = $this->data['show_queries']; 162 162 163 163 // debug_l10n 164 if (isset($_GET[' debug_l10n']))165 { 166 $this->data['debug_l10n'] = (bool)$_GET[' debug_l10n'];164 if (isset($_GET['ato_debug_l10n'])) 165 { 166 $this->data['debug_l10n'] = (bool)$_GET['ato_debug_l10n']; 167 167 } 168 168 $conf['debug_l10n'] = $this->data['debug_l10n']; 169 169 170 170 // debug_template 171 if (isset($_GET[' debug_template']))172 { 173 $this->data['debug_template'] = (bool)$_GET[' debug_template'];171 if (isset($_GET['ato_debug_template'])) 172 { 173 $this->data['debug_template'] = (bool)$_GET['ato_debug_template']; 174 174 } 175 175 $conf['debug_template'] = $this->data['debug_template']; 176 176 177 177 // template_combine_files 178 if (isset($_GET[' template_combine_files']))179 { 180 $this->data['template_combine_files'] = (bool)$_GET[' template_combine_files'];178 if (isset($_GET['ato_template_combine_files'])) 179 { 180 $this->data['template_combine_files'] = (bool)$_GET['ato_template_combine_files']; 181 181 } 182 182 $conf['template_combine_files'] = $this->data['template_combine_files']; 183 183 184 184 // no_history 185 if (isset($_GET[' no_history']))186 { 187 $this->data['no_history'] = (bool)$_GET[' no_history'];185 if (isset($_GET['ato_no_history'])) 186 { 187 $this->data['no_history'] = (bool)$_GET['ato_no_history']; 188 188 } 189 189 if ($this->data['no_history']) … … 201 201 public function init() 202 202 { 203 if (isset($_GET[' purge_template']))203 if (isset($_GET['ato_purge_template'])) 204 204 { 205 205 global $template; -
extensions/AdminTools/include/events.inc.php
r25654 r25655 2 2 defined('ADMINTOOLS_PATH') or die('Hacking attempt!'); 3 3 4 /** 5 * Add main toolbar to current page 6 * @trigger loc_after_page_header 7 */ 4 8 function admintools_add_public_controller() 5 9 { … … 24 28 ); 25 29 30 if (!is_admin()) 31 { 32 load_language('admin.lang'); 33 } 34 35 switch_lang_to(get_default_language()); 36 26 37 // TODO : param to allow owner modification 27 38 if (script_basename() == 'picture') … … 86 97 87 98 $tpl_vars['QUICK_EDIT'] = array( 88 ' file' => $picture['current']['file'],99 'img' => $picture['current']['derivatives']['square'], 89 100 'name' => $picture['current']['name'], 90 101 'comment' => $picture['current']['comment'], … … 118 129 ); 119 130 } 131 132 $query = 'SELECT * FROM '.IMAGES_TABLE.' WHERE id = '. $page['category']['representative_picture_id'] .';'; 133 $image_infos = pwg_db_fetch_assoc(pwg_query($query)); 134 135 $tpl_vars['QUICK_EDIT'] = array( 136 'img' => DerivativeImage::get_one(IMG_SQUARE, $image_infos), 137 'name' => $page['category']['name'], 138 'comment' => $page['category']['comment'], 139 ); 120 140 } 121 141 … … 134 154 include_once(PHPWG_ROOT_PATH.'admin/include/themes.class.php'); 135 155 $themes = new themes(); 136 foreach (array_keys($themes->fs_themes) as $theme) 137 { 138 $tpl_vars['THEMES'][$theme] = $theme; 156 foreach (array_keys($themes->db_themes_by_id) as $theme) 157 { 158 if (!empty($theme)) 159 { 160 $tpl_vars['THEMES'][$theme] = $theme; 161 } 139 162 } 140 163 … … 153 176 $template->set_filename('ato', realpath(ADMINTOOLS_PATH . 'template/public_controller.tpl')); 154 177 $template->parse('ato'); 155 } 156 178 179 switch_lang_back(); 180 } 181 182 /** 183 * Disable privacy level switchbox 184 */ 157 185 function admintools_remove_privacy($content) 158 186 { … … 162 190 } 163 191 192 /** 193 * Save picture form 194 * @trigger loc_begin_picture 195 */ 164 196 function admintools_save_picture() 165 197 { … … 225 257 } 226 258 } 259 260 /** 261 * Save category form 262 * @trigger loc_begin_index 263 */ 264 function admintools_save_category() 265 { 266 global $page, $conf; 267 268 if (@$_POST['action'] == 'quick_edit') 269 { 270 $data = array( 271 'name' => $_POST['name'], 272 ); 273 274 if ($conf['allow_html_descriptions']) 275 { 276 $data['comment'] = @$_POST['comment']; 277 } 278 else 279 { 280 $data['comment'] = strip_tags(@$_POST['comment']); 281 } 282 283 single_update( 284 CATEGORIES_TABLE, 285 $data, 286 array('id' => $page['category']['id']) 287 ); 288 289 redirect(duplicate_index_url()); 290 } 291 }
Note: See TracChangeset
for help on using the changeset viewer.