Plugin Directory

Changeset 862478


Ignore:
Timestamp:
02/21/2014 05:29:32 PM (12 years ago)
Author:
AlphaGolf_fr
Message:

Update the trunk with a pre-0.27 / build 2642

Location:
wp-symposium-toolbar/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • wp-symposium-toolbar/trunk/css/wp-symposium-toolbar_admin.css

    r852789 r862478  
    1616
    1717/**
    18  * Default WP Icons
     18 * Default Toolbar Height
    1919 */
    2020
    2121@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    }
    3425}
    3526
     
    8778    font-family: dashicons !important;
    8879    content: '\f319';
    89 }
    90 /*
    91 #wpadminbar .symposium-toolbar-social-icon > .ab-item:before {
    92     top: 0px;
    93 } /* */
     80    top: 2px;
     81}
    9482
    9583#wpadminbar #wp-admin-bar-symposium-toolbar-share-linkedin > .ab-item:before {
     
    392380}
    393381
     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
    394394/**
    395395 * Site Name Menu
  • wp-symposium-toolbar/trunk/js/wp-symposium-toolbar.js

    r851541 r862478  
    5757        // Get the current screen width
    5858        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();
    6062       
    6163        // Compute the total width of all tabs and set the container width
     
    187189        }
    188190       
    189         // Such fields are part of the definition of a font shadow
    190         // if ( $(this).hasClass( "wpst_font_shadow" ) ) {
    191            
    192             // If this contains a default value, add default class to all three
    193             // 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 three
    198             // } else {
    199                 // $(".wpst_font_shadow").removeClass( "wpst-has-default" );
    200             // }
    201        
    202191        // 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        }
    209195    });
    210196});
  • wp-symposium-toolbar/trunk/js/wp-symposium-toolbar_preview.js

    r852789 r862478  
    1515 */
    1616
    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    
    2217jQuery(document).ready(function($){
    2318
     
    5247   
    5348    // KEEPERS
    54    
    55     var wpstRgbColors = ( $("#wpadminbar").css("background-color").search("rgb") >= 0 );
    5649   
    5750    var wpstDefaultHeight = "32";
     
    9386   
    9487    var wpstFontSizeEmpty = "13px";
    95     var wpstIconSizeEmpty = "20";
     88    var wpstIconSizeEmpty = 20;
    9689    var wpstFontSizeSmallEmpty = "11px";
    9790    var wpstFontNormal = "normal";
    9891    var wpstFontNone = "none";
     92   
     93    var wpstRgbColors = ( $("#wpadminbar").css("background-color").search("rgb") >= 0 );
    9994   
    10095    // Determine gradient string from browser type
     
    108103    // Determine window width
    109104    document.body.style.overflow = "hidden";
     105    var wpadminbarHeight = $( "#wpadminbar" ).height();
    110106    var wpadminbarWidth = $( "#wpadminbar" ).width();
    111107    document.body.style.overflow = "";
     
    119115            update_tb_height();
    120116            update_tb_background();
     117            update_tb_icon_margin();
    121118        }
    122119    });
     
    205202        if ( wpadminbarWidth < 783 ) return;
    206203       
    207         // Toolbar Height
     204        // vars
    208205        var tbHeight = ( $('#wpst_height').val() != "" ) ? $('#wpst_height').val() : wpstDefaultHeight;
    209         var tbPaddingTop = 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
    213210        $("#wpadminbar").css( "height", tbHeight + "px" );
    214211        $("#wpadminbar").find(".quicklinks").css( "height", tbHeight + "px" );
    215212        $("#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" );
    218213        $("#wpadminbar").find(".quicklinks > ul > li").css( "height", tbHeight + "px" );
    219214        $("#wpadminbar").find(".shortlink-input").css( "height", tbHeight + "px" );
     
    221216        $("#wpadminbar").find(".ab-top-menu > .menupop > .ab-sub-wrapper").css( "top", tbHeight + "px" );
    222217        $("#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       
    233221        $("#wpadminbar").find(".quicklinks > ul > li > a").css( "height", tbHeight + "px" );
    234222        $("#wpadminbar").find(".quicklinks > ul > li > .ab-item").css( "height", tbHeight + "px" );
    235223        $("#wpadminbar").find(".quicklinks > ul > li > a span").css( "height", tbHeight + "px" );
    236224        $("#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" );
    238227       
    239228        // JetPack Notes
     
    241230        if ( notes ) {
    242231            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");
    249237        else {
    250238            var style = document.createElement('style');
    251             style.id = 'wpstLineHeight';
    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; } ';
    256244       
    257245        document.head.appendChild(style);
     
    302290            $(this).find("> .ab-item").css( "background-color", tbMainColor );
    303291            $(this).find("> .ab-item").css( "background-image", tbNormalImage );
    304         } );  //  if ( !$(this).is("focus") ) {
     292        } );
    305293    }
    306294   
     
    362350    }
    363351   
     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   
    364397    function update_tb_icon_size() {
    365398       
     399        // Non-responsive only
     400        if ( wpadminbarWidth < 783 ) return;
     401       
     402        var tbHeight = ( $('#wpst_height').val() != "" ) ? $('#wpst_height').val() : wpstDefaultHeight;
    366403        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        
    376404        var tbHoverIconSize = ( $('#wpst_hover_icon_size').val() !== "" ) ? ( parseInt( $('#wpst_hover_icon_size').val() ) ) : tbIconSize;
    377405        if ( ( tbIconSize > 0 ) && ( tbHoverIconSize > 0 ) ) {
    378             var tbScale = Math.round( ( tbHoverIconSize * 100 ) / tbIconSize ) / 100;
     406            var tbScale = Math.round( ( ( tbHoverIconSize * 100 ) / tbIconSize ) / 100 );
    379407            var tbTransform = 'transform:scale('+tbScale+'); -ms-transform:scale('+tbScale+'); -webkit-transform:scale('+tbScale+'); transition: all 0.25s; ';
    380408        } else
    381409            var tbTransform = 'transform:scale(1); -ms-transform:scale(1); -webkit-transform:scale(1); transition: all 0.25s; ';
    382410       
     411        // Put it where it should go
    383412        if ( document.getElementById("wpstIconSize") )
    384413            var style = document.getElementById("wpstIconSize");
     
    388417        }
    389418       
    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; } ';
    391420       
    392421        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; } ';
    397424       
    398425        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+' } ';
     
    402429   
    403430    function update_tb_font_size() {
     431       
     432        // Non-responsive only
     433        if ( wpadminbarWidth < 783 ) return;
    404434       
    405435        var tbFontSize = ( $('#wpst_font_size').val() !== "" ) ? $('#wpst_font_size').val() : wpstFontSizeEmpty;
     
    544574       
    545575        document.getElementsByTagName('head')[0].appendChild(style);
    546         // document.write(x.getElementsByTagName("wpstFontShadowColour")[0].nodeName);
    547576    }
    548577   
     
    661690            $(this).find(".blavatar").css( "color", menuMainColorExt );
    662691        }});
    663         //  if ( !$(this).is("focus") ) {
    664692       
    665693        // Arrows
     
    673701        style.innerHTML = '#wpadminbar .menupop .menupop > .ab-item:before { color: '+menuMainColor+'; } #wpadminbar .menupop .menupop > .ab-item { color: '+menuMainColor+'; } ';
    674702        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+'; } ';
    676703        style.innerHTML += '#wpadminbar .quicklinks .ab-sub-secondary > li > a > .blavatar { color: '+menuMainColorExt+'; } #wpadminbar .quicklinks .ab-sub-secondary > li > a > .blavatar:before { color: '+menuMainColorExt+'; } ';
    677704       
     
    679706        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+'; } ';
    680707        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+'; } ';
    682708       
    683709        document.head.appendChild(style);
     
    757783        $("#wpadminbar").css(shadow, tbShadow);
    758784        $("#wpadminbar").find(".ab-top-menu > .menupop > .ab-sub-wrapper").css(shadow, tbShadow);
    759         // $("#wpadminbar .menupop .ab-sub-wrapper").css(shadow, tbShadow);
    760785    }
    761786   
     
    765790    // Toolbar Height
    766791    $('#wpst_height').change(function() {
     792       
     793        // Non-responsive only
     794        if ( wpadminbarWidth < 783 ) return;
     795       
    767796        update_tb_height();
    768797        update_tb_background();
     798        update_tb_icon_margin();
    769799    });
    770800   
     
    858888    $('.wpst_icon_size').change(function() {
    859889       
    860         update_tb_icon_size()
     890        update_tb_height();
     891        update_tb_font_size();
     892        update_tb_icon_margin();
     893        update_tb_icon_size();
    861894    });
    862895   
  • wp-symposium-toolbar/trunk/readme.txt

    r853887 r862478  
    99Tested up to: 3.8.1
    1010Stable tag: 0.26.0
    11 Version: 0.26.32
     11Version: 0.26.42
    1212License: GPLv2 or later
    1313License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    124124
    125125* French translation by the author
    126 * Spanish translation by Maria Ramos, [WebHostingHub](http://www.webhostinghub.com/)
     126* Spanish translation by Maria Ramos at WebHostingHub
    127127
    128128= Icons =
     
    151151* Bugfix: in RTL, correct display for the User Menu
    152152* 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 Upon
     153* Change: WP 3.8, add the option to show social icons and share the site with: LinkedIn, Facebook, Twitter, Google Plus, Stumble Upon
    154154* 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
    155155* Change: Styles, implement default values shown & hidden via Javascript
    156156* Bugfix: Styles, preview mode, correct menu font colors in hover
    157157* 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
    159160
    160161= 0.26.0. =
  • wp-symposium-toolbar/trunk/wp-symposium-toolbar.php

    r853887 r862478  
    1111Tested up to: 3.8
    1212Stable tag: 0.26.0
    13 Version: 0.26.32
     13Version: 0.26.42
    1414License: GPLv2 or later
    1515License URI: http://www.gnu.org/licenses/gpl-2.0.html
    1616*/
    1717
     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   
    1823// Increase Build nr at each version
    1924global $wpst_buildnr;
    20 $wpst_buildnr = 2632;
     25$wpst_buildnr = 2642;
    2126
    2227
     
    213218       
    214219        // 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 )
    216224            return;
    217225       
     
    238246        $wpst_wpms_hidden_tabs = get_option( 'wpst_wpms_hidden_tabs', array() );
    239247        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 )
    241250            return;
    242251       
     
    257266    function symposium_toolbar_new_site_default( $blog_id, $user_id, $domain, $path, $site_id, $meta ) {
    258267       
     268        // Hidden tabs
     269        $wpst_wpms_hidden_tabs_all = get_option( 'wpst_wpms_hidden_tabs_all', array() );
    259270        $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
    260275        $wpst_style_tb_current = get_option( 'wpst_style_tb_current', array() );
     276        $wpst_wpms_network_superadmin_menu = get_option( 'wpst_wpms_network_superadmin_menu', "" );
    261277       
    262278        switch_to_blog( $blog_id );
    263279       
    264         // Set globals
     280        // Set globals locally
    265281        symposium_toolbar_init_globals();
    266282       
     
    268284        symposium_toolbar_activate();
    269285       
    270         // Update new site options with Main Site options
     286        // Update new site settings with Main Site settings
    271287        symposium_toolbar_update();
    272288        if ( $hidden_tabs ) foreach( $hidden_tabs as $tab ) {
     
    274290        }
    275291        update_option( 'wpst_wpms_hidden_tabs', $hidden_tabs );
     292        update_option( 'wpst_wpms_network_superadmin_menu', $wpst_wpms_network_superadmin_menu );
    276293       
    277294        // Update CSS based on stored styles and installed plugins
  • wp-symposium-toolbar/trunk/wp-symposium-toolbar_admin.php

    r853887 r862478  
    518518                echo '<td>';
    519519                    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>';
    521520                    echo symposium_toolbar_add_roles_to_item( 'display_my_sites', get_option( 'wpst_toolbar_my_sites', $wpst_roles_administrator ), $wpst_roles_administrator );
    522521                echo '</td>';
     
    10921091                   
    10931092                    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                        }
    10991100                    }
    11001101                    echo '/><span class="description wpst-checkbox"> ' . __( 'LinkedIn', 'wp-symposium-toolbar' ) . '</span><br />';
    11011102                   
    11021103                    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                        }
    11081111                    }
    11091112                    echo '/><span class="description wpst-checkbox"> ' . __( 'Facebook', 'wp-symposium-toolbar' ) . '</span><br />';
    11101113                   
    11111114                    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                        }
    11171122                    }
    11181123                    echo '/><span class="description wpst-checkbox"> ' . __( 'Twitter', 'wp-symposium-toolbar' ) . '</span><br />';
    11191124                   
    11201125                    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                        }
    11261133                    }
    11271134                    echo '/><span class="description wpst-checkbox"> ' . __( 'Google Plus', 'wp-symposium-toolbar' ) . '</span><br />';
    11281135                   
    11291136                    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                        }
    11351144                    }
    11361145                    echo '/><span class="description wpst-checkbox"> ' . __( 'StumbleUpon', 'wp-symposium-toolbar' ) . '</span><br />';
     
    12351244function symposium_toolbar_admintab_styles() {
    12361245
    1237     global $wp_version, $wpst_default_toolbar;
     1246    global $wp_version;
    12381247   
    12391248    // Get data to show
     
    12421251    $wpst_all_borders = array( "none", "dotted", "dashed", "solid", "double" );
    12431252   
     1253    // Init default Toolbar style
     1254    $wpst_default_toolbar = symposium_toolbar_init_default_toolbar();
     1255   
    12441256    // Get current style
    12451257    $wpst_style_tb_current = maybe_unserialize( get_option( 'wpst_style_tb_current', array() ) );
    1246    
    1247     // Make sure globals are actually initialized
    1248     if ( !isset( $wpst_default_toolbar['height'] ) ) symposium_toolbar_init_default_toolbar();
    12491258   
    12501259    $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  
    7878 *
    7979 * @param  none
    80  * @return none
     80 * @return (array)$wpst_default_toolbar
    8181 */
    8282 function symposium_toolbar_init_default_toolbar() {
    8383
    84     global $wp_version, $wpst_default_toolbar;
     84    global $wp_version;
    8585   
    8686    // Build the array of default values for the Toolbar, based on WP Version
     
    174174        $wpst_default_toolbar['shadow_spread'] = "0";
    175175    }
     176   
     177    return $wpst_default_toolbar;
    176178}
    177179
     
    307309    }
    308310   
    309     if ( get_option( 'wpst_tech_buildnr', 0 ) < 2628 ) {
     311    if ( get_option( 'wpst_tech_buildnr', 0 ) < 2642 ) {
    310312       
    311313        // Update CSS based on stored styles and installed plugins
    312314        $wpst_style_tb_current = get_option( 'wpst_style_tb_current', array() );
    313315        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' );
    319316    }
    320317   
     
    412409        $unserialized_custom_menus = maybe_unserialize( $wpst_main_site_select[0]["option_value"] );
    413410        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;
    415412        }
    416413        $wpst_main_site_options[ "wpst_custom_menus" ] = serialize( $non_network_custom_menus );
     
    459456    global $wpdb, $current_screen, $wp_version;
    460457    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;
    462458   
    463459    // Make sure we're at the plugin options page, and only this one - this should simply confirm what this function is hooked to
     
    466462   
    467463    // 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();
    469465   
    470466    // Check for activated/deactivated WPS features, the $_POST['__wps__installation_update'] means WPS is activated
     
    704700                                $_POST['display_custom_menu_slug'][$key],
    705701                                $_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(),
    707703                                filter_var( trim ( $_POST['display_custom_menu_icon'][$key] ), FILTER_SANITIZE_URL ),
    708704                                ( is_multisite() && is_main_site() ) ? ( isset( $_POST['display_custom_menu_network_'.$key] ) ) : false
     
    748744                $share['twitter'] = isset( $_POST["share_twitter"] ) ? 'on' : '';
    749745                $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' : '';
    751747                $share['stumbleupon'] = isset( $_POST["share_stumbleupon"] ) ? 'on' : '';
    752748                update_option( 'wpst_share_icons', $share );
     
    11911187            // See if the admin has imported settings using the textarea, to update them one by one
    11921188            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 ) );
    11941191            }
    11951192           
     
    14281425                            if ( $option_name == 'wpst_style_tb_current' ) {
    14291426                                if ( is_array( $option_value ) ) {
    1430                                     (bool)$update_me = true;
     1427                                    (bool)$stop_updating_me = false;
    14311428                                    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;
    14341431                                            break;
    14351432                                        }
    14361433                                    }
    1437                                     if ( $update_me ) {
     1434                                    if ( !$stop_updating_me ) {
    14381435                                        $wpst_style_tb_current = array_diff_assoc( $option_value, $wpst_default_toolbar );
    14391436                                        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 ) );
    14421437                                    } 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 />';
    14441439                                } else
    14451440                                    $wpst_failed .= $option_name.__( ': incorrect format, an array was expected', 'wp-symposium-toolbar' ).'<br />';
     
    14791474        // Post update cleaning tasks
    14801475       
    1481         // Update Styles according to above settings
    1482         if ( isset( $wpst_style_tb_current ) ) update_option( 'wpst_tech_style_to_header', symposium_toolbar_update_styles( $wpst_style_tb_current ) );
    1483        
    14841476        // Re-generate WPS Admin Menu upon saving from WPST Options page
    14851477        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 ) );
    14861481       
    14871482        // Network Toolbar: Super Admin, Multisite, Main Site and network activated
     
    15921587function symposium_toolbar_update_styles( $wpst_style_tb_current, $blog_id = "1" ) {
    15931588
    1594     global $wp_version, $wpst_default_toolbar;
     1589    global $wp_version;
    15951590   
    15961591    $style_saved = "";
     
    16011596   
    16021597    // Init default Toolbar style
    1603     symposium_toolbar_init_default_toolbar();
     1598    $wpst_default_toolbar = symposium_toolbar_init_default_toolbar();
    16041599   
    16051600    // Toolbar Height
    16061601    $height = ( isset( $wpst_style_tb_current['height'] ) ) ? $wpst_style_tb_current['height'] : $wpst_default_toolbar['height'] ;
    16071602    if ( $height == 0 ) $height = $wpst_default_toolbar['height'];
    1608     $padding_top = 0;
     1603    $padding_top = 0;  // Needed by JetPack, below
    16091604   
    16101605    if ( $height != $wpst_default_toolbar['height'] ) {
     
    16241619        } else {
    16251620            $margin_top = $height - $wpst_default_toolbar['height'];
    1626             $padding_top = round( $margin_top /2 );  // Needed by JetPack, below
     1621            $padding_top = round( $margin_top /2 );
    16271622           
    16281623            $style_chunk = 'height: '.$height.'px; ';
     
    16341629           
    16351630            $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; } ';
    16371632            $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 } ';
    16391633            $style_saved .= '} ';
    16401634        }
    16411635   
    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    }
    16491637   
    16501638    // Toolbar - Background
     
    18671855            }
    18681856        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.'} ';
    18701859       
    18711860        // Add icon colour as border to Toolbar Avatar
     
    18731862            $style_saved .= '#wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar > a img { ' . $border_color . $background_color . $box_shadow . '} ';
    18741863       
     1864        // Add icon size to icons
    18751865        $icon_size = ( isset( $wpst_style_tb_current['icon_size'] ) ) ? $wpst_style_tb_current['icon_size'] : $wpst_default_toolbar['icon_size'] ;
    18761866        if ( isset( $wpst_style_tb_current['icon_size'] ) )
     
    18791869               
    18801870                // 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                }
    18821878               
    18831879                // Resize WP Logo
     
    18851881               
    18861882                // 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 .= '} ';
    18911886            }
    1892                
     1887       
    18931888        // Add paddings to icons as needed
    18941889        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
    19001915            } 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                }
    19031933            }
    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; } ';
    19111969           
    19121970            $style_saved .= '} ';
    1913            
    1914             // Add height and margin to Search fonticon
    1915             $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; } ';
    19191977   
    19201978    // 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
    19361991    if ( $box_shadow != '' )
    19371992        $style_saved .= '#wpadminbar #adminbarsearch .adminbar-input:focus { ' . $box_shadow . '} ';
    19381993   
    1939     // JetPack
    1940     // Correct some paddings for its Toolbar items
     1994    // JetPack - Correct some paddings for its Toolbar items
    19411995    if ( is_multisite() )
    19421996        (bool)$jetpack_is_active = ( is_plugin_active_for_network( 'jetpack/jetpack.php' ) || is_plugin_active( 'jetpack/jetpack.php' ) );
     
    19842038   
    19852039    // Hover Toolbar - Background plain colour only
     2040    $style_chunk = "";
     2041    $style_chunk_tablet = "";
    19862042    if ( $linear_gradient == '' ) {
    19872043        if ( $background_colour != $wpst_default_toolbar['hover_background_colour'] ) {
     
    21112167            }
    21122168       
    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'];
    21162173                $icon_color = 'color: '.$wpst_hover_icon_colour.'; ';
    21172174                $border_color = 'border-'.$icon_color;
     
    21582215        $style_chunk .= 'font-family: ' . trim( $wpst_font_clean, ',' ) . '; ';
    21592216    }
    2160    
    2161     // Font family for display name
    2162     // 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, ',' ) . ' } ';
    21642217   
    21652218    // Font Size
     
    24262479
    24272480/**
     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 */
     2498function 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/**
    24282550 * Check that an array of roles is actually an array of roles of the site
    24292551 * 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  
    698698function symposium_toolbar_symposium_admin() {
    699699   
    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        }
    759716    }
    760717}
     
    861818   
    862819    // Add Group
    863     if ( !empty( $share ) ) {
     820/*  if ( !empty( $share ) ) {
    864821        $args = array(
    865822            'id' => 'symposium-toolbar-share',
     
    868825            'meta' => array( 'class' => 'symposium-toolbar-social-icon symposium-toolbar-share' )
    869826        );
    870         $wp_admin_bar->add_node( $args );
     827        $wp_admin_bar->add_group( $args );
    871828        $parent = 'symposium-toolbar-share';
    872     }
     829    } /* */
    873830   
    874831    // LinkedIn
Note: See TracChangeset for help on using the changeset viewer.