Changeset 25791 for extensions/AdminTools
- Timestamp:
- Dec 5, 2013, 8:36:36 PM (10 years ago)
- Location:
- extensions/AdminTools
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/AdminTools/include/MultiView.class.php
r25655 r25791 113 113 ); 114 114 115 if ($this->is_admin) 115 // inactive on ws.php to allow AJAX admin tasks 116 if ($this->is_admin && script_basename() != 'ws') 116 117 { 117 118 if ($this->data['view_as'] == 0) … … 201 202 public function init() 202 203 { 203 if (isset($_GET['ato_purge_template'])) 204 { 205 global $template; 206 $template->delete_compiled_templates(); 207 FileCombiner::clear_combined_files(); 204 if ($this->is_admin) 205 { 206 if (isset($_GET['ato_purge_template'])) 207 { 208 global $template; 209 $template->delete_compiled_templates(); 210 FileCombiner::clear_combined_files(); 211 } 208 212 } 209 213 } -
extensions/AdminTools/include/events.inc.php
r25675 r25791 8 8 function admintools_add_public_controller() 9 9 { 10 global $MultiView, $conf ;10 global $MultiView, $conf, $template, $page, $user; 11 11 12 12 if (!$MultiView->is_admin()) … … 14 14 return; 15 15 } 16 17 global $template, $page, $user;18 16 19 17 $url_root = get_root_url(); … … 99 97 100 98 $tpl_vars['QUICK_EDIT'] = array( 101 'img' => $picture['current']['derivatives']['square'] ,99 'img' => $picture['current']['derivatives']['square']->get_url(), 102 100 'name' => $picture['current']['name'], 103 101 'comment' => $picture['current']['comment'], … … 132 130 } 133 131 134 $query = ' 132 $tpl_vars['QUICK_EDIT'] = array( 133 'img' => null, 134 'name' => $page['category']['name'], 135 'comment' => $page['category']['comment'], 136 ); 137 138 if (!empty($page['category']['representative_picture_id'])) 139 { 140 $query = ' 135 141 SELECT * FROM '.IMAGES_TABLE.' 136 142 WHERE id = '. $page['category']['representative_picture_id'] .' 137 143 ;'; 138 $image_infos = pwg_db_fetch_assoc(pwg_query($query)); 139 140 $tpl_vars['QUICK_EDIT'] = array( 141 'img' => DerivativeImage::get_one(IMG_SQUARE, $image_infos), 142 'name' => $page['category']['name'], 143 'comment' => $page['category']['comment'], 144 ); 144 $image_infos = pwg_db_fetch_assoc(pwg_query($query)); 145 146 $tpl_vars['QUICK_EDIT']['img'] = DerivativeImage::get_one(IMG_SQUARE, $image_infos)->get_url(); 147 } 145 148 } 146 149 … … 201 204 function admintools_save_picture() 202 205 { 203 global $page, $conf; 206 global $page, $conf, $MultiView; 207 208 if (!$MultiView->is_admin()) 209 { 210 return; 211 } 204 212 205 213 if (isset($_GET['delete']) and get_pwg_token()==@$_GET['pwg_token']) … … 269 277 function admintools_save_category() 270 278 { 271 global $page, $conf; 279 global $page, $conf, $MultiView; 280 281 if (!$MultiView->is_admin()) 282 { 283 return; 284 } 272 285 273 286 if (@$_POST['action'] == 'quick_edit') -
extensions/AdminTools/main.inc.php
r25655 r25791 10 10 11 11 defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); 12 12 13 13 14 // +-----------------------------------------------------------------------+ … … 31 32 add_event_handler('init', 'admintools_init'); 32 33 33 if (!defined('IN_ADMIN'))34 {35 add_event_handler('loc_after_page_header', 'admintools_add_public_controller');36 add_event_handler('loc_begin_picture', 'admintools_save_picture');37 add_event_handler('loc_begin_index', 'admintools_save_category');38 }39 40 34 add_event_handler('user_init', array(&$MultiView, 'user_init')); 41 35 add_event_handler('init', array(&$MultiView, 'init')); … … 47 41 function admintools_init() 48 42 { 43 global $MultiView; 44 45 if (!defined('IN_ADMIN') && $MultiView->is_admin()) 46 { 47 add_event_handler('loc_after_page_header', 'admintools_add_public_controller'); 48 add_event_handler('loc_begin_picture', 'admintools_save_picture'); 49 add_event_handler('loc_begin_index', 'admintools_save_category'); 50 } 51 52 load_language('plugin.lang', ADMINTOOLS_PATH); 53 49 54 // global $conf; 50 55 … … 52 57 // $maintain = new AdminTools_maintain(ADMINTOOLS_ID); 53 58 // $maintain->autoUpdate(ADMINTOOLS_VERSION, 'install'); 54 55 load_language('plugin.lang', ADMINTOOLS_PATH); 56 59 57 60 // $conf['AdminTools'] = unserialize($conf['AdminTools']); 58 61 } -
extensions/AdminTools/template/public_controller.tpl
r25675 r25791 102 102 <form method="post" action="{$ato.U_SELF}"> 103 103 <fieldset class="left"> 104 <img src="{$ato.QUICK_EDIT.img ->get_url()}" width="100" height="100">104 <img src="{$ato.QUICK_EDIT.img}" width="100" height="100"> 105 105 <input type="submit" value="{'Save'|translate}"> 106 106 <a href="#" class="icon-ato-cancel close-edit">{'Cancel'|translate}</a> … … 150 150 $('body').animate({ldelim}'margin-top': operator+ato_height}); 151 151 152 if ($('#the_page ').css('position')=='absolute') {153 $('#the_page ').animate({ldelim}'top': operator+ato_height});152 if ($('#the_page, [data-role="page"]').css('position')=='absolute') { 153 $('#the_page, [data-role="page"]').animate({ldelim}'top': operator+ato_height}); 154 154 } 155 155 } … … 157 157 $('body').css({ldelim}'margin-top': operator+ato_height}); 158 158 159 if ($('#the_page ').css('position')=='absolute') {160 $('#the_page ').css({ldelim}'top': operator+ato_height});159 if ($('#the_page, [data-role="page"]').css('position')=='absolute') { 160 $('#the_page, [data-role="page"]').css({ldelim}'top': operator+ato_height}); 161 161 } 162 162 } … … 168 168 urlWS = '{$ROOT_URL}ws.php?format=json&method='; 169 169 170 $('body').prepend($ato); 170 $('body').prepend($ato); // ensure the bar is at the begining 171 172 {if $themeconf.mobile} 173 var $headerbar = $('div[data-role="header"] .title'); 174 if ($headerbar.length == 1) { 175 $ato_closed.addClass('smartpocket'); 176 $ato_closed.find('a').attr({ 177 'data-iconpos':'notext', 178 'data-role':'button' 179 }); 180 $headerbar.prepend($ato_closed); 181 } 182 {/if} 171 183 172 184 if (window.localStorage.ato_panel_open == null) { … … 289 301 {if isset($ato.QUICK_EDIT)} 290 302 var $ato_edit = $('#ato_quick_edit'); 291 292 var bg_color = $('#the_page #content').css('background-color'); 293 if (!bg_color || bg_color=='transparent') { 294 bg_color = $('body').css('background-color'); 295 } 296 $ato_edit.css('background-color', bg_color); 303 304 305 setTimeout(function() { 306 var bg_color = 'white'; 307 var selectors = ['#the_page #content', '[data-role="page"]', 'body']; 308 309 for (var i=0; i<selectors.length; i++) { 310 var color = $(selectors[i]).css('background-color'); 311 console.log(selectors[i], color); 312 if (color && color!='transparent') { 313 bg_color = color; 314 break; 315 } 316 } 317 318 $ato_edit.css('background-color', bg_color); 319 }, 1000); 297 320 298 321 $ato_edit.find('.close-edit').on('click', function(e) { -
extensions/AdminTools/template/style.css
r25655 r25791 7 7 #ato_header, #ato_header_closed { 8 8 display:none; 9 } 10 #ato_header, #ato_header_closed:not(.smartpocket) { 9 11 position:fixed; 10 12 top:0; … … 28 30 white-space:nowrap; 29 31 } 30 #ato_header_root li a, #ato_header_closed a {32 #ato_header_root li a, #ato_header_closed:not(.smartpocket) a { 31 33 display:inline-block; 32 34 padding:5px 10px; … … 54 56 border-right:1px solid #222; 55 57 } 56 #ato_header_root>li a, #ato_header_closed a {58 #ato_header_root>li a, #ato_header_closed:not(.smartpocket) a { 57 59 color:#ddd; 58 60 text-shadow:1px 1px 0px #222; … … 62 64 text-shadow:none; 63 65 } 64 #ato_header_root>li:not(.disabled):hover, #ato_header_closed: hover {66 #ato_header_root>li:not(.disabled):hover, #ato_header_closed:not(.smartpocket):hover { 65 67 background:#222; 66 68 background-image:linear-gradient(to bottom, #222, #353535); … … 113 115 } 114 116 115 #ato_header_closed {117 #ato_header_closed:not(.smartpocket) { 116 118 left:10px; 117 119 font-size:20px; … … 121 123 height:35px; 122 124 } 123 #ato_header_closed a {125 #ato_header_closed:not(.smartpocket) a { 124 126 padding:4px; 125 127 } 128 #ato_header_closed.smartpocket { 129 float:left; 130 margin-right:10px; 131 } 132 #ato_header_closed.smartpocket .ui-btn-inner { 133 display:none; 134 } 135 126 136 #ato_header_root a.close-panel { 127 137 padding:6px 1px 4px 5px;
Note: See TracChangeset
for help on using the changeset viewer.