Changeset 862478
- Timestamp:
- 02/21/2014 05:29:32 PM (12 years ago)
- Location:
- wp-symposium-toolbar/trunk
- Files:
-
- 8 edited
-
css/wp-symposium-toolbar_admin.css (modified) (3 diffs)
-
js/wp-symposium-toolbar.js (modified) (2 diffs)
-
js/wp-symposium-toolbar_preview.js (modified) (19 diffs)
-
readme.txt (modified) (3 diffs)
-
wp-symposium-toolbar.php (modified) (6 diffs)
-
wp-symposium-toolbar_admin.php (modified) (4 diffs)
-
wp-symposium-toolbar_admin_functions.php (modified) (23 diffs)
-
wp-symposium-toolbar_functions.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-symposium-toolbar/trunk/css/wp-symposium-toolbar_admin.css
r852789 r862478 16 16 17 17 /** 18 * Default WP Icons18 * Default Toolbar Height 19 19 */ 20 20 21 21 @media screen and (min-width: 783px) { 22 #wpadminbar .ab-top-menu > li > a:before { 23 top: 1px; 24 } 25 /* #wpadminbar #wp-admin-bar-wp-logo > .ab-item .ab-icon:before, 26 #wpadminbar #wp-admin-bar-updates .ab-icon:before, 27 #wpadminbar #wp-admin-bar-my-sites > .ab-item:before, 28 #wpadminbar #wp-admin-bar-site-name > .ab-item:before { 29 top: 0px; 30 } 31 #wpadminbar #wp-admin-bar-comments .ab-icon:before { 32 top: 2px; 33 } /* */ 22 #wpadminbar .ab-top-secondary { 23 height: 32px; 24 } 34 25 } 35 26 … … 87 78 font-family: dashicons !important; 88 79 content: '\f319'; 89 } 90 /* 91 #wpadminbar .symposium-toolbar-social-icon > .ab-item:before { 92 top: 0px; 93 } /* */ 80 top: 2px; 81 } 94 82 95 83 #wpadminbar #wp-admin-bar-symposium-toolbar-share-linkedin > .ab-item:before { … … 392 380 } 393 381 382 /* Fix arrows height for User Menu submenus */ 383 @media screen and (max-width: 782px) { 384 #wpadminbar .ab-top-secondary .menupop .menupop > .ab-item:before { 385 top: 10px; 386 } 387 } 388 @media screen and (min-width: 783px) { 389 #wpadminbar .ab-top-secondary .menupop .menupop > .ab-item:before { 390 top: 1px !Important; 391 } 392 } 393 394 394 /** 395 395 * Site Name Menu -
wp-symposium-toolbar/trunk/js/wp-symposium-toolbar.js
r851541 r862478 57 57 // Get the current screen width 58 58 navWidth = $( '#wpst-nav-management' ).width(); 59 arrowWidth = $( '#wpst-nav-tabs-arrow-left' ).outerWidth(); // Recompute it in case of switch between responsive and normal 59 60 // Recompute it in case of switch between responsive and normal 61 arrowWidth = $( '#wpst-nav-tabs-arrow-left' ).outerWidth(); 60 62 61 63 // Compute the total width of all tabs and set the container width … … 187 189 } 188 190 189 // Such fields are part of the definition of a font shadow190 // if ( $(this).hasClass( "wpst_font_shadow" ) ) {191 192 // If this contains a default value, add default class to all three193 // if ( $(this).val() == "0" ) {194 // if ( ( $("#wpst_font_h_shadow").val() == "0" ) && ( $("#wpst_font_v_shadow").val() == "0" ) && ( $("#wpst_font_shadow_blur").val() == "0" ) )195 // $(".wpst_font_shadow").addClass( "wpst-has-default" );196 197 // If this contains a non-default value, remove default class from all three198 // } else {199 // $(".wpst_font_shadow").removeClass( "wpst-has-default" );200 // }201 202 191 // If this contains a default value, add default class 203 // } else { 204 if ( $(this).val() == document.getElementById( this.id+"_default" ).value ) { 205 $(this).addClass( "wpst-has-default" ); 206 } 207 // } 208 192 if ( $(this).val() == document.getElementById( this.id+"_default" ).value ) { 193 $(this).addClass( "wpst-has-default" ); 194 } 209 195 }); 210 196 }); -
wp-symposium-toolbar/trunk/js/wp-symposium-toolbar_preview.js
r852789 r862478 15 15 */ 16 16 17 // References:18 // http://make.wordpress.org/core/2012/11/30/new-color-picker-in-wp-3-5/19 // http://melchoyce.github.io/dashicons/20 // http://hofmannsven.com/2013/laboratory/wordpress-admin-ui/21 22 17 jQuery(document).ready(function($){ 23 18 … … 52 47 53 48 // KEEPERS 54 55 var wpstRgbColors = ( $("#wpadminbar").css("background-color").search("rgb") >= 0 );56 49 57 50 var wpstDefaultHeight = "32"; … … 93 86 94 87 var wpstFontSizeEmpty = "13px"; 95 var wpstIconSizeEmpty = "20";88 var wpstIconSizeEmpty = 20; 96 89 var wpstFontSizeSmallEmpty = "11px"; 97 90 var wpstFontNormal = "normal"; 98 91 var wpstFontNone = "none"; 92 93 var wpstRgbColors = ( $("#wpadminbar").css("background-color").search("rgb") >= 0 ); 99 94 100 95 // Determine gradient string from browser type … … 108 103 // Determine window width 109 104 document.body.style.overflow = "hidden"; 105 var wpadminbarHeight = $( "#wpadminbar" ).height(); 110 106 var wpadminbarWidth = $( "#wpadminbar" ).width(); 111 107 document.body.style.overflow = ""; … … 119 115 update_tb_height(); 120 116 update_tb_background(); 117 update_tb_icon_margin(); 121 118 } 122 119 }); … … 205 202 if ( wpadminbarWidth < 783 ) return; 206 203 207 // Toolbar Height204 // vars 208 205 var tbHeight = ( $('#wpst_height').val() != "" ) ? $('#wpst_height').val() : wpstDefaultHeight; 209 var tb PaddingTop = Math.round( ( tbHeight - wpstDefaultHeight )/2 );210 if ( tbPaddingTop < 0 ) tbPaddingTop = 0;211 var tbMarginTop = tbHeight - wpstDefaultHeight;212 206 var tbTop = Math.round( ( tbHeight - wpadminbarHeight )/2 ); 207 var tbBodyMarginTop = tbHeight - wpstDefaultHeight; 208 209 // Put it where it should go 213 210 $("#wpadminbar").css( "height", tbHeight + "px" ); 214 211 $("#wpadminbar").find(".quicklinks").css( "height", tbHeight + "px" ); 215 212 $("#wpadminbar").find(".ab-top-secondary").css( "height", tbHeight + "px" ); 216 // $("#wpadminbar").find(".quicklinks a").css( "height", tbHeight + "px" );217 // $("#wpadminbar").find(".quicklinks .ab-empty-item").css( "height", tbHeight + "px" );218 213 $("#wpadminbar").find(".quicklinks > ul > li").css( "height", tbHeight + "px" ); 219 214 $("#wpadminbar").find(".shortlink-input").css( "height", tbHeight + "px" ); … … 221 216 $("#wpadminbar").find(".ab-top-menu > .menupop > .ab-sub-wrapper").css( "top", tbHeight + "px" ); 222 217 $("#wpadminbar").find(".ab-top-menu > .menupop > .ab-sub-wrapper .ab-sub-wrapper").css( "top", wpstSubwrapperTop + "px" ); 223 $('body').css( "margin-top", tbMarginTop + "px" ); 224 $("#wpbody").css( "margin-top", tbMarginTop + "px" ); 225 226 $("#wpadminbar").find(".ab-top-menu > li > .ab-item").css( "line-height", tbHeight + "px" ); 227 $("#wpadminbar").find(".ab-top-menu > li > .ab-item").css( "padding-top", "0px" ); 228 $("#wpadminbar").find(".ab-top-menu > li > .ab-item span").css( "line-height", tbHeight + "px" ); 229 $("#wpadminbar").find(".ab-top-menu > li > .ab-item span").css( "padding-top", "0px" ); 230 // $("#wpadminbar").find(".ab-icon").css( "line-height", tbHeight + "px" ); 231 // $("#wpadminbar").find(".ab-icon").css( "padding-top", "0px" ); 232 218 $('body').css( "margin-top", tbBodyMarginTop + "px" ); 219 $("#wpbody").css( "margin-top", tbBodyMarginTop + "px" ); 220 233 221 $("#wpadminbar").find(".quicklinks > ul > li > a").css( "height", tbHeight + "px" ); 234 222 $("#wpadminbar").find(".quicklinks > ul > li > .ab-item").css( "height", tbHeight + "px" ); 235 223 $("#wpadminbar").find(".quicklinks > ul > li > a span").css( "height", tbHeight + "px" ); 236 224 $("#wpadminbar").find(".quicklinks > ul > li > .ab-item span").css( "height", tbHeight + "px" ); 237 $("#wpadminbar").find("#wp-admin-bar-wp-logo > .ab-item span").css( "height", tbHeight + "px" ); 225 $("#wpadminbar").find(".ab-top-menu > li > .ab-item").css( "line-height", tbHeight + "px" ); 226 $("#wpadminbar").find(".ab-top-menu > li > .ab-item span.ab-label").css( "line-height", tbHeight + "px" ); 238 227 239 228 // JetPack Notes … … 241 230 if ( notes ) { 242 231 var divs = document.getElementById("wp-admin-bar-notes").getElementsByTagName("div"); 243 for (var i in divs) { if ( typeof divs[i].style !== "undefined" ) divs[i].style.cssText = divs[i].style.cssText + "padding-top: " + tbPaddingTop + "px !important;"; } 244 } 245 246 // Fonticons 247 if ( document.getElementById("wpstLineHeight") ) 248 var style = document.getElementById("wpstLineHeight"); 232 for (var i in divs) { if ( typeof divs[i].style !== "undefined" ) divs[i].style.cssText = divs[i].style.cssText + "padding-top: " + tbTop + "px !important;"; } 233 } 234 235 if ( document.getElementById("wpstMarginTop") ) 236 var style = document.getElementById("wpstMarginTop"); 249 237 else { 250 238 var style = document.createElement('style'); 251 style.id = 'wpst LineHeight';252 } 253 254 style.innerHTML = '#wpadminbar #wp-toolbar > ul > li > .ab-item:before, #wpadminbar #wp-toolbar > ul > li > .ab-item span:before, #wpadminbar .ab-item:before { line-height: '+tbHeight+'px; padding-top: 0px; } ';255 style.innerHTML += '#wpadminbar #wp-admin-bar-wp-logo > .ab-item .ab-icon:before, #wpadminbar #wp-admin-bar-my-sites > .ab-item:before, #wpadminbar #wp-admin-bar-site-name > .ab-item:before, #wpadminbar #wp-admin-bar-updates .ab-icon:before { top: 0px; } ';239 style.id = 'wpstMarginTop'; 240 } 241 242 style.innerHTML += '#wpadminbar #wp-toolbar > ul > li > .ab-item, #wpadminbar #wp-toolbar > ul > li > .ab-item span, #wpadminbar #wp-toolbar > ul > li > .ab-item:before, #wpadminbar #wp-toolbar > ul > li > .ab-item span:before, #wpadminbar > #wp-toolbar > #wp-admin-bar-root-default .ab-icon, #wpadminbar .ab-icon { line-height: '+tbHeight+'px; } '; 243 style.innerHTML += '#wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar > a img { line-height: '+tbHeight+'px; } '; 256 244 257 245 document.head.appendChild(style); … … 302 290 $(this).find("> .ab-item").css( "background-color", tbMainColor ); 303 291 $(this).find("> .ab-item").css( "background-image", tbNormalImage ); 304 } ); // if ( !$(this).is("focus") ) {292 } ); 305 293 } 306 294 … … 362 350 } 363 351 352 function update_tb_icon_margin() { 353 354 // Non-responsive only 355 if ( wpadminbarWidth < 783 ) return; 356 357 // vars 358 var tbHeight = ( $('#wpst_height').val() != "" ) ? $('#wpst_height').val() : wpstDefaultHeight; 359 var tbIconSize = ( $('#wpst_icon_size').val() !== "" ) ? ( parseInt( $('#wpst_icon_size').val() ) ) : wpstIconSizeEmpty; 360 361 var sitesMarginTop = -4; 362 363 // WP Logo and Updates icons 364 if ( tbIconSize < wpstIconSizeEmpty ) { 365 var wMarginTop = Math.round( ( ( tbIconSize - wpstIconSizeEmpty ) /2 ) - 4 ); 366 } else { 367 var wMarginTop = -4; 368 } 369 370 // WP Symposium icons 371 if ( tbIconSize < wpstIconSizeEmpty - 2 ) { 372 var sMarginTop = Math.round( ( ( tbIconSize - wpstIconSizeEmpty ) /2 ) - 5 ); 373 } else { 374 var sMarginTop = -5; 375 } 376 377 // New Content icon 378 var newMarginTop = wMarginTop + 2; 379 380 // Put it where it should go 381 if ( document.getElementById("wpstIconMarginTop") ) 382 var style = document.getElementById("wpstIconMarginTop"); 383 else { 384 var style = document.createElement('style'); 385 style.id = 'wpstIconMarginTop'; 386 } 387 388 style.innerHTML += '#wpadminbar #wp-admin-bar-my-sites > .ab-item:before, #wpadminbar #wp-admin-bar-site-name > .ab-item:before, #wpadminbar #wp-admin-bar-my-wpms-admin > .ab-item:before { top: '+sitesMarginTop+'px; } '; 389 style.innerHTML += '#wpadminbar #wp-admin-bar-wp-logo > .ab-item .ab-icon:before, #wpadminbar #wp-admin-bar-updates .ab-icon:before { top: '+wMarginTop+'px; } '; 390 style.innerHTML += '#wpadminbar #wp-admin-bar-new-content .ab-icon:before, #wpadminbar #wp-admin-bar-comments .ab-icon:before { top: '+newMarginTop+'px; } '; 391 style.innerHTML += '#wpadminbar #wp-admin-bar-my-symposium-admin > .ab-item > span.ab-icon:before, #wpadminbar li.symposium-toolbar-notifications-mail > .ab-item > .ab-icon:before, #wpadminbar li.symposium-toolbar-notifications-friendship > .ab-item > .ab-icon:before { top: '+sMarginTop+'px; } '; 392 style.innerHTML += '#wpadminbar > #wp-toolbar > #wp-admin-bar-root-default > #wp-admin-bar-search #adminbarsearch input.adminbar-input { top: '+Math.round( ( tbHeight - wpstDefaultHeight ) /2 )+'px; } '; 393 394 document.head.appendChild(style); 395 } 396 364 397 function update_tb_icon_size() { 365 398 399 // Non-responsive only 400 if ( wpadminbarWidth < 783 ) return; 401 402 var tbHeight = ( $('#wpst_height').val() != "" ) ? $('#wpst_height').val() : wpstDefaultHeight; 366 403 var tbIconSize = ( $('#wpst_icon_size').val() !== "" ) ? ( parseInt( $('#wpst_icon_size').val() ) ) : wpstIconSizeEmpty; 367 if ( tbIconSize < wpstIconSizeEmpty - 1 ) {368 var wMarginTop = Math.round( ( tbIconSize / wpstIconSizeEmpty ) / 2 );369 var sMarginTop = Math.round( ( ( tbIconSize / wpstIconSizeEmpty ) / 2 ) - 1.5 );370 } else {371 var wMarginTop = 0;372 var sMarginTop = -1;373 }374 var newMarginTop = wMarginTop + 2;375 376 404 var tbHoverIconSize = ( $('#wpst_hover_icon_size').val() !== "" ) ? ( parseInt( $('#wpst_hover_icon_size').val() ) ) : tbIconSize; 377 405 if ( ( tbIconSize > 0 ) && ( tbHoverIconSize > 0 ) ) { 378 var tbScale = Math.round( ( tbHoverIconSize * 100 ) / tbIconSize ) / 100;406 var tbScale = Math.round( ( ( tbHoverIconSize * 100 ) / tbIconSize ) / 100 ); 379 407 var tbTransform = 'transform:scale('+tbScale+'); -ms-transform:scale('+tbScale+'); -webkit-transform:scale('+tbScale+'); transition: all 0.25s; '; 380 408 } else 381 409 var tbTransform = 'transform:scale(1); -ms-transform:scale(1); -webkit-transform:scale(1); transition: all 0.25s; '; 382 410 411 // Put it where it should go 383 412 if ( document.getElementById("wpstIconSize") ) 384 413 var style = document.getElementById("wpstIconSize"); … … 388 417 } 389 418 390 style.innerHTML = '#wpadminbar .ab-item span:before, #wpadminbar .ab-top-menu > li.menupop > .ab-item:before, #wpadminbar li #adminbarsearch:before, #wpadminbar #wp-admin-bar-my-symposium-admin > .ab-item > span.ab-icon:before, #wpadminbar li.symposium-toolbar-notifications-mail > .ab-item > .ab-icon:before, #wpadminbar li.symposium-toolbar-notifications-friendship > .ab-item > .ab-icon:before, #wpadminbar #wp-toolbar > ul > li > .ab-item span.ab-icon, #wpadminbar #wp-toolbar > ul > li > .ab-item:before { font-size: '+tbIconSize+'px !Important; } ';419 style.innerHTML = '#wpadminbar .ab-item span:before, #wpadminbar .ab-top-menu > li.menupop > .ab-item:before, #wpadminbar li #adminbarsearch:before, #wpadminbar #wp-admin-bar-my-symposium-admin > .ab-item > span.ab-icon:before, #wpadminbar li.symposium-toolbar-notifications-mail > .ab-item > .ab-icon:before, #wpadminbar li.symposium-toolbar-notifications-friendship > .ab-item > .ab-icon:before, #wpadminbar #wp-toolbar > ul > li > .ab-item span.ab-icon, #wpadminbar #wp-toolbar > ul > li > .ab-item:before, #wpadminbar #wp-toolbar > ul > li > .ab-item span:before { font-size: '+tbIconSize+'px !Important; } '; 391 420 392 421 style.innerHTML += '#wp-admin-bar-wp-logo > a { width: '+tbIconSize+'px; } '; 393 style.innerHTML += '#wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar > a img { width: '+ (tbIconSize - 4) +'px; height: '+ (tbIconSize - 4) +'px; } '; 394 style.innerHTML += '#wpadminbar #wp-admin-bar-wp-logo > .ab-item .ab-icon:before, #wpadminbar #wp-admin-bar-updates .ab-icon:before { top: '+wMarginTop+'px; } '; 395 style.innerHTML += '#wpadminbar #wp-admin-bar-new-content .ab-icon:before, #wpadminbar #wp-admin-bar-comments .ab-icon:before { top: '+newMarginTop+'px; } '; 396 style.innerHTML += '#wpadminbar #wp-admin-bar-my-symposium-admin > .ab-item > span.ab-icon:before, #wpadminbar li.symposium-toolbar-notifications-mail > .ab-item > .ab-icon:before, #wpadminbar li.symposium-toolbar-notifications-friendship > .ab-item > .ab-icon:before { top: '+sMarginTop+'px; } '; 422 style.innerHTML += '#wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar > a img { width: '+ (tbIconSize - 4) +'px; height: '+ (tbIconSize - 4) +'px; margin-top: -3px; } '; 423 style.innerHTML += '#wpadminbar > #wp-toolbar > #wp-admin-bar-root-default > #wp-admin-bar-search #adminbarsearch input.adminbar-input { height: '+tbIconSize+'px; padding-left: '+tbIconSize+'px; } '; 397 424 398 425 style.innerHTML += '#wpadminbar li:hover .ab-item span:before, #wpadminbar li.hover .ab-item span:before, #wpadminbar li.menupop:hover .ab-item span:before, #wpadminbar li.menupop.hover .ab-item span:before, #wpadminbar .ab-top-menu > li:hover > .ab-item:before, #wpadminbar .ab-top-menu > li.hover > .ab-item:before, #wpadminbar .ab-top-menu > li.menupop:hover > .ab-item:before, #wpadminbar .ab-top-menu > li.menupop.hover > .ab-item:before, #wpadminbar li:hover #adminbarsearch:before, #wpadminbar #wp-admin-bar-wp-logo:hover > .ab-item .ab-icon, #wpadminbar #wp-admin-bar-wp-logo.hover > .ab-item .ab-icon, #wpadminbar #wp-admin-bar-wp-logo.menupop:hover > .ab-item .ab-icon, #wpadminbar #wp-admin-bar-wp-logo.menupop.hover > .ab-item .ab-icon, #wpadminbar li:hover > .ab-item > .ab-icon, #wpadminbar li.hover > .ab-item > .ab-icon, #wpadminbar li.menupop:hover > .ab-item > .ab-icon, #wpadminbar li.menupop.hover > .ab-item > .ab-icon, #wpadminbar li:hover > .ab-item > .ab-icon:before, #wpadminbar li.hover > .ab-item > .ab-icon:before, #wpadminbar li.menupop:hover > .ab-item > .ab-icon:before, #wpadminbar li.menupop.hover > .ab-item > .ab-icon:before, #wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar:hover > a img { '+tbTransform+' } '; … … 402 429 403 430 function update_tb_font_size() { 431 432 // Non-responsive only 433 if ( wpadminbarWidth < 783 ) return; 404 434 405 435 var tbFontSize = ( $('#wpst_font_size').val() !== "" ) ? $('#wpst_font_size').val() : wpstFontSizeEmpty; … … 544 574 545 575 document.getElementsByTagName('head')[0].appendChild(style); 546 // document.write(x.getElementsByTagName("wpstFontShadowColour")[0].nodeName);547 576 } 548 577 … … 661 690 $(this).find(".blavatar").css( "color", menuMainColorExt ); 662 691 }}); 663 // if ( !$(this).is("focus") ) {664 692 665 693 // Arrows … … 673 701 style.innerHTML = '#wpadminbar .menupop .menupop > .ab-item:before { color: '+menuMainColor+'; } #wpadminbar .menupop .menupop > .ab-item { color: '+menuMainColor+'; } '; 674 702 style.innerHTML += '#wpadminbar .menupop .ab-sub-secondary .menupop > .ab-item:before { color: '+menuMainColorExt+'; } #wpadminbar .menupop .ab-sub-secondary .menupop > .ab-item { color: '+menuMainColorExt+'; } '; 675 // style.innerHTML += '#wpadminbar .menupop .menupop > .ab-item:before { color: '+menuMainColorExt+'; } ';676 703 style.innerHTML += '#wpadminbar .quicklinks .ab-sub-secondary > li > a > .blavatar { color: '+menuMainColorExt+'; } #wpadminbar .quicklinks .ab-sub-secondary > li > a > .blavatar:before { color: '+menuMainColorExt+'; } '; 677 704 … … 679 706 style.innerHTML += '#wpadminbar .quicklinks .ab-sub-secondary > li.hover > a > .blavatar { color: '+menuHoverColorExt+'; } #wpadminbar .quicklinks .ab-sub-secondary > li.hover > a > .blavatar:before { color: '+menuHoverColorExt+'; } #wpadminbar .quicklinks li a:hover .blavatar:before { color: '+menuHoverColorExt+'; } '; 680 707 style.innerHTML += '#wpadminbar .menupop .ab-sub-secondary > .menupop > .ab-item:hover:before, #wpadminbar .menupop .ab-sub-secondary > li.menupop:hover > .ab-item:before, #wpadminbar .menupop .ab-sub-secondary > li.menupop.hover > .ab-item:before { color: '+menuHoverColorExt+'; } '; 681 // style.innerHTML += '#wpadminbar .menupop .ab-sub-secondary .menupop > .ab-item:hover:before { color: '+menuHoverColorExt+'; } #wpadminbar .menupop .ab-sub-secondary > .menupop.hover > .ab-item:before { color: '+menuHoverColorExt+'; } ';682 708 683 709 document.head.appendChild(style); … … 757 783 $("#wpadminbar").css(shadow, tbShadow); 758 784 $("#wpadminbar").find(".ab-top-menu > .menupop > .ab-sub-wrapper").css(shadow, tbShadow); 759 // $("#wpadminbar .menupop .ab-sub-wrapper").css(shadow, tbShadow);760 785 } 761 786 … … 765 790 // Toolbar Height 766 791 $('#wpst_height').change(function() { 792 793 // Non-responsive only 794 if ( wpadminbarWidth < 783 ) return; 795 767 796 update_tb_height(); 768 797 update_tb_background(); 798 update_tb_icon_margin(); 769 799 }); 770 800 … … 858 888 $('.wpst_icon_size').change(function() { 859 889 860 update_tb_icon_size() 890 update_tb_height(); 891 update_tb_font_size(); 892 update_tb_icon_margin(); 893 update_tb_icon_size(); 861 894 }); 862 895 -
wp-symposium-toolbar/trunk/readme.txt
r853887 r862478 9 9 Tested up to: 3.8.1 10 10 Stable tag: 0.26.0 11 Version: 0.26. 3211 Version: 0.26.42 12 12 License: GPLv2 or later 13 13 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 124 124 125 125 * French translation by the author 126 * Spanish translation by Maria Ramos , [WebHostingHub](http://www.webhostinghub.com/)126 * Spanish translation by Maria Ramos at WebHostingHub 127 127 128 128 = Icons = … … 151 151 * Bugfix: in RTL, correct display for the User Menu 152 152 * Bugfix: Styles, preview doesn't like 3-digits colors that can actually be used by colorpickers 153 * Change: Add the option to show social icons and share the site with: LinkedIn, Facebook, Twitter, Google Plus, Stumble Upon153 * Change: WP 3.8, add the option to show social icons and share the site with: LinkedIn, Facebook, Twitter, Google Plus, Stumble Upon 154 154 * Bugfix: add the plugin build number to CSS and JS files, to ensure that the correct version of the files is always sent to the client regardless of caching 155 155 * Change: Styles, implement default values shown & hidden via Javascript 156 156 * Bugfix: Styles, preview mode, correct menu font colors in hover 157 157 * Bugfix: Styles, correct menu font colors for display and user names 158 * Bugfix: WP Symposium, admin menu wasn't always up to date 158 * Bugfix: WP 3.8, Styles, improve vertical centering of icons on Toolbar, as well as Search field 159 * Bugfix: security, strip tags from Import feature 159 160 160 161 = 0.26.0. = -
wp-symposium-toolbar/trunk/wp-symposium-toolbar.php
r853887 r862478 11 11 Tested up to: 3.8 12 12 Stable tag: 0.26.0 13 Version: 0.26. 3213 Version: 0.26.42 14 14 License: GPLv2 or later 15 15 License URI: http://www.gnu.org/licenses/gpl-2.0.html 16 16 */ 17 17 18 // References: 19 // http://make.wordpress.org/core/2012/11/30/new-color-picker-in-wp-3-5/ 20 // http://melchoyce.github.io/dashicons/ 21 // http://hofmannsven.com/2013/laboratory/wordpress-admin-ui/ 22 18 23 // Increase Build nr at each version 19 24 global $wpst_buildnr; 20 $wpst_buildnr = 26 32;25 $wpst_buildnr = 2642; 21 26 22 27 … … 213 218 214 219 // Nr of tabs that can be hidden incl. WPS 215 if ( count( get_option( 'wpst_wpms_hidden_tabs', array() ) ) == 8 ) 220 $wpst_wpms_hidden_tabs = get_option( 'wpst_wpms_hidden_tabs', array() ); 221 if ( !in_array( 'wps', $wpst_wpms_hidden_tabs ) ) $wpst_wpms_hidden_tabs[] = 'wps'; 222 if ( !in_array( 'share', $wpst_wpms_hidden_tabs ) ) $wpst_wpms_hidden_tabs[] = 'share'; 223 if ( count( $wpst_wpms_hidden_tabs ) == 9 ) 216 224 return; 217 225 … … 238 246 $wpst_wpms_hidden_tabs = get_option( 'wpst_wpms_hidden_tabs', array() ); 239 247 if ( !in_array( 'wps', $wpst_wpms_hidden_tabs ) ) $wpst_wpms_hidden_tabs[] = 'wps'; 240 if ( count( $wpst_wpms_hidden_tabs ) == 8 ) 248 if ( !in_array( 'share', $wpst_wpms_hidden_tabs ) ) $wpst_wpms_hidden_tabs[] = 'share'; 249 if ( count( $wpst_wpms_hidden_tabs ) == 9 ) 241 250 return; 242 251 … … 257 266 function symposium_toolbar_new_site_default( $blog_id, $user_id, $domain, $path, $site_id, $meta ) { 258 267 268 // Hidden tabs 269 $wpst_wpms_hidden_tabs_all = get_option( 'wpst_wpms_hidden_tabs_all', array() ); 259 270 $hidden_tabs = get_option( 'wpst_wpms_hidden_tabs_default', array() ); 271 $wpst_wpms_hidden_tabs_all[ $blog_id ] = $hidden_tabs; 272 update_option( 'wpst_wpms_hidden_tabs_all', $wpst_wpms_hidden_tabs_all ); 273 274 // Get other data from Main Site settings 260 275 $wpst_style_tb_current = get_option( 'wpst_style_tb_current', array() ); 276 $wpst_wpms_network_superadmin_menu = get_option( 'wpst_wpms_network_superadmin_menu', "" ); 261 277 262 278 switch_to_blog( $blog_id ); 263 279 264 // Set globals 280 // Set globals locally 265 281 symposium_toolbar_init_globals(); 266 282 … … 268 284 symposium_toolbar_activate(); 269 285 270 // Update new site options with Main Site options286 // Update new site settings with Main Site settings 271 287 symposium_toolbar_update(); 272 288 if ( $hidden_tabs ) foreach( $hidden_tabs as $tab ) { … … 274 290 } 275 291 update_option( 'wpst_wpms_hidden_tabs', $hidden_tabs ); 292 update_option( 'wpst_wpms_network_superadmin_menu', $wpst_wpms_network_superadmin_menu ); 276 293 277 294 // Update CSS based on stored styles and installed plugins -
wp-symposium-toolbar/trunk/wp-symposium-toolbar_admin.php
r853887 r862478 518 518 echo '<td>'; 519 519 echo '<span>' . __( 'The list of all sites of the network, the admin is member of', 'wp-symposium-toolbar' ) . '</span>'; 520 // echo '<br /><span class="description"> ' . __( 'Note: This item will show only when the user is administrator of at least one site of the network, or is a super admin', 'wp-symposium-toolbar' ) . '</span>';521 520 echo symposium_toolbar_add_roles_to_item( 'display_my_sites', get_option( 'wpst_toolbar_my_sites', $wpst_roles_administrator ), $wpst_roles_administrator ); 522 521 echo '</td>'; … … 1092 1091 1093 1092 echo '<input type="checkbox" name="share_linkedin" id="share_linkedin" class="wpst-admin"'; 1094 if ( isset( $share['linkedin'] ) ) if ( $share['linkedin'] == "on" ) 1095 echo " CHECKED"; 1096 elseif ( $share['linkedin'] != "" ) { 1097 $error = true; 1098 echo ' style="outline:1px solid #CC0000;" onclick="this.style.outline = \'none\';"'; 1093 if ( isset( $share['linkedin'] ) ) { 1094 if ( $share['linkedin'] == "on" ) 1095 echo " CHECKED"; 1096 elseif ( $share['linkedin'] != "" ) { 1097 $error = true; 1098 echo ' style="outline:1px solid #CC0000;" onclick="this.style.outline = \'none\';"'; 1099 } 1099 1100 } 1100 1101 echo '/><span class="description wpst-checkbox"> ' . __( 'LinkedIn', 'wp-symposium-toolbar' ) . '</span><br />'; 1101 1102 1102 1103 echo '<input type="checkbox" name="share_facebook" id="share_facebook" class="wpst-admin"'; 1103 if ( isset( $share['facebook'] ) ) if ( $share['facebook'] == "on" ) 1104 echo " CHECKED"; 1105 elseif ( $share['facebook'] != "" ) { 1106 $error = true; 1107 echo ' style="outline:1px solid #CC0000;" onclick="this.style.outline = \'none\';"'; 1104 if ( isset( $share['facebook'] ) ) { 1105 if ( $share['facebook'] == "on" ) 1106 echo " CHECKED"; 1107 elseif ( $share['facebook'] != "" ) { 1108 $error = true; 1109 echo ' style="outline:1px solid #CC0000;" onclick="this.style.outline = \'none\';"'; 1110 } 1108 1111 } 1109 1112 echo '/><span class="description wpst-checkbox"> ' . __( 'Facebook', 'wp-symposium-toolbar' ) . '</span><br />'; 1110 1113 1111 1114 echo '<input type="checkbox" name="share_twitter" id="share_twitter" class="wpst-admin"'; 1112 if ( isset( $share['twitter'] ) ) if ( $share['twitter'] == "on" ) 1113 echo " CHECKED"; 1114 elseif ( $share['twitter'] != "" ) { 1115 $error = true; 1116 echo ' style="outline:1px solid #CC0000;" onclick="this.style.outline = \'none\';"'; 1115 if ( isset( $share['twitter'] ) ) { 1116 if ( $share['twitter'] == "on" ) 1117 echo " CHECKED"; 1118 elseif ( $share['twitter'] != "" ) { 1119 $error = true; 1120 echo ' style="outline:1px solid #CC0000;" onclick="this.style.outline = \'none\';"'; 1121 } 1117 1122 } 1118 1123 echo '/><span class="description wpst-checkbox"> ' . __( 'Twitter', 'wp-symposium-toolbar' ) . '</span><br />'; 1119 1124 1120 1125 echo '<input type="checkbox" name="share_google_plus" id="share_google_plus" class="wpst-admin"'; 1121 if ( isset( $share['google_plus'] ) ) if ( $share['google_plus'] == "on" ) 1122 echo " CHECKED"; 1123 elseif ( $share['google_plus'] != "" ) { 1124 $error = true; 1125 echo ' style="outline:1px solid #CC0000;" onclick="this.style.outline = \'none\';"'; 1126 if ( isset( $share['google_plus'] ) ) { 1127 if ( $share['google_plus'] == "on" ) 1128 echo " CHECKED"; 1129 elseif ( $share['google_plus'] != "" ) { 1130 $error = true; 1131 echo ' style="outline:1px solid #CC0000;" onclick="this.style.outline = \'none\';"'; 1132 } 1126 1133 } 1127 1134 echo '/><span class="description wpst-checkbox"> ' . __( 'Google Plus', 'wp-symposium-toolbar' ) . '</span><br />'; 1128 1135 1129 1136 echo '<input type="checkbox" name="share_stumbleupon" id="share_stumbleupon" class="wpst-admin"'; 1130 if ( isset( $share['stumbleupon'] ) ) if ( $share['stumbleupon'] == "on" ) 1131 echo " CHECKED"; 1132 elseif ( $share['stumbleupon'] != "" ) { 1133 $error = true; 1134 echo ' style="outline:1px solid #CC0000;" onclick="this.style.outline = \'none\';"'; 1137 if ( isset( $share['stumbleupon'] ) ) { 1138 if ( $share['stumbleupon'] == "on" ) 1139 echo " CHECKED"; 1140 elseif ( $share['stumbleupon'] != "" ) { 1141 $error = true; 1142 echo ' style="outline:1px solid #CC0000;" onclick="this.style.outline = \'none\';"'; 1143 } 1135 1144 } 1136 1145 echo '/><span class="description wpst-checkbox"> ' . __( 'StumbleUpon', 'wp-symposium-toolbar' ) . '</span><br />'; … … 1235 1244 function symposium_toolbar_admintab_styles() { 1236 1245 1237 global $wp_version , $wpst_default_toolbar;1246 global $wp_version; 1238 1247 1239 1248 // Get data to show … … 1242 1251 $wpst_all_borders = array( "none", "dotted", "dashed", "solid", "double" ); 1243 1252 1253 // Init default Toolbar style 1254 $wpst_default_toolbar = symposium_toolbar_init_default_toolbar(); 1255 1244 1256 // Get current style 1245 1257 $wpst_style_tb_current = maybe_unserialize( get_option( 'wpst_style_tb_current', array() ) ); 1246 1247 // Make sure globals are actually initialized1248 if ( !isset( $wpst_default_toolbar['height'] ) ) symposium_toolbar_init_default_toolbar();1249 1258 1250 1259 $wpst_top_colour = ( isset( $wpst_style_tb_current['top_colour'] ) ) ? $wpst_style_tb_current['top_colour'] : ''; -
wp-symposium-toolbar/trunk/wp-symposium-toolbar_admin_functions.php
r853887 r862478 78 78 * 79 79 * @param none 80 * @return none80 * @return (array)$wpst_default_toolbar 81 81 */ 82 82 function symposium_toolbar_init_default_toolbar() { 83 83 84 global $wp_version , $wpst_default_toolbar;84 global $wp_version; 85 85 86 86 // Build the array of default values for the Toolbar, based on WP Version … … 174 174 $wpst_default_toolbar['shadow_spread'] = "0"; 175 175 } 176 177 return $wpst_default_toolbar; 176 178 } 177 179 … … 307 309 } 308 310 309 if ( get_option( 'wpst_tech_buildnr', 0 ) < 26 28) {311 if ( get_option( 'wpst_tech_buildnr', 0 ) < 2642 ) { 310 312 311 313 // Update CSS based on stored styles and installed plugins 312 314 $wpst_style_tb_current = get_option( 'wpst_style_tb_current', array() ); 313 315 update_option( 'wpst_tech_style_to_header', symposium_toolbar_update_styles( $wpst_style_tb_current ) ); 314 }315 316 if ( get_option( 'wpst_tech_buildnr', 0 ) < 2632 ) {317 318 delete_option( 'wpst_tech_wps_admin_menu' );319 316 } 320 317 … … 412 409 $unserialized_custom_menus = maybe_unserialize( $wpst_main_site_select[0]["option_value"] ); 413 410 if ( is_array( $unserialized_custom_menus ) ) foreach ( $unserialized_custom_menus as $menu ) { 414 if ( !$menu[4] ) $non_network_custom_menus[] = $menu;411 if ( isset( $custom_menu[4] ) && $custom_menu[4] ) $non_network_custom_menus[] = $menu; 415 412 } 416 413 $wpst_main_site_options[ "wpst_custom_menus" ] = serialize( $non_network_custom_menus ); … … 459 456 global $wpdb, $current_screen, $wp_version; 460 457 global $is_wpst_network_admin, $is_wps_active, $wpst_locations, $wpst_failed, $wpst_notices, $wpst_shown_tabs, $wpst_subsites_tabs, $wpst_roles_all; 461 global $wpst_default_toolbar;462 458 463 459 // Make sure we're at the plugin options page, and only this one - this should simply confirm what this function is hooked to … … 466 462 467 463 // Init default Toolbar style 468 if ( !isset( $wpst_default_toolbar['height'] ) )symposium_toolbar_init_default_toolbar();464 $wpst_default_toolbar = symposium_toolbar_init_default_toolbar(); 469 465 470 466 // Check for activated/deactivated WPS features, the $_POST['__wps__installation_update'] means WPS is activated … … 704 700 $_POST['display_custom_menu_slug'][$key], 705 701 $_POST['display_custom_menu_location'][$key], 706 ( $_POST['display_custom_menu_'.$key.'_roles']) ? $_POST['display_custom_menu_'.$key.'_roles'] : array(),702 ( isset( $_POST['display_custom_menu_'.$key.'_roles'] ) ) ? $_POST['display_custom_menu_'.$key.'_roles'] : array(), 707 703 filter_var( trim ( $_POST['display_custom_menu_icon'][$key] ), FILTER_SANITIZE_URL ), 708 704 ( is_multisite() && is_main_site() ) ? ( isset( $_POST['display_custom_menu_network_'.$key] ) ) : false … … 748 744 $share['twitter'] = isset( $_POST["share_twitter"] ) ? 'on' : ''; 749 745 $share['google_plus'] = isset( $_POST["share_google_plus"] ) ? 'on' : ''; 750 $share['pinterest'] = isset( $_POST["share_pinterest"] ) ? 'on' : '';746 // $share['pinterest'] = isset( $_POST["share_pinterest"] ) ? 'on' : ''; 751 747 $share['stumbleupon'] = isset( $_POST["share_stumbleupon"] ) ? 'on' : ''; 752 748 update_option( 'wpst_share_icons', $share ); … … 1191 1187 // See if the admin has imported settings using the textarea, to update them one by one 1192 1188 if ( isset( $_POST["Submit"] ) && $_POST["Submit"] == __( 'Import', 'wp-symposium-toolbar' ) && isset( $_POST["toolbar_import_export"] ) && trim( $_POST["toolbar_import_export"] != '' ) ) { 1193 $all_options = explode( "\n", trim( $_POST["toolbar_import_export"] ) ); 1189 $toolbar_import_export = strip_tags( $_POST["toolbar_import_export"] ); 1190 $all_options = explode( "\n", trim( $toolbar_import_export ) ); 1194 1191 } 1195 1192 … … 1428 1425 if ( $option_name == 'wpst_style_tb_current' ) { 1429 1426 if ( is_array( $option_value ) ) { 1430 (bool)$ update_me = true;1427 (bool)$stop_updating_me = false; 1431 1428 foreach( $option_value as $key => $value ) { 1432 if ( !isset( $value ) || !is_string( $value) || empty( $value) ) {1433 $ update_me = false;1429 if ( !isset( $value ) || ( is_string( $value) && ( $value == "" ) ) ) { 1430 $stop_updating_me = $key; 1434 1431 break; 1435 1432 } 1436 1433 } 1437 if ( $update_me ) {1434 if ( !$stop_updating_me ) { 1438 1435 $wpst_style_tb_current = array_diff_assoc( $option_value, $wpst_default_toolbar ); 1439 1436 update_option( 'wpst_style_tb_current', $wpst_style_tb_current ); 1440 // $wpst_style_tb_current = maybe_unserialize( $option_value );1441 // update_option( 'wpst_tech_style_to_header', symposium_toolbar_update_styles( $wpst_style_tb_current ) );1442 1437 } else 1443 $wpst_failed .= $option_name.__( ': an array of non-empty values was expected, at least one value was not set correctly', 'wp-symposium-toolbar' ).' <br />';1438 $wpst_failed .= $option_name.__( ': an array of non-empty values was expected, at least one value was not set correctly', 'wp-symposium-toolbar' ).' ('.$key.')<br />'; 1444 1439 } else 1445 1440 $wpst_failed .= $option_name.__( ': incorrect format, an array was expected', 'wp-symposium-toolbar' ).'<br />'; … … 1479 1474 // Post update cleaning tasks 1480 1475 1481 // Update Styles according to above settings1482 if ( isset( $wpst_style_tb_current ) ) update_option( 'wpst_tech_style_to_header', symposium_toolbar_update_styles( $wpst_style_tb_current ) );1483 1484 1476 // Re-generate WPS Admin Menu upon saving from WPST Options page 1485 1477 if ( $is_wps_active ) symposium_toolbar_update_wps_admin_menu(); 1478 1479 // If needed, regenerate styles 1480 if ( isset( $wpst_style_tb_current ) ) update_option( 'wpst_tech_style_to_header', symposium_toolbar_update_styles( $wpst_style_tb_current ) ); 1486 1481 1487 1482 // Network Toolbar: Super Admin, Multisite, Main Site and network activated … … 1592 1587 function symposium_toolbar_update_styles( $wpst_style_tb_current, $blog_id = "1" ) { 1593 1588 1594 global $wp_version , $wpst_default_toolbar;1589 global $wp_version; 1595 1590 1596 1591 $style_saved = ""; … … 1601 1596 1602 1597 // Init default Toolbar style 1603 symposium_toolbar_init_default_toolbar();1598 $wpst_default_toolbar = symposium_toolbar_init_default_toolbar(); 1604 1599 1605 1600 // Toolbar Height 1606 1601 $height = ( isset( $wpst_style_tb_current['height'] ) ) ? $wpst_style_tb_current['height'] : $wpst_default_toolbar['height'] ; 1607 1602 if ( $height == 0 ) $height = $wpst_default_toolbar['height']; 1608 $padding_top = 0; 1603 $padding_top = 0; // Needed by JetPack, below 1609 1604 1610 1605 if ( $height != $wpst_default_toolbar['height'] ) { … … 1624 1619 } else { 1625 1620 $margin_top = $height - $wpst_default_toolbar['height']; 1626 $padding_top = round( $margin_top /2 ); // Needed by JetPack, below1621 $padding_top = round( $margin_top /2 ); 1627 1622 1628 1623 $style_chunk = 'height: '.$height.'px; '; … … 1634 1629 1635 1630 $style_saved .= '#wpadminbar #wp-toolbar > ul > li > .ab-item, #wpadminbar #wp-toolbar > ul > li > .ab-item span, '; 1636 $style_saved .= '#wpadminbar #wp-toolbar > ul > li > .ab-item:before, #wpadminbar #wp-toolbar > ul > li > .ab-item span:before, #wpadminbar > #wp-toolbar > #wp-admin-bar-root-default .ab-icon, #wpadminbar .ab-icon, #wpadminbar .ab-item:before { line-height: '.$height.'px; padding-bottom: 0px; padding-top: 0px;} ';1631 $style_saved .= '#wpadminbar #wp-toolbar > ul > li > .ab-item:before, #wpadminbar #wp-toolbar > ul > li > .ab-item span:before, #wpadminbar > #wp-toolbar > #wp-admin-bar-root-default .ab-icon, #wpadminbar .ab-icon, #wpadminbar .ab-item:before { line-height: '.$height.'px; } '; 1637 1632 $style_saved .= '#wpadminbar .quicklinks > ul > li > a, #wpadminbar .quicklinks > ul > li > .ab-item, #wpadminbar .quicklinks > ul > li > a span, #wpadminbar .quicklinks > ul > li > .ab-item span, #wpadminbar #wp-admin-bar-wp-logo > .ab-item span { height: '.$height.'px; } '; 1638 $style_saved .= '#wpadminbar .menupop .menupop > .ab-item:before { top: 5px } ';1639 1633 $style_saved .= '} '; 1640 1634 } 1641 1635 1642 } else 1643 // WP 3.8+ 1644 if ( version_compare( $wp_version, '3.8-alpha', '>' ) ) { 1645 $style_saved .= '@media screen and ( min-width: 783px ) { '; 1646 $style_saved .= '#wpadminbar .ab-top-secondary .menupop .menupop > .ab-item:before { top: 1px } '; 1647 $style_saved .= '} '; 1648 } 1636 } 1649 1637 1650 1638 // Toolbar - Background … … 1867 1855 } 1868 1856 if ( $icon_color . $font_shadow != "" ) 1869 $style_saved .= '#wpadminbar #wp-admin-bar-root-default .ab-icon, #wpadminbar #wp-admin-bar-top-secondary .ab-icon, #wpadminbar .ab-item span:before, #wpadminbar .ab-top-menu > li > .ab-item:before, #wpadminbar .ab-top-menu > li.menupop > .ab-item:before, #wpadminbar li #adminbarsearch:before, #wpadminbar #wp-admin-bar-wp-logo > .ab-item .ab-icon, #wpadminbar li > .ab-item > .ab-icon:before { '.$icon_color . $font_shadow.'} '; 1857 if ( get_option( 'wpst_toolbar_search_field', array() ) != array() ) $style_saved .= '#wpadminbar li #adminbarsearch:before, '; 1858 $style_saved .= '#wpadminbar #wp-admin-bar-root-default .ab-icon, #wpadminbar #wp-admin-bar-top-secondary .ab-icon, #wpadminbar .ab-item span:before, #wpadminbar .ab-top-menu > li > .ab-item:before, #wpadminbar .ab-top-menu > li.menupop > .ab-item:before, #wpadminbar #wp-admin-bar-wp-logo > .ab-item .ab-icon, #wpadminbar li > .ab-item > .ab-icon:before { '.$icon_color . $font_shadow.'} '; 1870 1859 1871 1860 // Add icon colour as border to Toolbar Avatar … … 1873 1862 $style_saved .= '#wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar > a img { ' . $border_color . $background_color . $box_shadow . '} '; 1874 1863 1864 // Add icon size to icons 1875 1865 $icon_size = ( isset( $wpst_style_tb_current['icon_size'] ) ) ? $wpst_style_tb_current['icon_size'] : $wpst_default_toolbar['icon_size'] ; 1876 1866 if ( isset( $wpst_style_tb_current['icon_size'] ) ) … … 1879 1869 1880 1870 // Add icon size to Toolbar fonticons 1881 $style_saved .= '#wpadminbar #wp-admin-bar-root-default .ab-icon, #wpadminbar .ab-item span:before, #wpadminbar .ab-top-menu > li.menupop > .ab-item:before, #wpadminbar .ab-top-menu > li > .ab-item:before, #wpadminbar #wp-admin-bar-wp-logo > .ab-item .ab-icon, #wpadminbar li > .ab-item > .ab-icon:before { font-size: '.$wpst_style_tb_current['icon_size'].'px; } '; 1871 if ( get_option( 'wpst_toolbar_wp_logo', array() ) != array() ) $style_saved .= '#wpadminbar #wp-admin-bar-wp-logo > .ab-item .ab-icon, '; 1872 $style_saved .= '#wpadminbar #wp-admin-bar-root-default .ab-icon, #wpadminbar .ab-item span:before, #wpadminbar .ab-top-menu > li.menupop > .ab-item:before, #wpadminbar .ab-top-menu > li > .ab-item:before, #wpadminbar li > .ab-item > .ab-icon:before { font-size: '.$wpst_style_tb_current['icon_size'].'px; } '; 1873 1874 // Add icon size to Search icon with "Important" in it 1875 if ( get_option( 'wpst_toolbar_search_field', array() ) != array() ) { 1876 $style_saved .= '#wpadminbar #adminbarsearch:before { font-size: '.$wpst_style_tb_current['icon_size'].'px !Important; } '; 1877 } 1882 1878 1883 1879 // Resize WP Logo … … 1885 1881 1886 1882 // Add size to Toolbar Avatar, non-responsive only 1887 if ( get_option( 'wpst_myaccount_avatar_small', 'on' ) == "on" ) $style_saved .= '#wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar > a img { width: '.($wpst_style_tb_current['icon_size'] - 4).'px; height: '.($wpst_style_tb_current['icon_size'] - 4).'px; } '; 1888 1889 // Add font size to Search fonticon with "Important" in it 1890 $style_saved .= '#wpadminbar #adminbarsearch:before { font-size: '.$wpst_style_tb_current['icon_size'].'px !Important; top: '. round( ( $height - $wpst_style_tb_current['icon_size'] ) /2 ) .'px; } '; 1883 if ( get_option( 'wpst_myaccount_avatar_small', 'on' ) == "on" ) $style_saved .= '#wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar > a img { width: '.($wpst_style_tb_current['icon_size'] - 4).'px; height: '.($wpst_style_tb_current['icon_size'] - 4).'px; margin-top: -3px; } '; 1884 1885 $style_saved .= '} '; 1891 1886 } 1892 1887 1893 1888 // Add paddings to icons as needed 1894 1889 if ( ( $icon_size != $wpst_default_toolbar['icon_size'] ) || ( $height != $wpst_default_toolbar['height'] ) ) { 1895 1896 // This is essentially based on trial-error method, please don't tell my wife, OK? 1897 if ( $icon_size < $wpst_default_toolbar['icon_size'] - 1 ) { // fonticons of 18px and less 1898 $icon_W_margin_top = round( ( $icon_size - $wpst_default_toolbar['icon_size'] ) /2 ); 1899 $icon_S_margin_top = round( ( ( $icon_size - $wpst_default_toolbar['icon_size'] ) /2 ) -1.5 ); 1890 $style_saved .= '@media screen and ( min-width: 783px ) { '; 1891 1892 // 32px Toolbar needs a special treatment 1893 if ( $height == $wpst_default_toolbar['height'] ) { 1894 1895 // My Sites and Site Name icons 1896 (int)$icon_sites_margin_top = round( ( $wpst_default_toolbar['icon_size'] - $icon_size ) /2 ) + 2; 1897 1898 // WP Logo and Updates icons 1899 if ( $icon_size < $wpst_default_toolbar['icon_size'] ) { 1900 (int)$icon_W_margin_top = round( ( $icon_size - $wpst_default_toolbar['icon_size'] ) /2 ) + 2; 1901 } else { 1902 (int)$icon_W_margin_top = $icon_sites_margin_top; 1903 } 1904 1905 // WP Symposium icons 1906 if ( $icon_size < $wpst_default_toolbar['icon_size'] - 2 ) { 1907 (int)$icon_S_margin_top = round( ( ( $icon_size - $wpst_default_toolbar['icon_size'] ) /2 ) + 1 ); 1908 } elseif ( $icon_size > $wpst_default_toolbar['icon_size'] + 4 ) { 1909 (int)$icon_S_margin_top = $icon_sites_margin_top; 1910 } else { 1911 (int)$icon_S_margin_top = 0; 1912 } 1913 1914 // Custom Toolbar height 1900 1915 } else { 1901 $icon_W_margin_top = 0; 1902 $icon_S_margin_top = -1; 1916 1917 // My Sites and Site Name icons 1918 (int)$icon_sites_margin_top = -4; 1919 1920 // WP Logo and Updates icons 1921 if ( $icon_size < $wpst_default_toolbar['icon_size'] ) { 1922 (int)$icon_W_margin_top = round( ( ( $icon_size - $wpst_default_toolbar['icon_size'] ) /2 ) - 4 ); 1923 } else { 1924 (int)$icon_W_margin_top = -4; 1925 } 1926 1927 // WP Symposium icons 1928 if ( $icon_size < $wpst_default_toolbar['icon_size'] ) { 1929 (int)$icon_S_margin_top = round( ( ( $icon_size - $wpst_default_toolbar['icon_size'] ) /2 ) - 5 ); 1930 } else { 1931 (int)$icon_S_margin_top = -5; 1932 } 1903 1933 } 1904 $icon_new_content_margin_top = $icon_W_margin_top + 2; 1905 1906 $style_saved .= '#wpadminbar #wp-admin-bar-wp-logo > .ab-item .ab-icon:before, #wpadminbar #wp-admin-bar-updates .ab-icon:before { top: '.$icon_W_margin_top.'px; } '; 1907 $style_saved .= '#wpadminbar #wp-admin-bar-new-content .ab-icon:before, #wpadminbar #wp-admin-bar-comments .ab-icon:before { top: '.$icon_new_content_margin_top.'px; } '; 1908 $style_saved .= '#wpadminbar #wp-admin-bar-my-symposium-admin > .ab-item > span.ab-icon:before, #wpadminbar li.symposium-toolbar-notifications-mail > .ab-item > .ab-icon:before, #wpadminbar li.symposium-toolbar-notifications-friendship > .ab-item > .ab-icon:before { top: '.$icon_S_margin_top.'px; } '; 1909 $style_saved .= '#wpadminbar #wp-admin-bar-my-sites > .ab-item:before, #wpadminbar #wp-admin-bar-site-name > .ab-item:before, #wpadminbar #wp-admin-bar-my-wpms-admin > .ab-item:before { top: 0; } '; 1910 $style_saved .= '#wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar > a img { margin-top: -2px; } '; 1934 1935 // New Content icon 1936 (int)$icon_new_content_margin_top = $icon_W_margin_top + 2; 1937 1938 // Add My Sites and Site Name icons top margin 1939 $comma = ''; 1940 $style_chunk = ""; 1941 if ( get_option( 'wpst_toolbar_my_sites', array() ) != array() ) { $style_chunk .= '#wpadminbar #wp-admin-bar-my-sites > .ab-item:before'; $comma = ', '; } 1942 if ( get_option( 'wpst_toolbar_site_name', array() ) != array() ) { $style_chunk .= $comma.'#wpadminbar #wp-admin-bar-site-name > .ab-item:before'; $comma = ', '; } 1943 if ( get_option( 'wpst_wpms_network_superadmin_menu', 'on' ) == "on" ) { $style_chunk .= $comma.'#wpadminbar #wp-admin-bar-my-wpms-admin > .ab-item:before'; $comma = ', '; } 1944 $style_saved .= $style_chunk.$comma.'#wpadminbar .ab-top-menu > li > a:before { top: '.$icon_sites_margin_top.'px; } '; 1945 1946 // Add WP Logo and Updates icons top margin 1947 $comma = ''; 1948 $style_chunk = ""; 1949 if ( get_option( 'wpst_toolbar_wp_logo', array() ) != array() ) { $style_chunk .= '#wpadminbar #wp-admin-bar-wp-logo > .ab-item .ab-icon:before'; $comma = ', '; } 1950 if ( get_option( 'wpst_toolbar_updates_icon', array() ) != array() ) { $style_chunk .= $comma.'#wpadminbar #wp-admin-bar-updates .ab-icon:before'; } 1951 if ( $style_chunk != "" ) $style_saved .= $style_chunk.' { top: '.$icon_W_margin_top.'px; } '; 1952 1953 // Add New Content and Comments icons top margin 1954 $comma = ''; 1955 $style_chunk = ""; 1956 if ( get_option( 'wpst_toolbar_new_content', array() ) != array() ) { $style_chunk .= '#wpadminbar #wp-admin-bar-new-content .ab-icon:before'; $comma = ', '; } 1957 if ( get_option( 'wpst_toolbar_comments_bubble', array() ) != array() ) { $style_chunk .= $comma.'#wpadminbar #wp-admin-bar-comments .ab-icon:before'; } 1958 if ( $style_chunk != "" ) $style_saved .= $style_chunk.' { top: '.$icon_new_content_margin_top.'px; } '; 1959 1960 // Add WPS icons top margin 1961 $comma = ''; 1962 $style_chunk = ""; 1963 if ( get_option( 'wpst_toolbar_new_content', array() ) != array() ) { $style_chunk .= '#wpadminbar #wp-admin-bar-my-symposium-admin > .ab-item > span.ab-icon:before'; $comma = ', '; } 1964 if ( get_option( 'wpst_wps_notification_friendship', array() ) != array() ) { $style_chunk .= $comma.'#wpadminbar li.symposium-toolbar-notifications-mail > .ab-item > .ab-icon:before'; $comma = ', '; } 1965 if ( get_option( 'wpst_wps_notification_mail', array() ) != array() ) { $style_chunk .= $comma.'#wpadminbar li.symposium-toolbar-notifications-friendship > .ab-item > .ab-icon:before'; } 1966 if ( $style_chunk != "" ) $style_saved .= $style_chunk.' { top: '.$icon_S_margin_top.'px; } '; 1967 1968 // $style_saved .= '#wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar > a img { margin-top: -2px; } '; 1911 1969 1912 1970 $style_saved .= '} '; 1913 1914 // Add height and margin to Search fonticon1915 $style_saved .= '#wpadminbar > #wp-toolbar > #wp-admin-bar-root-default > #wp-admin-bar-search #adminbarsearch input.adminbar-input { height: '.$icon_size.'px; padding-left: '.$icon_size.'px; top: '. round( ( $height - $wpst_default_toolbar['height'] ) /2 ) .'px; } ';1916 }1917 }1918 1971 } 1972 } 1973 1974 1975 // Search form 1976 $style_saved .= '#wpadminbar #wp-admin-bar-search .ab-item { height: '. $height . 'px; top: 0px; } '; 1919 1977 1920 1978 // Search field 1921 // Determine Search field height and padding-top 1922 // Ensure the search field fits in the Toolbar 1923 $search_height = ( $wpst_default_toolbar['search_height'] > $height - 4 ) ? ( $height - 4 ) : $wpst_default_toolbar['search_height']; 1924 // Apply ratio so that font fits in search field 1925 $font_size = round( ( $search_height * $wpst_default_toolbar['font_size'] ) / $wpst_default_toolbar['search_height'] ); 1926 // Center the search field in the Toolbar 1927 $search_padding_top = round( ( $height - $search_height ) / 2 ) - 4; 1928 1929 if ( $search_height > 0 ) { 1930 $style_saved .= '#wpadminbar #adminbarsearch { height: '. $search_height . 'px; } '; 1931 $style_saved .= '#wpadminbar #adminbarsearch .adminbar-input, #wpadminbar #adminbarsearch input { height: ' . $search_height . 'px; font-size: ' . $font_size . 'px; } '; 1932 } 1933 if ( $search_padding_top > 0 ) $style_saved .= '#wpadminbar #wp-admin-bar-search .ab-item { padding-top: ' . $search_padding_top . 'px; } '; 1934 1935 // Add the font shadow to the Search icon and field as a box-shadow 1979 $search_height = ( $height - 4 < $wpst_default_toolbar['search_height'] ) ? ( $height - 4 ) : $wpst_default_toolbar['search_height']; // Ensure the search form fits in the Toolbar 1980 $search_top = round( ( $height - $search_height ) / 2 ); // Center the search form in the Toolbar 1981 $style_saved .= '#wpadminbar #adminbarsearch { height: '. $search_height . 'px; top: ' . $search_top . 'px; } '; 1982 $style_saved .= '#wpadminbar > #wp-toolbar > #wp-admin-bar-root-default > #wp-admin-bar-search #adminbarsearch input.adminbar-input { height: '. $search_height . 'px; top: -4px; padding-left: '.$height.'px; } '; 1983 1984 // Search icon 1985 if ( get_option( 'wpst_toolbar_search_field', array() ) != array() ) { 1986 $search_icon_top = round( ( $wpst_default_toolbar['icon_size'] - $icon_size ) /2 ) + 2; 1987 $style_saved .= '#wpadminbar #adminbarsearch:before { top: '. $search_icon_top .'px; } '; 1988 } 1989 1990 // Add the font shadow to the Search field as a box-shadow 1936 1991 if ( $box_shadow != '' ) 1937 1992 $style_saved .= '#wpadminbar #adminbarsearch .adminbar-input:focus { ' . $box_shadow . '} '; 1938 1993 1939 // JetPack 1940 // Correct some paddings for its Toolbar items 1994 // JetPack - Correct some paddings for its Toolbar items 1941 1995 if ( is_multisite() ) 1942 1996 (bool)$jetpack_is_active = ( is_plugin_active_for_network( 'jetpack/jetpack.php' ) || is_plugin_active( 'jetpack/jetpack.php' ) ); … … 1984 2038 1985 2039 // Hover Toolbar - Background plain colour only 2040 $style_chunk = ""; 2041 $style_chunk_tablet = ""; 1986 2042 if ( $linear_gradient == '' ) { 1987 2043 if ( $background_colour != $wpst_default_toolbar['hover_background_colour'] ) { … … 2111 2167 } 2112 2168 2113 if ( isset( $wpst_style_tb_current['icon_colour'] ) ) 2114 if ( $wpst_style_tb_current['icon_colour'] != '' ) { 2115 $wpst_hover_icon_colour = ( isset( $wpst_style_tb_current['hover_icon_colour'] ) ) ? $wpst_style_tb_current['hover_icon_colour'] : $wpst_default_toolbar['hover_icon_colour']; 2169 if ( isset( $wpst_style_tb_current['hover_icon_colour'] ) ) 2170 if ( $wpst_style_tb_current['hover_icon_colour'] != '' ) { 2171 // $wpst_hover_icon_colour = ( isset( $wpst_style_tb_current['hover_icon_colour'] ) ) ? $wpst_style_tb_current['hover_icon_colour'] : $wpst_default_toolbar['hover_icon_colour']; 2172 $wpst_hover_icon_colour = $wpst_style_tb_current['hover_icon_colour']; 2116 2173 $icon_color = 'color: '.$wpst_hover_icon_colour.'; '; 2117 2174 $border_color = 'border-'.$icon_color; … … 2158 2215 $style_chunk .= 'font-family: ' . trim( $wpst_font_clean, ',' ) . '; '; 2159 2216 } 2160 2161 // Font family for display name2162 // if ( version_compare( $wp_version, '3.8-alpha', '>' ) && $wpst_font_clean )2163 // $style_saved .= '#wpadminbar > #wp-toolbar > #wp-admin-bar-top-secondary span.display-name, #wpadminbar #wp-admin-bar-user-info .username { font-family: ' . trim( $wpst_font_clean, ',' ) . ' } ';2164 2217 2165 2218 // Font Size … … 2426 2479 2427 2480 /** 2481 * Create an array of arrays by parsing activated features of WPS, to create a menu available site wide for instant use 2482 * This function is called 2483 * - upon plugin activation, 2484 * - saving plugin options, 2485 * - conditionally upon WPS activation, 2486 * - and at each visit of the WPS Install page 2487 * [0] - title - string - The title of the node. 2488 * [1] - view - string - The admin page to display, will be used for the href 2489 * [2] - ID - string - The ID of the item, made of 'symposium_toolbar_'.$slug except for the top level item 2490 * [3] - parent - string - The ID of the parent node. 2491 * [4] - meta - string - Meta data that may include the following keys: html, class, onclick, target, title, tabindex. 2492 * 2493 * @since O.0.3 2494 * 2495 * @param none 2496 * @return none 2497 */ 2498 function symposium_toolbar_update_wps_admin_menu() { 2499 2500 global $wpdb, $submenu; 2501 $args = array(); 2502 2503 // Menu entry - Top level menu item 2504 array_push( $args, array ( '<span class="ab-icon ab-icon-wps"></span><span class="ab-label ab-label-wps">WP Symposium</span>', admin_url( 'admin.php?page=symposium_debug' ), 'my-symposium-admin', '', array( 'class' => 'my-toolbar-page' ) ) ); 2505 2506 // Aggregate menu items? 2507 $hidden = get_option( WPS_OPTIONS_PREFIX.'_long_menu' ) == "on" ? '_hidden': ''; 2508 2509 if ( isset( $submenu["symposium_debug"] ) && is_array( $submenu["symposium_debug"] ) ) foreach ( $submenu["symposium_debug"] as $symposium_toolbar_admin_menu_item ) { 2510 $slug = symposium_toolbar_make_slug( $symposium_toolbar_admin_menu_item[0] ); // Slug 2511 $symposium_toolbar_admin_menu_item[1] = admin_url( 'admin.php?page='.$symposium_toolbar_admin_menu_item[2] ); // URL 2512 $symposium_toolbar_admin_menu_item[2] = 'symposium_toolbar_'.$slug; // ID 2513 $symposium_toolbar_admin_menu_item[3] = "my-symposium-admin"; // Parent ID 2514 array_push( $symposium_toolbar_admin_menu_item, array( 'class' => 'symposium_toolbar_admin' ) ); // Meta 2515 $args[] = $symposium_toolbar_admin_menu_item; 2516 2517 if ( $hidden && ( $symposium_toolbar_admin_menu_item[0] == __( 'Options', WPS_TEXT_DOMAIN ) ) ) { 2518 if ( get_option( WPS_OPTIONS_PREFIX.'__wps__profile_activated' ) || get_option( WPS_OPTIONS_PREFIX.'__wps__profile_network_activated' ) ) array_push( $args, array ( __( 'Profile', WPS_TEXT_DOMAIN ), admin_url( 'admin.php?page='.'symposium_profile' ), 'symposium_toolbar_profile', 'symposium_toolbar_'.$slug, array( 'class' => 'symposium_toolbar_admin symposium_toolbar_admin_'.$slug ) ) ); 2519 if ( get_option( WPS_OPTIONS_PREFIX.'__wps__profile_plus_activated' ) || get_option( WPS_OPTIONS_PREFIX.'__wps__profile_plus_network_activated' ) ) array_push( $args, array ( __( 'Plus', WPS_TEXT_DOMAIN ), admin_url( 'admin.php?page='.WPS_DIR.'/plus_admin.php' ), 'symposium_toolbar_plus', 'symposium_toolbar_'.$slug, array( 'class' => 'symposium_toolbar_admin symposium_toolbar_admin_'.$slug ) ) ); 2520 if ( get_option( WPS_OPTIONS_PREFIX.'__wps__forum_activated' ) || get_option( WPS_OPTIONS_PREFIX.'__wps__forum_network_activated' ) ) array_push( $args, array ( __( 'Forum', WPS_TEXT_DOMAIN ), admin_url( 'admin.php?page='.'symposium_forum' ), 'symposium_toolbar_forum', 'symposium_toolbar_'.$slug, array( 'class' => 'symposium_toolbar_admin symposium_toolbar_admin_'.$slug ) ) ); 2521 if ( get_option( WPS_OPTIONS_PREFIX.'__wps__members_activated' ) || get_option( WPS_OPTIONS_PREFIX.'__wps__members_network_activated' ) ) array_push( $args, array ( __( 'Directory', WPS_TEXT_DOMAIN ), admin_url( 'admin.php?page='.'__wps__members_menu' ), 'symposium_toolbar_directory', 'symposium_toolbar_'.$slug, array( 'class' => 'symposium_toolbar_admin symposium_toolbar_admin_'.$slug ) ) ); 2522 if ( get_option( WPS_OPTIONS_PREFIX.'__wps__mail_activated' ) || get_option( WPS_OPTIONS_PREFIX.'__wps__mail_network_activated' ) ) array_push( $args, array ( __( 'Mail', WPS_TEXT_DOMAIN ), admin_url( 'admin.php?page='.'__wps__mail_menu' ), 'symposium_toolbar_mail', 'symposium_toolbar_'.$slug, array( 'class' => 'symposium_toolbar_admin symposium_toolbar_admin_'.$slug ) ) ); 2523 if ( get_option( WPS_OPTIONS_PREFIX.'__wps__groups_activated' ) || get_option( WPS_OPTIONS_PREFIX.'__wps__groups_network_activated' ) ) array_push( $args, array ( __( 'Groups', WPS_TEXT_DOMAIN ), admin_url( 'admin.php?page='.WPS_DIR.'/groups_admin.php' ), 'symposium_toolbar_groups', 'symposium_toolbar_'.$slug, array( 'class' => 'symposium_toolbar_admin symposium_toolbar_admin_'.$slug ) ) ); 2524 if ( get_option( WPS_OPTIONS_PREFIX.'__wps__gallery_activated' ) || get_option( WPS_OPTIONS_PREFIX.'__wps__gallery_network_activated' ) ) array_push( $args, array ( __( 'Gallery', WPS_TEXT_DOMAIN ), admin_url( 'admin.php?page='.WPS_DIR.'/gallery_admin.php' ), 'symposium_toolbar_gallery', 'symposium_toolbar_'.$slug, array( 'class' => 'symposium_toolbar_admin symposium_toolbar_admin_'.$slug ) ) ); 2525 if ( get_option( WPS_OPTIONS_PREFIX.'__wps__news_main_activated' ) || get_option( WPS_OPTIONS_PREFIX.'__wps__news_main_network_activated' ) ) array_push( $args, array ( __( 'Alerts', WPS_TEXT_DOMAIN ), admin_url( 'admin.php?page='.WPS_DIR.'/news_admin.php' ), 'symposium_toolbar_alerts', 'symposium_toolbar_'.$slug, array( 'class' => 'symposium_toolbar_admin symposium_toolbar_admin_'.$slug ) ) ); 2526 if ( get_option( WPS_OPTIONS_PREFIX.'__wps__add_notification_bar_activated' ) || get_option( WPS_OPTIONS_PREFIX.'__wps__add_notification_bar_network_activated' ) ) array_push( $args, array ( __( 'Panel', WPS_TEXT_DOMAIN ), admin_url( 'admin.php?page='.'symposium_bar' ), 'symposium_toolbar_panel', 'symposium_toolbar_'.$slug, array( 'class' => 'symposium_toolbar_admin symposium_toolbar_admin_'.$slug ) ) ); 2527 if ( get_option( WPS_OPTIONS_PREFIX.'__wps__events_main_activated' ) || get_option( WPS_OPTIONS_PREFIX.'__wps__events_main_network_activated' ) ) array_push( $args, array ( __( 'Events', WPS_TEXT_DOMAIN ), admin_url( 'admin.php?page='.WPS_DIR.'/events_admin.php' ), 'symposium_toolbar_events', 'symposium_toolbar_'.$slug, array( 'class' => 'symposium_toolbar_admin symposium_toolbar_admin_'.$slug ) ) ); 2528 if ( get_option( WPS_OPTIONS_PREFIX.'__wps__facebook_activated' ) || get_option( WPS_OPTIONS_PREFIX.'__wps__facebook_network_activated' ) ) array_push( $args, array ( __( 'Facebook', WPS_TEXT_DOMAIN ), admin_url( 'admin.php?page='.WPS_DIR.'/facebook_admin.php' ), 'symposium_toolbar_facebook', 'symposium_toolbar_'.$slug, array( 'class' => 'symposium_toolbar_admin symposium_toolbar_admin_'.$slug ) ) ); 2529 if ( get_option( WPS_OPTIONS_PREFIX.'__wps__mobile_activated' ) || get_option( WPS_OPTIONS_PREFIX.'__wps__mobile_network_activated' ) ) array_push( $args, array ( __( 'Mobile', WPS_TEXT_DOMAIN ), admin_url( 'admin.php?page='.'__wps__mobile_menu' ), 'symposium_toolbar_mobile', 'symposium_toolbar_'.$slug, array( 'class' => 'symposium_toolbar_admin symposium_toolbar_admin_'.$slug ) ) ); 2530 if ( get_option( WPS_OPTIONS_PREFIX.'__wps__mailinglist_activated' ) || get_option( WPS_OPTIONS_PREFIX.'__wps__mailinglist_network_activated' ) ) array_push( $args, array ( __( 'Reply', WPS_TEXT_DOMAIN ), admin_url( 'admin.php?page='.WPS_DIR.'/mailinglist_admin.php' ), 'symposium_toolbar_reply', 'symposium_toolbar_'.$slug, array( 'class' => 'symposium_toolbar_admin symposium_toolbar_admin_'.$slug ) ) ); 2531 if ( get_option( WPS_OPTIONS_PREFIX.'__wps__lounge_main_activated' ) || get_option( WPS_OPTIONS_PREFIX.'__wps__lounge_main_network_activated' ) ) array_push( $args, array ( __( 'Lounge', WPS_TEXT_DOMAIN ), admin_url( 'admin.php?page='.WPS_DIR.'/lounge_admin.php' ), 'symposium_toolbar_lounge', 'symposium_toolbar_'.$slug, array( 'class' => 'symposium_toolbar_admin symposium_toolbar_admin_'.$slug ) ) ); 2532 } 2533 if ( $hidden && ( $symposium_toolbar_admin_menu_item[0] == __( 'Manage', WPS_TEXT_DOMAIN ) ) ) { 2534 array_push( $args, array ( __( 'Settings', WPS_TEXT_DOMAIN ), admin_url( 'admin.php?page='.'symposium_settings' ), 'symposium_toolbar_settings', 'symposium_toolbar_'.$slug, array( 'class' => 'symposium_toolbar_admin symposium_toolbar_admin_'.$slug ) ) ); 2535 array_push( $args, array ( __( 'Advertising', WPS_TEXT_DOMAIN ), admin_url( 'admin.php?page='.'symposium_advertising' ), 'symposium_toolbar_advertising', 'symposium_toolbar_'.$slug, array( 'class' => 'symposium_toolbar_admin symposium_toolbar_admin_'.$slug ) ) ); 2536 array_push( $args, array ( __( 'Thesaurus', WPS_TEXT_DOMAIN ), admin_url( 'admin.php?page='.'symposium_thesaurus' ), 'symposium_toolbar_thesaurus', 'symposium_toolbar_'.$slug, array( 'class' => 'symposium_toolbar_admin symposium_toolbar_admin_'.$slug ) ) ); 2537 if ( get_option( WPS_OPTIONS_PREFIX.'__wps__forum_activated' ) || get_option( WPS_OPTIONS_PREFIX.'__wps__forum_network_activated' ) ) array_push( $args, array ( __( 'Categories', WPS_TEXT_DOMAIN ), admin_url( 'admin.php?page='.'symposium_categories' ), 'symposium_toolbar_categories', 'symposium_toolbar_'.$slug, array( 'class' => 'symposium_toolbar_admin symposium_toolbar_admin_'.$slug ) ) ); 2538 if ( get_option( WPS_OPTIONS_PREFIX.'__wps__forum_activated' ) || get_option( WPS_OPTIONS_PREFIX.'__wps__forum_network_activated' ) ) array_push( $args, array ( __( 'Forum Posts', WPS_TEXT_DOMAIN ), admin_url( 'admin.php?page='.'symposium_moderation' ), 'symposium_toolbar_forum_posts', 'symposium_toolbar_'.$slug, array( 'class' => 'symposium_toolbar_admin symposium_toolbar_admin_'.$slug ) ) ); 2539 if ( get_option( WPS_OPTIONS_PREFIX.'__wps__mail_activated' ) || get_option( WPS_OPTIONS_PREFIX.'__wps__mail_network_activated' ) ) array_push( $args, array ( __( 'Mail Messages', WPS_TEXT_DOMAIN ), admin_url( 'admin.php?page='.'__wps__mail_messages_menu' ), 'symposium_toolbar_mail_messages', 'symposium_toolbar_'.$slug, array( 'class' => 'symposium_toolbar_admin symposium_toolbar_admin_'.$slug ) ) ); 2540 array_push( $args, array ( __( 'Templates', WPS_TEXT_DOMAIN ), admin_url( 'admin.php?page='.'symposium_templates' ), 'symposium_toolbar_templates', 'symposium_toolbar_'.$slug, array( 'class' => 'symposium_toolbar_admin symposium_toolbar_admin_'.$slug ) ) ); 2541 if ( get_option( WPS_OPTIONS_PREFIX.'_audit' ) ) array_push( $args, array ( __( 'Audit', WPS_TEXT_DOMAIN ), 'symposium_audit', 'symposium_toolbar_audit', 'symposium_toolbar_'.$slug, array( 'class' => 'symposium_toolbar_admin symposium_toolbar_admin_'.$slug ) ) ); 2542 } 2543 } 2544 2545 // Store the menu structure 2546 update_option( 'wpst_tech_wps_admin_menu', $args ); 2547 } 2548 2549 /** 2428 2550 * Check that an array of roles is actually an array of roles of the site 2429 2551 * The returned value may be checked against the sent param for a boolean result -
wp-symposium-toolbar/trunk/wp-symposium-toolbar_functions.php
r853887 r862478 698 698 function symposium_toolbar_symposium_admin() { 699 699 700 if ( !is_admin_bar_showing() || !current_user_can( 'manage_options' ) || ( get_option( 'wpst_wps_admin_menu', 'on' ) != "on" ) ) 701 return; 702 703 global $submenu, $wp_admin_bar; 704 $args = array(); 705 706 // Aggregate menu items? 707 $hidden = get_option( WPS_OPTIONS_PREFIX.'_long_menu' ) == "on" ? '_hidden': ''; 708 709 // Menu entry - Top level menu item 710 array_push( $args, array ( '<span class="ab-icon ab-icon-wps"></span><span class="ab-label ab-label-wps">WP Symposium</span>', admin_url( 'admin.php?page=symposium_debug' ), 'my-symposium-admin', '', array( 'class' => 'my-toolbar-page' ) ) ); 711 712 // Now, loop over menu items 713 if ( isset( $submenu["symposium_debug"] ) && is_array( $submenu["symposium_debug"] ) ) foreach ( $submenu["symposium_debug"] as $symposium_toolbar_admin_menu_item ) { 714 $slug = symposium_toolbar_make_slug( $symposium_toolbar_admin_menu_item[0] ); // Slug 715 $symposium_toolbar_admin_menu_item[1] = admin_url( 'admin.php?page='.$symposium_toolbar_admin_menu_item[2] ); // URL 716 $symposium_toolbar_admin_menu_item[2] = 'symposium_toolbar_'.$slug; // ID 717 $symposium_toolbar_admin_menu_item[3] = "my-symposium-admin"; // Parent ID 718 array_push( $symposium_toolbar_admin_menu_item, array( 'class' => 'symposium_toolbar_admin' ) ); // Meta 719 $args[] = $symposium_toolbar_admin_menu_item; 720 721 if ( $hidden && ( $symposium_toolbar_admin_menu_item[0] == __( 'Options', WPS_TEXT_DOMAIN ) ) ) { 722 if ( get_option( WPS_OPTIONS_PREFIX.'__wps__profile_activated' ) || get_option( WPS_OPTIONS_PREFIX.'__wps__profile_network_activated' ) ) array_push( $args, array ( __( 'Profile', WPS_TEXT_DOMAIN ), admin_url( 'admin.php?page='.'symposium_profile' ), 'symposium_toolbar_profile', 'symposium_toolbar_'.$slug, array( 'class' => 'symposium_toolbar_admin symposium_toolbar_admin_'.$slug ) ) ); 723 if ( get_option( WPS_OPTIONS_PREFIX.'__wps__profile_plus_activated' ) || get_option( WPS_OPTIONS_PREFIX.'__wps__profile_plus_network_activated' ) ) array_push( $args, array ( __( 'Plus', WPS_TEXT_DOMAIN ), admin_url( 'admin.php?page='.WPS_DIR.'/plus_admin.php' ), 'symposium_toolbar_plus', 'symposium_toolbar_'.$slug, array( 'class' => 'symposium_toolbar_admin symposium_toolbar_admin_'.$slug ) ) ); 724 if ( get_option( WPS_OPTIONS_PREFIX.'__wps__forum_activated' ) || get_option( WPS_OPTIONS_PREFIX.'__wps__forum_network_activated' ) ) array_push( $args, array ( __( 'Forum', WPS_TEXT_DOMAIN ), admin_url( 'admin.php?page='.'symposium_forum' ), 'symposium_toolbar_forum', 'symposium_toolbar_'.$slug, array( 'class' => 'symposium_toolbar_admin symposium_toolbar_admin_'.$slug ) ) ); 725 if ( get_option( WPS_OPTIONS_PREFIX.'__wps__members_activated' ) || get_option( WPS_OPTIONS_PREFIX.'__wps__members_network_activated' ) ) array_push( $args, array ( __( 'Directory', WPS_TEXT_DOMAIN ), admin_url( 'admin.php?page='.'__wps__members_menu' ), 'symposium_toolbar_directory', 'symposium_toolbar_'.$slug, array( 'class' => 'symposium_toolbar_admin symposium_toolbar_admin_'.$slug ) ) ); 726 if ( get_option( WPS_OPTIONS_PREFIX.'__wps__mail_activated' ) || get_option( WPS_OPTIONS_PREFIX.'__wps__mail_network_activated' ) ) array_push( $args, array ( __( 'Mail', WPS_TEXT_DOMAIN ), admin_url( 'admin.php?page='.'__wps__mail_menu' ), 'symposium_toolbar_mail', 'symposium_toolbar_'.$slug, array( 'class' => 'symposium_toolbar_admin symposium_toolbar_admin_'.$slug ) ) ); 727 if ( get_option( WPS_OPTIONS_PREFIX.'__wps__groups_activated' ) || get_option( WPS_OPTIONS_PREFIX.'__wps__groups_network_activated' ) ) array_push( $args, array ( __( 'Groups', WPS_TEXT_DOMAIN ), admin_url( 'admin.php?page='.WPS_DIR.'/groups_admin.php' ), 'symposium_toolbar_groups', 'symposium_toolbar_'.$slug, array( 'class' => 'symposium_toolbar_admin symposium_toolbar_admin_'.$slug ) ) ); 728 if ( get_option( WPS_OPTIONS_PREFIX.'__wps__gallery_activated' ) || get_option( WPS_OPTIONS_PREFIX.'__wps__gallery_network_activated' ) ) array_push( $args, array ( __( 'Gallery', WPS_TEXT_DOMAIN ), admin_url( 'admin.php?page='.WPS_DIR.'/gallery_admin.php' ), 'symposium_toolbar_gallery', 'symposium_toolbar_'.$slug, array( 'class' => 'symposium_toolbar_admin symposium_toolbar_admin_'.$slug ) ) ); 729 if ( get_option( WPS_OPTIONS_PREFIX.'__wps__news_main_activated' ) || get_option( WPS_OPTIONS_PREFIX.'__wps__news_main_network_activated' ) ) array_push( $args, array ( __( 'Alerts', WPS_TEXT_DOMAIN ), admin_url( 'admin.php?page='.WPS_DIR.'/news_admin.php' ), 'symposium_toolbar_alerts', 'symposium_toolbar_'.$slug, array( 'class' => 'symposium_toolbar_admin symposium_toolbar_admin_'.$slug ) ) ); 730 if ( get_option( WPS_OPTIONS_PREFIX.'__wps__add_notification_bar_activated' ) || get_option( WPS_OPTIONS_PREFIX.'__wps__add_notification_bar_network_activated' ) ) array_push( $args, array ( __( 'Panel', WPS_TEXT_DOMAIN ), admin_url( 'admin.php?page='.'symposium_bar' ), 'symposium_toolbar_panel', 'symposium_toolbar_'.$slug, array( 'class' => 'symposium_toolbar_admin symposium_toolbar_admin_'.$slug ) ) ); 731 if ( get_option( WPS_OPTIONS_PREFIX.'__wps__events_main_activated' ) || get_option( WPS_OPTIONS_PREFIX.'__wps__events_main_network_activated' ) ) array_push( $args, array ( __( 'Events', WPS_TEXT_DOMAIN ), admin_url( 'admin.php?page='.WPS_DIR.'/events_admin.php' ), 'symposium_toolbar_events', 'symposium_toolbar_'.$slug, array( 'class' => 'symposium_toolbar_admin symposium_toolbar_admin_'.$slug ) ) ); 732 if ( get_option( WPS_OPTIONS_PREFIX.'__wps__facebook_activated' ) || get_option( WPS_OPTIONS_PREFIX.'__wps__facebook_network_activated' ) ) array_push( $args, array ( __( 'Facebook', WPS_TEXT_DOMAIN ), admin_url( 'admin.php?page='.WPS_DIR.'/facebook_admin.php' ), 'symposium_toolbar_facebook', 'symposium_toolbar_'.$slug, array( 'class' => 'symposium_toolbar_admin symposium_toolbar_admin_'.$slug ) ) ); 733 if ( get_option( WPS_OPTIONS_PREFIX.'__wps__mobile_activated' ) || get_option( WPS_OPTIONS_PREFIX.'__wps__mobile_network_activated' ) ) array_push( $args, array ( __( 'Mobile', WPS_TEXT_DOMAIN ), admin_url( 'admin.php?page='.'__wps__mobile_menu' ), 'symposium_toolbar_mobile', 'symposium_toolbar_'.$slug, array( 'class' => 'symposium_toolbar_admin symposium_toolbar_admin_'.$slug ) ) ); 734 if ( get_option( WPS_OPTIONS_PREFIX.'__wps__mailinglist_activated' ) || get_option( WPS_OPTIONS_PREFIX.'__wps__mailinglist_network_activated' ) ) array_push( $args, array ( __( 'Reply', WPS_TEXT_DOMAIN ), admin_url( 'admin.php?page='.WPS_DIR.'/mailinglist_admin.php' ), 'symposium_toolbar_reply', 'symposium_toolbar_'.$slug, array( 'class' => 'symposium_toolbar_admin symposium_toolbar_admin_'.$slug ) ) ); 735 if ( get_option( WPS_OPTIONS_PREFIX.'__wps__lounge_main_activated' ) || get_option( WPS_OPTIONS_PREFIX.'__wps__lounge_main_network_activated' ) ) array_push( $args, array ( __( 'Lounge', WPS_TEXT_DOMAIN ), admin_url( 'admin.php?page='.WPS_DIR.'/lounge_admin.php' ), 'symposium_toolbar_lounge', 'symposium_toolbar_'.$slug, array( 'class' => 'symposium_toolbar_admin symposium_toolbar_admin_'.$slug ) ) ); 736 } 737 if ( $hidden && ( $symposium_toolbar_admin_menu_item[0] == __( 'Manage', WPS_TEXT_DOMAIN ) ) ) { 738 array_push( $args, array ( __( 'Settings', WPS_TEXT_DOMAIN ), admin_url( 'admin.php?page='.'symposium_settings' ), 'symposium_toolbar_settings', 'symposium_toolbar_'.$slug, array( 'class' => 'symposium_toolbar_admin symposium_toolbar_admin_'.$slug ) ) ); 739 array_push( $args, array ( __( 'Advertising', WPS_TEXT_DOMAIN ), admin_url( 'admin.php?page='.'symposium_advertising' ), 'symposium_toolbar_advertising', 'symposium_toolbar_'.$slug, array( 'class' => 'symposium_toolbar_admin symposium_toolbar_admin_'.$slug ) ) ); 740 array_push( $args, array ( __( 'Thesaurus', WPS_TEXT_DOMAIN ), admin_url( 'admin.php?page='.'symposium_thesaurus' ), 'symposium_toolbar_thesaurus', 'symposium_toolbar_'.$slug, array( 'class' => 'symposium_toolbar_admin symposium_toolbar_admin_'.$slug ) ) ); 741 if ( get_option( WPS_OPTIONS_PREFIX.'__wps__forum_activated' ) || get_option( WPS_OPTIONS_PREFIX.'__wps__forum_network_activated' ) ) array_push( $args, array ( __( 'Categories', WPS_TEXT_DOMAIN ), admin_url( 'admin.php?page='.'symposium_categories' ), 'symposium_toolbar_categories', 'symposium_toolbar_'.$slug, array( 'class' => 'symposium_toolbar_admin symposium_toolbar_admin_'.$slug ) ) ); 742 if ( get_option( WPS_OPTIONS_PREFIX.'__wps__forum_activated' ) || get_option( WPS_OPTIONS_PREFIX.'__wps__forum_network_activated' ) ) array_push( $args, array ( __( 'Forum Posts', WPS_TEXT_DOMAIN ), admin_url( 'admin.php?page='.'symposium_moderation' ), 'symposium_toolbar_forum_posts', 'symposium_toolbar_'.$slug, array( 'class' => 'symposium_toolbar_admin symposium_toolbar_admin_'.$slug ) ) ); 743 if ( get_option( WPS_OPTIONS_PREFIX.'__wps__mail_activated' ) || get_option( WPS_OPTIONS_PREFIX.'__wps__mail_network_activated' ) ) array_push( $args, array ( __( 'Mail Messages', WPS_TEXT_DOMAIN ), admin_url( 'admin.php?page='.'__wps__mail_messages_menu' ), 'symposium_toolbar_mail_messages', 'symposium_toolbar_'.$slug, array( 'class' => 'symposium_toolbar_admin symposium_toolbar_admin_'.$slug ) ) ); 744 array_push( $args, array ( __( 'Templates', WPS_TEXT_DOMAIN ), admin_url( 'admin.php?page='.'symposium_templates' ), 'symposium_toolbar_templates', 'symposium_toolbar_'.$slug, array( 'class' => 'symposium_toolbar_admin symposium_toolbar_admin_'.$slug ) ) ); 745 if ( get_option( WPS_OPTIONS_PREFIX.'_audit' ) ) array_push( $args, array ( __( 'Audit', WPS_TEXT_DOMAIN ), 'symposium_audit', 'symposium_toolbar_audit', 'symposium_toolbar_'.$slug, array( 'class' => 'symposium_toolbar_admin symposium_toolbar_admin_'.$slug ) ) ); 746 } 747 } 748 749 // Now, draw the menu itself 750 if ( $args ) foreach ( $args as $symposium_toolbar_admin_menu_item ) { 751 $args = array( 752 'title' => $symposium_toolbar_admin_menu_item[0], 753 'href' => $symposium_toolbar_admin_menu_item[1], 754 'id' => $symposium_toolbar_admin_menu_item[2], 755 'parent' => $symposium_toolbar_admin_menu_item[3], 756 'meta' => $symposium_toolbar_admin_menu_item[4] 757 ); 758 $wp_admin_bar->add_node( $args ); 700 global $wp_admin_bar; 701 702 if ( is_admin_bar_showing() && current_user_can( 'manage_options' ) && ( get_option( 'wpst_wps_admin_menu', 'on' ) == "on" ) ) { 703 704 $symposium_toolbar_admin_menu_args = get_option( 'wpst_tech_wps_admin_menu', array() ); 705 706 if ( $symposium_toolbar_admin_menu_args ) foreach ( $symposium_toolbar_admin_menu_args as $args ) { 707 $symposium_toolbar_admin_menu_item = array( 708 'title' => $args[0], 709 'href' => $args[1], 710 'id' => $args[2], 711 'parent' => $args[3], 712 'meta' => $args[4] 713 ); 714 $wp_admin_bar->add_node( $symposium_toolbar_admin_menu_item ); 715 } 759 716 } 760 717 } … … 861 818 862 819 // Add Group 863 if ( !empty( $share ) ) {820 /* if ( !empty( $share ) ) { 864 821 $args = array( 865 822 'id' => 'symposium-toolbar-share', … … 868 825 'meta' => array( 'class' => 'symposium-toolbar-social-icon symposium-toolbar-share' ) 869 826 ); 870 $wp_admin_bar->add_ node( $args );827 $wp_admin_bar->add_group( $args ); 871 828 $parent = 'symposium-toolbar-share'; 872 } 829 } /* */ 873 830 874 831 // LinkedIn
Note: See TracChangeset
for help on using the changeset viewer.