Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/06/2012 04:24:22 AM (13 years ago)
Author:
johnjamesjacoby
Message:

Admin Audit:

  • Introduce bp_is_network_activated() to tell if BuddyPress is active at a network level.
  • Use bp_is_network_activated() in places where multiblog or single-site activation might mistakingly link to the incorrect site/network admin.
  • Add phpdoc to bp_is_multiblog_mode() to further explain why it exists, and why you should not use it.
  • Audit usage of network_admin_url() and admin_url(), and replace with bp_get_admin_url() where appropriate.
  • Escape some admin URL usages; maybe more to do here.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-classes.php

    r6259 r6310  
    877877 */
    878878class BP_Button {
    879     // Button properties
     879
     880    /** Button properties *****************************************************/
    880881
    881882    /**
     
    884885     * @var integer
    885886     */
    886     var $id;
     887    private $id = '';
    887888
    888889    /**
     
    891892     * @var string
    892893     */
    893     var $component;
     894    private $component = 'core';
    894895
    895896    /**
     
    898899     * @var boolean
    899900     */
    900     var $must_be_logged_in;
    901 
    902     /**
    903      * True or false if the button should not be displayed while viewing your own profile.
     901    private $must_be_logged_in = true;
     902
     903    /**
     904     * True or false if the button should not be displayed while viewing your
     905     * own profile.
    904906     *
    905907     * @var boolean
    906908     */
    907     var $block_self;
    908 
    909 
    910     // Wrapper
     909    private $block_self = true;
     910
     911    /** Wrapper ***************************************************************/
    911912
    912913    /**
     
    916917     * @var mixed div|span|p|li, or false for no wrapper
    917918     */
    918     var $wrapper;
     919    private $wrapper = 'div';
    919920
    920921    /**
     
    923924     * @var string
    924925     */
    925     var $wrapper_class;
     926    private $wrapper_class = '';
    926927
    927928    /**
     
    930931     * @var string
    931932     */
    932     var $wrapper_id;
    933 
    934 
    935     // Button
     933    private $wrapper_id = '';
     934
     935    /** Button ****************************************************************/
    936936
    937937    /**
     
    940940     * @var string
    941941     */
    942     var $link_href;
     942    private $link_href = '';
    943943
    944944    /**
     
    947947     * @var string
    948948     */
    949     var $link_class;
     949    private $link_class = '';
    950950
    951951    /**
     
    954954     * @var string
    955955     */
    956     var $link_id;
     956    private $link_id = '';
    957957
    958958    /**
     
    961961     * @var string
    962962     */
    963     var $link_rel;
     963    private $link_rel = '';
    964964
    965965    /**
     
    968968     * @var string
    969969     */
    970     var $link_title;
     970    private $link_title = '';
    971971
    972972    /**
     
    975975     * @var string
    976976     */
    977     var $link_text;
    978 
    979 
    980     // HTML result
    981 
    982     var $contents;
    983 
    984     /**
    985      * bp_button()
    986      *
     977    private $link_text = '';
     978
     979    /** HTML result ***********************************************************/
     980
     981    public $contents = '';
     982
     983    /**
    987984     * Builds the button based on passed parameters:
    988985     *
     
    10031000     * @return bool False if not allowed
    10041001     */
    1005     function __construct( $args = '' ) {
    1006 
    1007         // Default arguments
    1008         $defaults = array(
    1009             'id'                => '',
    1010             'component'         => 'core',
    1011             'must_be_logged_in' => true,
    1012             'block_self'        => true,
    1013 
    1014             'wrapper'           => 'div',
    1015             'wrapper_id'        => '',
    1016             'wrapper_class'     => '',
    1017 
    1018             'link_href'         => '',
    1019             'link_title'        => '',
    1020             'link_id'           => '',
    1021             'link_class'        => '',
    1022             'link_rel'          => '',
    1023             'link_text'         => '',
    1024         );
    1025 
    1026         $r = wp_parse_args( $args, $defaults );
     1002    public function __construct( $args = '' ) {
     1003
     1004        $r = wp_parse_args( $args, get_class_vars( __CLASS__ ) );
    10271005        extract( $r, EXTR_SKIP );
    10281006
     
    11011079
    11021080    /**
    1103      * contents()
    1104      *
    11051081     * Return contents of button
    11061082     *
    11071083     * @return string
    11081084     */
    1109     function contents() {
     1085    public function contents() {
    11101086        return $this->contents;
    11111087    }
    11121088
    11131089    /**
    1114      * display()
    1115      *
    11161090     * Output contents of button
    11171091     */
    1118     function display() {
     1092    public function display() {
    11191093        if ( !empty( $this->contents ) )
    11201094            echo $this->contents;
Note: See TracChangeset for help on using the changeset viewer.