Changeset 25979 for extensions/AdminTools
- Timestamp:
- Dec 17, 2013, 12:14:08 PM (10 years ago)
- Location:
- extensions/AdminTools
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/AdminTools/include/MultiView.class.php
r25915 r25979 12 12 /** @var array $data */ 13 13 private $data = array(); 14 private $data_url_params = array(); 14 15 15 16 /** @var array $user */ … … 36 37 pwg_get_session_var('multiview', array()) 37 38 ); 39 40 $this->data_url_params = array_keys($this->data); 41 $this->data_url_params = array_map(create_function('$d', 'return "ato_".$d;'), $this->data_url_params); 38 42 } 39 43 … … 80 84 if (script_basename() == 'picture') 81 85 { 82 $url = duplicate_picture_url(array(), array_keys($this->data));86 $url = duplicate_picture_url(array(), $this->data_url_params); 83 87 } 84 88 else if (script_basename() == 'index') 85 89 { 86 $url = duplicate_index_url(array(), array_keys($this->data));90 $url = duplicate_index_url(array(), $this->data_url_params); 87 91 } 88 92 else 89 93 { 90 $url = get_query_string_diff( array_keys($this->data));94 $url = get_query_string_diff($this->data_url_params); 91 95 } 92 96 … … 111 115 'id' => $user['id'], 112 116 'username' => $user['username'], 117 'language' => $user['language'], 118 'theme' => $user['theme'], 113 119 ); 114 120 … … 130 136 131 137 // view_as 132 if (isset($_GET['ato_view_as'])) 133 { 134 $this->data['view_as'] = (int)$_GET['ato_view_as']; 135 } 136 if ($this->data['view_as'] != $user['id']) 137 { 138 $user = build_user($this->data['view_as'], true); 139 $this->data['theme'] = $user['theme']; 140 $this->data['lang'] = $user['language']; 138 if (!defined('IN_ADMIN')) 139 { 140 if (isset($_GET['ato_view_as'])) 141 { 142 $this->data['view_as'] = (int)$_GET['ato_view_as']; 143 } 144 if ($this->data['view_as'] != $user['id']) 145 { 146 $user = build_user($this->data['view_as'], true); 147 if (isset($_GET['ato_view_as'])) 148 { 149 $this->data['theme'] = $user['theme']; 150 $this->data['lang'] = $user['language']; 151 } 152 } 141 153 } 142 154 … … 195 207 $this->save(); 196 208 } 209 } 210 211 /** 212 * Returns the language of the current user if different from the current language 213 * false otherwise 214 */ 215 function get_user_language() 216 { 217 if (isset($this->user['language']) && isset($this->data['lang']) 218 && $this->user['language'] != $this->data['lang'] 219 ) 220 { 221 return $this->user['language']; 222 } 223 return false; 197 224 } 198 225 -
extensions/AdminTools/include/events.inc.php
r25916 r25979 26 26 $tpl_vars['DELETE_CACHE'] = isset($conf['multiview_invalidate_cache']); 27 27 28 include_once(PHPWG_ROOT_PATH . 'include/functions_mail.inc.php'); 29 switch_lang_to(get_default_language()); 28 if (($admin_lang = $MultiView->get_user_language()) !== false) 29 { 30 include_once(PHPWG_ROOT_PATH . 'include/functions_mail.inc.php'); 31 switch_lang_to($admin_lang); 32 } 30 33 } 31 34 else if (script_basename() == 'picture' and $picture['current']['added_by'] == $user['id']) … … 76 79 ); 77 80 78 $query = ' 79 SELECT id FROM ' . CATEGORIES_TABLE.' 80 WHERE id = ' . $page['category']['id'] .' 81 AND representative_picture_id = ' . $page['image_id'] .' 82 ;'; 83 $tpl_vars['IS_REPRESENTATIVE'] = pwg_db_num_rows(pwg_query($query)) > 0; 81 $tpl_vars['IS_REPRESENTATIVE'] = $page['category']['representative_picture_id'] == $page['image_id']; 84 82 } 85 83 … … 167 165 $template->parse('ato_public_controller'); 168 166 169 if ($MultiView->is_admin() )167 if ($MultiView->is_admin() && @$admin_lang !== false) 170 168 { 171 169 switch_lang_back(); -
extensions/AdminTools/template/public_controller.js
r25924 r25979 6 6 7 7 var $ato = $('#ato_header'), 8 $ato_closed = $('#ato_header_closed'); 8 $ato_closed = $('#ato_header_closed'), 9 ato_height = 28; // normal height, real height conputed on init() 9 10 10 11 // move to whole page down or up 11 12 function moveBody(dir, anim) { 12 var operator = dir=='show' ? '+=' : '-=', 13 ato_height = $ato.height(); 13 var operator = dir=='show' ? '+=' : '-='; 14 14 15 15 if (anim) { … … 103 103 this.init = function(urlSelf) { 104 104 $('body').prepend($ato); // ensure the bar is at the begining 105 106 $ato.show(); 107 ato_height = $ato.height(); 105 108 106 109 if ('localStorage' in window) { … … 110 113 111 114 if (window.localStorage.ato_panel_open == "true") { 112 $ato.show();113 115 moveBody('show', false); 114 116 } 115 117 else { 118 $ato.hide(); 116 119 $ato_closed.show(); 117 120 } … … 264 267 transition: 'none', 265 268 width: 500, 269 maxWidth: '100%', 266 270 top: 50, 267 271 title: $ato_edit.attr('title'), -
extensions/AdminTools/template/style.css
r25924 r25979 48 48 overflow:visible; 49 49 } 50 #ato_header>ul>li a { 51 color:white; 52 } 50 53 #ato_header>ul>li.right { 51 54 float:right;
Note: See TracChangeset
for help on using the changeset viewer.