Changeset 26061
- Timestamp:
- Dec 20, 2013, 9:14:40 PM (10 years ago)
- Location:
- extensions/AdminTools
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/AdminTools/include/events.inc.php
r25979 r26061 32 32 } 33 33 } 34 else if (script_basename() == 'picture' and $picture['current']['added_by'] == $user['id']) 34 else if ($conf['AdminTools']['public_quick_edit'] and 35 script_basename() == 'picture' and $picture['current']['added_by'] == $user['id'] 36 ) 35 37 { // only "edit" button for photo owner 36 38 } … … 40 42 } 41 43 44 $tpl_vars['POSITION'] = $conf['AdminTools']['closed_position']; 45 $tpl_vars['DEFAULT_OPEN'] = $conf['AdminTools']['default_open']; 42 46 $tpl_vars['U_SELF'] = $MultiView->get_clean_url(true); 43 47 -
extensions/AdminTools/language/en_UK/plugin.lang.php
r25839 r26061 13 13 $lang['Show SQL queries'] = 'Show SQL queries'; 14 14 $lang['View as'] = 'View as'; 15 $lang['Closed icon position'] = 'Closed icon position'; 16 $lang['Give access to quick edit to photo owners even if they are not admin'] = 'Give access to quick edit to photo owners even if they are not admin'; 17 $lang['Open toolbar by default'] = 'Open toolbar by default'; 18 $lang['left'] = 'left'; 19 $lang['right'] = 'right'; 15 20 16 21 ?> -
extensions/AdminTools/language/fr_FR/plugin.lang.php
r25839 r26061 13 13 $lang['Show SQL queries'] = 'Afficher les requêtes SQL'; 14 14 $lang['View as'] = 'Voir en tant que'; 15 $lang['Closed icon position'] = 'Position the l\'icône fermé'; 16 $lang['Give access to quick edit to photo owners even if they are not admin'] = 'Autoriser l\'accès à l\'édition rapide aux propriétaires des photos même s\'ils ne sont pas admin'; 17 $lang['Open toolbar by default'] = 'Ouvrir la barre par défaut'; 18 $lang['left'] = 'gauche'; 19 $lang['right'] = 'droite'; 15 20 16 21 ?> -
extensions/AdminTools/main.inc.php
r25916 r26061 17 17 define('ADMINTOOLS_ID', basename(dirname(__FILE__))); 18 18 define('ADMINTOOLS_PATH' , PHPWG_PLUGINS_PATH . ADMINTOOLS_ID . '/'); 19 //define('ADMINTOOLS_ADMIN', get_root_url() . 'admin.php?page=plugin-' . ADMINTOOLS_ID);19 define('ADMINTOOLS_ADMIN', get_root_url() . 'admin.php?page=plugin-' . ADMINTOOLS_ID); 20 20 define('ADMINTOOLS_VERSION', 'auto'); 21 21 … … 45 45 add_event_handler('loc_begin_index', 'admintools_save_category'); 46 46 } 47 else 48 { 49 add_event_handler('get_admin_plugin_menu_links', 'admintools_admin_link'); 50 } 47 51 48 52 … … 52 56 function admintools_init() 53 57 { 54 global $MultiView; 58 global $conf; 59 60 include_once(ADMINTOOLS_PATH . 'maintain.inc.php'); 61 $maintain = new AdminTools_maintain(ADMINTOOLS_ID); 62 $maintain->autoUpdate(ADMINTOOLS_VERSION, 'install'); 55 63 56 64 load_language('plugin.lang', ADMINTOOLS_PATH); 57 65 58 // global $conf; 66 $conf['AdminTools'] = unserialize($conf['AdminTools']); 67 } 59 68 60 // include_once(ADMINTOOLS_PATH . 'maintain.inc.php'); 61 // $maintain = new AdminTools_maintain(ADMINTOOLS_ID); 62 // $maintain->autoUpdate(ADMINTOOLS_VERSION, 'install'); 69 function admintools_admin_link($menu) 70 { 71 $menu[] = array( 72 'NAME' => 'Admin Tools', 73 'URL' => ADMINTOOLS_ADMIN, 74 ); 63 75 64 // $conf['AdminTools'] = unserialize($conf['AdminTools']);76 return $menu; 65 77 } -
extensions/AdminTools/maintain.inc.php
r25617 r26061 2 2 defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); 3 3 4 // class AdminTools_maintain extends PluginMaintain 5 // { 6 // private $installed = false; 4 class AdminTools_maintain extends PluginMaintain 5 { 6 private $installed = false; 7 8 private $default_conf = array( 9 'default_open' => true, 10 'closed_position' => 'left', 11 'public_quick_edit' => true, 12 ); 7 13 8 //function install($plugin_version, &$errors=array())9 //{10 //global $conf;14 function install($plugin_version, &$errors=array()) 15 { 16 global $conf; 11 17 12 // if (empty($conf['AdminTools'])) 13 // { 14 // $conf['AdminTools'] = serialize(array( 15 // )); 18 if (empty($conf['AdminTools'])) 19 { 20 $conf['AdminTools'] = serialize($this->default_conf); 21 conf_update_param('AdminTools', $conf['AdminTools']); 22 } 16 23 17 // conf_update_param('AdminTools', $conf['AdminTools']);18 //}24 $this->installed = true; 25 } 19 26 20 // $this->installed = true; 21 // } 27 function activate($plugin_version, &$errors=array()) 28 { 29 if (!$this->installed) 30 { 31 $this->install($plugin_version, $errors); 32 } 33 } 22 34 23 // function activate($plugin_version, &$errors=array()) 24 // { 25 // if (!$this->installed) 26 // { 27 // $this->install($plugin_version, $errors); 28 // } 29 // } 35 function deactivate() 36 { 37 } 30 38 31 // function deactivate() 32 // { 33 // } 34 35 // function uninstall() 36 // { 37 // conf_delete_param('AdminTools'); 38 // } 39 // } 39 function uninstall() 40 { 41 conf_delete_param('AdminTools'); 42 } 43 } -
extensions/AdminTools/template/public_controller.js
r25979 r26061 3 3 4 4 this.urlWS; 5 this.urlSelf; 5 6 this.multiView; 6 7 … … 101 102 102 103 // attach jquery handlers 103 this.init = function( urlSelf) {104 this.init = function(open) { 104 105 $('body').prepend($ato); // ensure the bar is at the begining 105 106 … … 109 110 if ('localStorage' in window) { 110 111 if (window.localStorage.ato_panel_open == null) { 111 window.localStorage.ato_panel_open = "true";112 } 113 114 if (window.localStorage.ato_panel_open == "true") {112 window.localStorage.ato_panel_open = open; 113 } 114 115 if (window.localStorage.ato_panel_open == 1) { 115 116 moveBody('show', false); 116 117 } … … 151 152 $ato.find('.switcher').on({ 152 153 'change': function() { 153 window.location.href = urlSelf + 'ato_'+ $(this).data('type') +'='+ $(this).val();154 window.location.href = __this.urlSelf + 'ato_'+ $(this).data('type') +'='+ $(this).val(); 154 155 }, 155 156 'click': function(e) { … … 164 165 moveBody('hide', true); 165 166 166 if ('localStorage' in window) window.localStorage.ato_panel_open = "false";167 if ('localStorage' in window) window.localStorage.ato_panel_open = 0; 167 168 e.preventDefault(); 168 169 }); … … 173 174 moveBody('show', true); 174 175 175 if ('localStorage' in window) window.localStorage.ato_panel_open = "true";176 if ('localStorage' in window) window.localStorage.ato_panel_open = 1; 176 177 e.preventDefault(); 177 178 }); -
extensions/AdminTools/template/public_controller.tpl
r25924 r26061 33 33 {footer_script require='admintools.controller'} 34 34 AdminTools.urlWS = '{$ROOT_URL}ws.php?format=json&method='; 35 AdminTools.urlSelf = '{$ato.U_SELF}'; 35 36 36 37 {if isset($ato.MULTIVIEW)} … … 45 46 AdminTools.deleteCache(); 46 47 {/if} 47 AdminTools.init( "{$ato.U_SELF}");48 AdminTools.init({intval($ato.DEFAULT_OPEN)}); 48 49 {if $themeconf.mobile} 49 50 AdminTools.initMobile(); … … 65 66 {/footer_script} 66 67 67 <div id="ato_header_closed" ><a href="#" class="icon-tools"></a></div>68 <div id="ato_header_closed"{if $ato.POSITION=='right'} class="right"{/if}><a href="#" class="icon-tools"></a></div> 68 69 69 70 <div id="ato_header"> 70 71 <ul> 71 <li ><a href="#" class="icon-ato-cancel close-panel"></a></li>72 <li{if $ato.POSITION=='right'} class="right"{/if}><a href="#" class="icon-ato-cancel close-panel"></a></li> 72 73 {if isset($ato.U_SITE_ADMIN)} 73 74 <li class="parent"><a href="#" class="icon-menu ato-min-1">{'Administration'|translate}</a> -
extensions/AdminTools/template/style.css
r25979 r26061 1 .icon-ato-null:before { content: 1 .icon-ato-null:before { content:' '; } 2 2 3 3 .token-input-dropdown { … … 54 54 float:right; 55 55 } 56 #ato_header>ul>li :not(:first-child){56 #ato_header>ul>li { 57 57 border-left:1px solid #666; 58 58 } 59 #ato_header>ul>li :not(:last-child){59 #ato_header>ul>li { 60 60 border-right:1px solid #222; 61 61 } … … 128 128 height:35px; 129 129 } 130 #ato_header_closed:not(.smartpocket).right { 131 left:auto; 132 right:10px; 133 } 130 134 #ato_header_closed:not(.smartpocket)>* { 131 135 padding:4px;
Note: See TracChangeset
for help on using the changeset viewer.