Changeset 647427
- Timestamp:
- 01/03/2013 01:08:17 PM (13 years ago)
- Location:
- display-template-name/trunk
- Files:
-
- 6 edited
-
display-template-name.php (modified) (8 diffs)
-
lang/display-template-name-en_EN.mo (modified) (previous)
-
lang/display-template-name-en_EN.po (modified) (2 diffs)
-
lang/display-template-name-fr_FR.mo (modified) (previous)
-
lang/display-template-name-fr_FR.po (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
display-template-name/trunk/display-template-name.php
r641847 r647427 3 3 Plugin Name: Display Template Name 4 4 Description: Displays the name of the template used by the currently displayed page. Plugins very useful for developing your blog. 5 Version: 1. 3.15 Version: 1.4 6 6 Author: Aurélien Chappard 7 7 Author URI: http://www.deefuse.fr/ … … 115 115 </div> 116 116 <div class="clearBoth"></div> 117 <p><em> 118 <?php _e("If the toolbar is displayed when you visit the site, the template name will be displayed in it and the above parameter will not be considered.", "display-template-name") ?> 119 </em></p> 117 120 <div class="submit"> 118 121 <input type="submit" class="button-primary" name="update_displayTemplateNamePluginSettings" value="<?php _e('Update Settings', 'display-template-name') ?>" /> … … 137 140 138 141 // Css position according to the showing admin bar 139 $top = ( is_admin_bar_showing() ? "29px" : "0px" ); 140 switch ($devOptions['position']) 142 if(!is_admin_bar_showing()) 141 143 { 142 143 case 'BL' : 144 $stringCss = 'bottom:0px; left:0px;'; 145 break; 146 case 'BR' : 147 $stringCss = 'bottom:0px; right:0px;'; 148 break; 149 case 'TR' : 150 $stringCss = 'top:' . $top . '; right:0px;'; 151 break; 152 case 'TL' : 153 default : 154 $stringCss = 'top:' . $top . '; left:0px;'; 155 break; 156 } 157 144 $top = "0px"; 145 switch ($devOptions['position']) 146 { 147 148 case 'BL' : 149 $stringCss = 'bottom:0px; left:0px;'; 150 break; 151 case 'BR' : 152 $stringCss = 'bottom:0px; right:0px;'; 153 break; 154 case 'TR' : 155 $stringCss = 'top:' . $top . '; right:0px;'; 156 break; 157 case 'TL' : 158 default : 159 $stringCss = 'top:' . $top . '; left:0px;'; 160 break; 161 } 158 162 ?> 159 163 <style type="text/css"> 160 #debug-display-template-name{font-size: 14px; position: fixed; <?php echo $stringCss;?> background: #000; color: #FFF; padding: 5px 7px; border: 1px solid #FFF;z-index: 99999}164 #debug-display-template-name{font-size: 14px;cursor: default; position: fixed; <?php echo $stringCss;?> background: #000; color: #FFF; padding: 5px 7px; border: 1px solid #FFF;z-index: 99999} 161 165 #debug-display-template-name a, #debug-display-template-name a:visited{ 162 166 color: #FFF; 163 167 cursor: default; 164 165 } 168 } 169 #debug-display-template-name p{margin-bottom:10px;} 170 #debug-display-template-name ul{ 171 list-style-type:disc; 172 padding-left:10px; 173 line-height:17px; 174 list-style-position:inside; 175 } 176 #debug-display-template-name ul li{ 177 margin-bottom:10px; 178 } 179 #debug-display-template-name ul li ul{ 180 list-style-type:square; 181 padding-left:15px; 182 } 183 #debug-display-template-name ul li ul li{margin-bottom:inherit;} 166 184 </style> 167 185 <?php 168 186 $templateInfos = $this->get_current_template(); 169 187 ?> 170 <div id="debug-display-template-name"><?php _e('Current template:','display-template-name'); ?> <a href="#" title="<?php echo $templateInfos; ?>" target="_blank"><?php echo basename($templateInfos); ?></a></div> 188 <div id="debug-display-template-name"> 189 <p><?php _e('Current template:','display-template-name'); ?></p> 190 <ul> 191 <li> 192 <a href="#" title="<?php echo $templateInfos; ?>" target="_blank"><?php echo basename($templateInfos); ?></a> 193 </li> 194 </ul> 195 </div> 171 196 <?php 197 } 172 198 } 173 199 } … … 182 208 // $GLOBALS['current_theme_template'] = basename($t); 183 209 $GLOBALS['current_theme_template'] = $t; 210 184 211 return $t; 185 212 } … … 198 225 } 199 226 227 228 229 function get_header_Action($args){ 230 print_r($args); 231 } 200 232 function dispayTplName_settings_link($links) 201 233 { … … 204 236 return $links; 205 237 } 206 238 239 function displayTplNameAdminBar() 240 { 241 if(!is_admin() && is_admin_bar_showing()){ 242 global $wp_admin_bar; 243 $templateInfos = $this->get_current_template(); 244 $wp_admin_bar->add_menu( array( 245 'parent' => false, // use 'false' for a root menu, or pass the ID of the parent menu 246 'id' => 'displayTemplateName', // link ID, defaults to a sanitized title value 247 'title' => __('Current template:','display-template-name') .' <b>'. basename($templateInfos) .'</b>', // link title 248 'meta' => array('title' => $templateInfos) // array of any of the following options: array( 'html' => '', 'class' => '', 'onclick' => '', target => '', title => '' ); 249 )); 250 } 251 252 } 207 253 } 208 254 } … … 223 269 add_action('admin_menu', 'DisplaYTemplateName_ap'); 224 270 add_action( 'admin_init', array(&$display_template_name_plugin, 'displayTplNameenqueue_my_styles') ); 271 add_action( 'wp_before_admin_bar_render', array(&$display_template_name_plugin, 'displayTplNameAdminBar') ); 225 272 // Filter 226 273 add_filter( 'template_include', array(&$display_template_name_plugin,'var_template_include'), 1000 ); … … 228 275 $plugin = plugin_basename(__FILE__); 229 276 add_filter("plugin_action_links_$plugin", array(&$display_template_name_plugin,'dispayTplName_settings_link') ); 277 278 230 279 } 231 280 -
display-template-name/trunk/lang/display-template-name-en_EN.po
r551725 r647427 3 3 "Project-Id-Version: display-template-name\n" 4 4 "Report-Msgid-Bugs-To: \n" 5 "POT-Creation-Date: 201 2-06-01 10:02+0100\n"6 "PO-Revision-Date: 201 2-06-01 10:02+0100\n"5 "POT-Creation-Date: 2013-01-03 14:05+0100\n" 6 "PO-Revision-Date: 2013-01-03 14:05+0100\n" 7 7 "Last-Translator: Chap <nanao@yopmail.com>\n" 8 8 "Language-Team: Aurelien Chappard <aucha@deefuse.fr>\n" … … 15 15 "X-Poedit-Country: FRANCE\n" 16 16 "X-Poedit-SourceCharset: utf-8\n" 17 "X-Poedit-SearchPath-0: /Users/aurelienchappard/Documents/Laboratoires/ CMS/wordpress-3.3.1/wp-content/plugins/display-template-name\n"17 "X-Poedit-SearchPath-0: /Users/aurelienchappard/Documents/Laboratoires/wordpress plugins/display-template-name/trunk\n" 18 18 19 #: /Users/aurelienchappard/Documents/Laboratoires/CMS/wordpress-3.3.1/wp-content/plugins/display-template-name/display-template-name.php:51 19 #: /Users/aurelienchappard/Documents/Laboratoires/wordpress 20 #: plugins/display-template-name/trunk/display-template-name.php:58 20 21 msgid "The position have been saved." 21 22 msgstr "The position have been saved." 22 23 23 #: /Users/aurelienchappard/Documents/Laboratoires/CMS/wordpress-3.3.1/wp-content/plugins/display-template-name/display-template-name.php:57 24 #: /Users/aurelienchappard/Documents/Laboratoires/wordpress 25 #: plugins/display-template-name/trunk/display-template-name.php:77 24 26 msgid "Select the position of the debug box." 25 27 msgstr "Select the position of the debug box in your website :" 26 28 27 #: /Users/aurelienchappard/Documents/Laboratoires/CMS/wordpress-3.3.1/wp-content/plugins/display-template-name/display-template-name.php:61 29 #: /Users/aurelienchappard/Documents/Laboratoires/wordpress 30 #: plugins/display-template-name/trunk/display-template-name.php:86 28 31 msgid "Top left" 29 32 msgstr "Top left" 30 33 31 #: /Users/aurelienchappard/Documents/Laboratoires/CMS/wordpress-3.3.1/wp-content/plugins/display-template-name/display-template-name.php:66 34 #: /Users/aurelienchappard/Documents/Laboratoires/wordpress 35 #: plugins/display-template-name/trunk/display-template-name.php:95 32 36 msgid "Top right" 33 37 msgstr "Top right" 34 38 35 #: /Users/aurelienchappard/Documents/Laboratoires/CMS/wordpress-3.3.1/wp-content/plugins/display-template-name/display-template-name.php:71 39 #: /Users/aurelienchappard/Documents/Laboratoires/wordpress 40 #: plugins/display-template-name/trunk/display-template-name.php:104 36 41 msgid "Bottom left" 37 42 msgstr "Bottom left" 38 43 39 #: /Users/aurelienchappard/Documents/Laboratoires/CMS/wordpress-3.3.1/wp-content/plugins/display-template-name/display-template-name.php:76 44 #: /Users/aurelienchappard/Documents/Laboratoires/wordpress 45 #: plugins/display-template-name/trunk/display-template-name.php:113 40 46 msgid "Bottom right" 41 47 msgstr "Bottom right" 42 48 43 #: /Users/aurelienchappard/Documents/Laboratoires/CMS/wordpress-3.3.1/wp-content/plugins/display-template-name/display-template-name.php:80 49 #: /Users/aurelienchappard/Documents/Laboratoires/wordpress 50 #: plugins/display-template-name/trunk/display-template-name.php:118 51 msgid "If the toolbar is displayed when you visit the site, the template name will be displayed in it and the above parameter will not be considered." 52 msgstr "If the toolbar is displayed when you visit the site, the template name will be displayed in it and the above parameter will not be considered." 53 54 #: /Users/aurelienchappard/Documents/Laboratoires/wordpress 55 #: plugins/display-template-name/trunk/display-template-name.php:121 44 56 msgid "Update Settings" 45 57 msgstr "Update Settings" 46 58 47 #: /Users/aurelienchappard/Documents/Laboratoires/CMS/wordpress-3.3.1/wp-content/plugins/display-template-name/display-template-name.php:124 59 #: /Users/aurelienchappard/Documents/Laboratoires/wordpress 60 #: plugins/display-template-name/trunk/display-template-name.php:189 61 #: plugins/display-template-name/trunk/display-template-name.php:247 48 62 msgid "Current template:" 49 63 msgstr "Current template:" 50 64 51 #: /Users/aurelienchappard/Documents/Laboratoires/CMS/wordpress-3.3.1/wp-content/plugins/display-template-name/display-template-name.php:159 65 #: /Users/aurelienchappard/Documents/Laboratoires/wordpress 66 #: plugins/display-template-name/trunk/display-template-name.php:234 52 67 msgid "Settings" 53 68 msgstr "Settings" -
display-template-name/trunk/lang/display-template-name-fr_FR.po
r551725 r647427 3 3 "Project-Id-Version: display-template-name\n" 4 4 "Report-Msgid-Bugs-To: \n" 5 "POT-Creation-Date: 201 2-06-01 10:01+0100\n"6 "PO-Revision-Date: 201 2-06-01 10:02+0100\n"5 "POT-Creation-Date: 2013-01-03 14:03+0100\n" 6 "PO-Revision-Date: 2013-01-03 14:04+0100\n" 7 7 "Last-Translator: Chap <nanao@yopmail.com>\n" 8 8 "Language-Team: Aurelien Chappard <aucha@deefuse.fr>\n" … … 15 15 "X-Poedit-Country: FRANCE\n" 16 16 "X-Poedit-SourceCharset: utf-8\n" 17 "X-Poedit-SearchPath-0: /Users/aurelienchappard/Documents/Laboratoires/ CMS/wordpress-3.3.1/wp-content/plugins/display-template-name\n"17 "X-Poedit-SearchPath-0: /Users/aurelienchappard/Documents/Laboratoires/wordpress plugins/display-template-name/trunk\n" 18 18 19 #: /Users/aurelienchappard/Documents/Laboratoires/CMS/wordpress-3.3.1/wp-content/plugins/display-template-name/display-template-name.php:51 19 #: /Users/aurelienchappard/Documents/Laboratoires/wordpress 20 #: plugins/display-template-name/trunk/display-template-name.php:58 20 21 msgid "The position have been saved." 21 22 msgstr "La position d'affichage a été enregistrée." 22 23 23 #: /Users/aurelienchappard/Documents/Laboratoires/CMS/wordpress-3.3.1/wp-content/plugins/display-template-name/display-template-name.php:57 24 #: /Users/aurelienchappard/Documents/Laboratoires/wordpress 25 #: plugins/display-template-name/trunk/display-template-name.php:77 24 26 msgid "Select the position of the debug box." 25 27 msgstr "Sélectionnez la position de la zone de debug sur les pages de votre site :" 26 28 27 #: /Users/aurelienchappard/Documents/Laboratoires/CMS/wordpress-3.3.1/wp-content/plugins/display-template-name/display-template-name.php:61 29 #: /Users/aurelienchappard/Documents/Laboratoires/wordpress 30 #: plugins/display-template-name/trunk/display-template-name.php:86 28 31 msgid "Top left" 29 32 msgstr "En haut à gauche" 30 33 31 #: /Users/aurelienchappard/Documents/Laboratoires/CMS/wordpress-3.3.1/wp-content/plugins/display-template-name/display-template-name.php:66 34 #: /Users/aurelienchappard/Documents/Laboratoires/wordpress 35 #: plugins/display-template-name/trunk/display-template-name.php:95 32 36 msgid "Top right" 33 37 msgstr "En haut à droite" 34 38 35 #: /Users/aurelienchappard/Documents/Laboratoires/CMS/wordpress-3.3.1/wp-content/plugins/display-template-name/display-template-name.php:71 39 #: /Users/aurelienchappard/Documents/Laboratoires/wordpress 40 #: plugins/display-template-name/trunk/display-template-name.php:104 36 41 msgid "Bottom left" 37 42 msgstr "En bas à gauche" 38 43 39 #: /Users/aurelienchappard/Documents/Laboratoires/CMS/wordpress-3.3.1/wp-content/plugins/display-template-name/display-template-name.php:76 44 #: /Users/aurelienchappard/Documents/Laboratoires/wordpress 45 #: plugins/display-template-name/trunk/display-template-name.php:113 40 46 msgid "Bottom right" 41 47 msgstr "En bas à droite" 42 48 43 #: /Users/aurelienchappard/Documents/Laboratoires/CMS/wordpress-3.3.1/wp-content/plugins/display-template-name/display-template-name.php:80 49 #: /Users/aurelienchappard/Documents/Laboratoires/wordpress 50 #: plugins/display-template-name/trunk/display-template-name.php:118 51 msgid "If the toolbar is displayed when you visit the site, the template name will be displayed in it and the above parameter will not be considered." 52 msgstr "Si la barre d'outils est affichée lorsque vous visitez le site, le nom du template sera affiché dans celle-ci et le paramètre ci-dessus ne sera pas pris en compte" 53 54 #: /Users/aurelienchappard/Documents/Laboratoires/wordpress 55 #: plugins/display-template-name/trunk/display-template-name.php:121 44 56 msgid "Update Settings" 45 57 msgstr "Mettre à jour" 46 58 47 #: /Users/aurelienchappard/Documents/Laboratoires/CMS/wordpress-3.3.1/wp-content/plugins/display-template-name/display-template-name.php:124 59 #: /Users/aurelienchappard/Documents/Laboratoires/wordpress 60 #: plugins/display-template-name/trunk/display-template-name.php:189 61 #: plugins/display-template-name/trunk/display-template-name.php:247 48 62 msgid "Current template:" 49 63 msgstr "Template en cours :" 50 64 51 #: /Users/aurelienchappard/Documents/Laboratoires/CMS/wordpress-3.3.1/wp-content/plugins/display-template-name/display-template-name.php:159 65 #: /Users/aurelienchappard/Documents/Laboratoires/wordpress 66 #: plugins/display-template-name/trunk/display-template-name.php:234 52 67 msgid "Settings" 53 68 msgstr "Configuration" -
display-template-name/trunk/readme.txt
r641847 r647427 3 3 Requires at least: 3.0.0 4 4 Tested up to: 3.5 5 Stable tag: 1. 3.15 Stable tag: 1.4 6 6 7 7 … … 24 24 25 25 == Changelog == 26 27 = 1.4 = 28 * Display the template name in the admin bar when it's used. 26 29 27 30 = 1.3.1 =
Note: See TracChangeset
for help on using the changeset viewer.