Skip to:
Content

bbPress.org

Changeset 3829


Ignore:
Timestamp:
03/31/2012 07:22:29 AM (14 years ago)
Author:
johnjamesjacoby
Message:

PHP5'ize bbp-core-classes.php.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/plugin/bbp-includes/bbp-core-classes.php

    r3828 r3829  
    5353    var $current_id;
    5454
     55
     56    /** Methods ***************************************************************/
    5557
    5658    /**
     
    6971     * @uses BBP_Component::setup_actions() Setup the hooks and actions
    7072     */
    71     function BBP_Component( $args = '' ) {
     73    public function __construct( $args = '' ) {
    7274        if ( empty( $args ) )
    7375            return;
     
    8789     * @uses apply_filters() Calls 'bbp_{@link BBP_Component::name}_slug'
    8890     */
    89     function setup_globals( $args = '' ) {
     91    private function setup_globals( $args = '' ) {
    9092        $this->name = $args['name'];
    9193        $this->id   = apply_filters( 'bbp_' . $this->name . '_id',   $args['id']   );
     
    101103     * @uses do_action() Calls 'bbp_{@link BBP_Component::name}includes'
    102104     */
    103     function includes() {
     105    private function includes() {
    104106        do_action( 'bbp_' . $this->name . 'includes' );
    105107    }
     
    115117     *                    'bbp_{@link BBP_Component::name}setup_actions'
    116118     */
    117     function setup_actions() {
     119    private function setup_actions() {
    118120        add_action( 'bbp_register_post_types',    array( $this, 'register_post_types'    ), 10, 2 ); // Register post types
    119121        add_action( 'bbp_register_taxonomies',    array( $this, 'register_taxonomies'    ), 10, 2 ); // Register taxonomies
     
    132134     * @uses do_action() Calls 'bbp_{@link BBP_Component::name}_register_post_types'
    133135     */
    134     function register_post_types() {
     136    public function register_post_types() {
    135137        do_action( 'bbp_' . $this->name . '_register_post_types' );
    136138    }
     
    143145     * @uses do_action() Calls 'bbp_{@link BBP_Component::name}_register_taxonomies'
    144146     */
    145     function register_taxonomies() {
     147    public function register_taxonomies() {
    146148        do_action( 'bbp_' . $this->name . '_register_taxonomies' );
    147149    }
     
    154156     * @uses do_action() Calls 'bbp_{@link BBP_Component::name}_add_rewrite_tags'
    155157     */
    156     function add_rewrite_tags() {
     158    public function add_rewrite_tags() {
    157159        do_action( 'bbp_' . $this->name . '_add_rewrite_tags' );
    158160    }
     
    165167     * @uses do_action() Calls 'bbp_{@link BBP_Component::name}_generate_rewrite_rules'
    166168     */
    167     function generate_rewrite_rules( $wp_rewrite ) {
     169    public function generate_rewrite_rules( $wp_rewrite ) {
    168170        do_action_ref_array( 'bbp_' . $this->name . '_generate_rewrite_rules', $wp_rewrite );
    169171    }
     
    183185 */
    184186class BBP_Walker_Forum extends Walker {
     187
    185188    /**
    186189     * @see Walker::$tree_type
     
    201204    var $db_fields = array( 'parent' => 'post_parent', 'id' => 'ID' );
    202205
     206    /** Methods ***************************************************************/
     207
    203208    /**
    204209     * Set the tree_type
     
    206211     * @since bbPress (r2514)
    207212     */
    208     function BBP_Walker_Forum() {
     213    public function __construct() {
    209214        $this->tree_type = bbp_get_forum_post_type();
    210215    }
     
    219224     * @param int $depth Depth of page. Used for padding.
    220225     */
    221     function start_lvl( &$output, $depth ) {
     226    public function start_lvl( &$output, $depth ) {
    222227        $indent  = str_repeat( "\t", $depth );
    223228        $output .= "\n$indent<ul class='children'>\n";
     
    233238     * @param int $depth Depth of page. Used for padding.
    234239     */
    235     function end_lvl( &$output, $depth ) {
     240    public function end_lvl( &$output, $depth ) {
    236241        $indent  = str_repeat( "\t", $depth );
    237242        $output .= "$indent</ul>\n";
     
    250255     * @param array $args
    251256     */
    252     function start_el( &$output, $forum, $depth, $args, $current_forum ) {
     257    public function start_el( &$output, $forum, $depth, $args, $current_forum ) {
    253258
    254259        $indent = $depth ? str_repeat( "\t", $depth ) : '';
     
    291296     * @param int $depth Depth of page. Not Used.
    292297     */
    293     function end_el( &$output, $forum, $depth ) {
     298    public function end_el( &$output, $forum, $depth ) {
    294299        $output .= "</li>\n";
    295300    }
     
    306311 */
    307312class BBP_Walker_Dropdown extends Walker {
     313
    308314    /**
    309315     * @see Walker::$tree_type
     
    324330    var $db_fields = array( 'parent' => 'post_parent', 'id' => 'ID' );
    325331
     332    /** Methods ***************************************************************/
     333
    326334    /**
    327335     * Set the tree_type
     
    329337     * @since bbPress (r2746)
    330338     */
    331     function BBP_Walker_Dropdown() {
     339    public function __construct() {
    332340        $this->tree_type = bbp_get_forum_post_type();
    333341    }
     
    352360     *                        title, output, post, depth and args
    353361     */
    354     function start_el( &$output, $_post, $depth, $args ) {
     362    public function start_el( &$output, $_post, $depth, $args ) {
    355363        $pad     = str_repeat( '&nbsp;', $depth * 3 );
    356364        $output .= "\t<option class=\"level-$depth\"";
Note: See TracChangeset for help on using the changeset viewer.