Plugin Directory

Changeset 1453136


Ignore:
Timestamp:
07/12/2016 03:57:10 AM (10 years ago)
Author:
slushman
Message:

Updating version 0.3.

  • Fixed missing links issue.
  • Manually building each link since BuddyPress has deprecated the use of the globals.
  • Added buddybar-widget-component-menus action hook and hooked functions for each links view there.
  • Added class-public.php file for each links functions.
  • Removed reorder_array function. No longer needed.
  • Removed widget.php view file. No longer needed.
Location:
buddybar-widget/trunk
Files:
6 added
1 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • buddybar-widget/trunk/assets/css/widget.css

    r1355246 r1453136  
    1 #bbw-avatar{float:left;margin-right:0.5em;width:75px}#bbw-avatar img{height:75px;width:75px}.bbw-user-link{font-size:large;font-weight:bold;margin-bottom:0.5em}.bbw-module{display:inline-block;height:145px;list-style:none;margin-bottom:0.5em !important;vertical-align:top;width:50%}.bbw-module-title{font-size:medium;font-weight:bold}.bbw-module-link{margin:0;padding:0 1em 0 0 !important}#bbw-profile{height:85px;width:60%}
     1#bbw-avatar{float:left;margin-right:.5em;width:75px}#bbw-avatar img{height:75px;width:75px}.bbw-user-link{font-size:large;font-weight:bold;margin-bottom:.5em}.bbw-module{display:inline-block;height:145px;list-style:none;margin-bottom:.5em !important;vertical-align:top;width:49%}.bbw-module-title{font-size:medium;font-weight:bold}.bbw-module-link{margin:0;padding:0 1em 0 0 !important}#bbw-profile{height:85px;width:60%}
    22
    33/*# sourceMappingURL=widget.css.map */
  • buddybar-widget/trunk/assets/css/widget.css.map

    r1355246 r1453136  
    1 {"version":3,"sources":["widget.scss"],"names":[],"mappings":"AAIA,YACC,WACA,mBACA,UAAc,CAEd,gBACC,YACA,UAAa,CAIf,eACC,gBACA,iBACA,mBAhBc,CAmBf,YACC,qBACA,aACA,gBACA,+BACA,mBACA,SAAc,CAGf,kBACC,iBACA,gBAAkB,CAGnB,iBACC,SACA,4BAA8B,CAG/B,aACC,YACA,SAAY,CAAA","file":"widget.css"}
     1{"version":3,"sources":["widget.scss"],"names":[],"mappings":"AAIA,YACC,WACA,kBACA,UAAc,CAEd,gBACC,YACA,UAAa,CAIf,eACC,gBACA,iBACA,kBAhBc,CAmBf,YACC,qBACA,aACA,gBACA,8BACA,mBACA,SAAc,CAGf,kBACC,iBACA,gBAAkB,CAGnB,iBACC,SACA,4BAA8B,CAG/B,aACC,YACA,SAAY,CAAA","file":"widget.css"}
  • buddybar-widget/trunk/assets/css/widget.scss

    r1355246 r1453136  
    2626    margin-bottom   : $botmarg !important;
    2727    vertical-align  : top;
    28     width           : 50%;
     28    width           : 49%;
    2929}
    3030
  • buddybar-widget/trunk/buddybar-widget.php

    r1258609 r1453136  
    1212 * Plugin URI:        http://slushman.com/plugins/buddybar-widget
    1313 * Description:       The BuddyBar Widget places all the links on BuddyPress’s BuddyBar in a sidebar widget.
    14  * Version:           0.21
     14 * Version:           0.3
    1515 * Author:            Slushman
    1616 * Author URI:        http://slushman.com
     
    1818 * License URI:       http://www.gnu.org/licenses/gpl-0.2.txt
    1919 * Text Domain:       buddybar-widget
    20  * Domain Path:       /languages
     20 * Domain Path:       /assets/languages
    2121 */
    2222
     
    2828/**
    2929 * The code that runs during plugin activation.
    30  * This action is documented in includes/class-buddybar-widget-activator.php
     30 * This action is documented in classes/class-buddybar-widget-activator.php
    3131 */
    3232function activate_buddybar_widget() {
    33     require_once plugin_dir_path( __FILE__ ) . 'includes/class-buddybar-widget-activator.php';
     33    require_once plugin_dir_path( __FILE__ ) . 'classes/class-activator.php';
    3434    Buddybar_Widget_Activator::activate();
    3535}
     
    3737/**
    3838 * The code that runs during plugin deactivation.
    39  * This action is documented in includes/class-buddybar-widget-deactivator.php
     39 * This action is documented in classes/class-buddybar-widget-deactivator.php
    4040 */
    4141function deactivate_buddybar_widget() {
    42     require_once plugin_dir_path( __FILE__ ) . 'includes/class-buddybar-widget-deactivator.php';
     42    require_once plugin_dir_path( __FILE__ ) . 'classes/class-deactivator.php';
    4343    Buddybar_Widget_Deactivator::deactivate();
    4444}
     
    5151 * admin-specific hooks, and public-facing site hooks.
    5252 */
    53 require plugin_dir_path( __FILE__ ) . 'includes/class-buddybar-widget.php';
     53require plugin_dir_path( __FILE__ ) . 'classes/class-buddybar-widget.php';
    5454
    5555/**
  • buddybar-widget/trunk/classes/class-buddybar-widget.php

    r1355246 r1453136  
    8484        $this->set_locale();
    8585        $this->define_widget_hooks();
     86        $this->define_public_hooks();
    8687
    8788    } // __construct()
     
    128129        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'classes/class-widget.php';
    129130
     131        /**
     132         * The class responsible for defining all actions that occur in the public-facing
     133         * side of the site.
     134         */
     135        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'classes/class-public.php';
     136
    130137        $this->loader       = new Buddybar_Widget_Loader();
    131138        $this->sanitizer    = new BuddyBar_Widget_Sanitize();
     
    134141
    135142    /**
     143     * Register all of the hooks for public-facing functionality.
     144     *
     145     * @since       0.3
     146     * @access      private
     147     */
     148    private function define_public_hooks() {
     149
     150        $plugin_public = new Buddybar_Widget_Public();
     151
     152        $this->loader->action( 'buddybar-widget-component-menus', $plugin_public, 'add_component_menu_profile' );
     153        $this->loader->action( 'buddybar-widget-component-menus', $plugin_public, 'add_component_menu_activity' );
     154        $this->loader->action( 'buddybar-widget-component-menus', $plugin_public, 'add_component_menu_messages' );
     155        $this->loader->action( 'buddybar-widget-component-menus', $plugin_public, 'add_component_menu_friends' );
     156        $this->loader->action( 'buddybar-widget-component-menus', $plugin_public, 'add_component_menu_groups' );
     157
     158    } // define_public_hooks()
     159
     160    /**
    136161     * Register all of the hooks shared between public-facing and admin functionality
    137162     * of the plugin.
  • buddybar-widget/trunk/classes/class-widget.php

    r1355267 r1453136  
    3232    function __construct() {
    3333
    34         $this->widget_name          = 'buddybar_widget';
    35 
     34        $this->widget_name      = 'buddybar_widget';
    3635        $name                   = esc_html__( 'BuddyBar Widget', 'buddybar-widget' );
    3736        $opts['classname']      = '';
     
    9594        $widget_string  = '';
    9695        $widget_string .= $args['before_widget'];
     96
     97        /**
     98         * buddybar_widget_title filter hook
     99         */
    97100        $filtered       = apply_filters( 'buddybar_widget_title', $instance['title'] );
    98101        $title          = empty( $instance['title'] ) ? '' : $filtered;
     
    106109        ob_start();
    107110
     111        /**
     112         * buddybar_widget_wrap_before action hook
     113         */
    108114        do_action( 'buddybar_widget_wrap_before' );
    109115
    110116        if ( is_user_logged_in() ) {
    111117
    112             include( plugin_dir_path( __FILE__ ) . 'views/widget.php' );
     118            /**
     119             * buddybar-widget-component-menus action hook
     120             *
     121             * @hooked      add_component_menu_profile
     122             * @hooked      add_component_menu_activity
     123             * @hooked      add_component_menu_messages
     124             * @hooked      add_component_menu_friends
     125             * @hooked      add_component_menu_groups
     126             */
     127            do_action( 'buddybar-widget-component-menus' );
    113128
    114129        } else {
     
    118133        }
    119134
     135        /**
     136         * buddybar_widget_wrap_after action hook
     137         */
    120138        do_action( 'buddybar_widget_wrap_after' );
    121139
     
    161179    } // update()
    162180
    163     /**
    164      * Reorders the nav array
    165      *
    166      * @access  public
    167      * @since   0.2
    168      *
    169      * @return  array       The reordered array
    170      */
    171     private function reorder_array( $array ) {
    172 
    173         $temp = array();
    174         $keys = array(
    175             array( 'activity',  __( 'Activity', 'buddybar-widget' ) ),
    176             array( 'messages',  __( 'Messages', 'buddybar-widget' ) ),
    177             array( 'friends',   __( 'Friends', 'buddybar-widget' ) ),
    178             array( 'groups',    __( 'Groups', 'buddybar-widget' ) )
    179         );
    180 
    181         foreach ( $keys as $key ) {
    182 
    183             if ( key_exists( $key[0], $array ) ) {
    184 
    185                 $temp[$key[0]]      = $array[$key[0]];
    186                 $temp[$key[0]][0]   = $key[1];
    187 
    188             }
    189 
    190         } // foreach
    191 
    192         return $temp;
    193 
    194     } // reorder_array()
    195 
    196181} // class
Note: See TracChangeset for help on using the changeset viewer.