Skip to:
Content

bbPress.org


Ignore:
Timestamp:
08/27/2017 11:24:00 PM (8 years ago)
Author:
johnjamesjacoby
Message:

Converter: more OOP, specifically for the BBCode parser.

This change introduces a bbcode_parser_properties array to the base converter, allowing custom BBCode parser properties to be passed into the parent method via the child, minimizing the amount of code in each individual forum converter.

Trunk, for 2.6.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/admin/converters/XenForo.php

    r6573 r6670  
    2121     *
    2222     */
    23     function __construct() {
     23    public function __construct() {
    2424        parent::__construct();
    25         $this->setup_globals();
    2625    }
    2726
     
    3029     */
    3130    public function setup_globals() {
     31
     32        // Setup smiley URL & path
     33        $this->bbcode_parser_properties = array(
     34            'smiley_url' => false,
     35            'smiley_dir' => false
     36        );
    3237
    3338        /** Forum Section *****************************************************/
     
    722727
    723728    /**
    724      * Translate the forum status from XenForo numeric's to WordPress's strings.
     729     * Translate the forum status from XenForo numerics to WordPress's strings.
    725730     *
    726731     * @param int $status XenForo numeric forum status
     
    762767
    763768    /**
    764      * Translate the topic status from XenForo numeric's to WordPress's strings.
     769     * Translate the topic status from XenForo numerics to WordPress's strings.
    765770     *
    766771     * @param int $status XenForo numeric topic status
     
    782787
    783788    /**
    784      * Translate the topic sticky status type from XenForo numeric's to WordPress's strings.
     789     * Translate the topic sticky status type from XenForo numerics to WordPress's strings.
    785790     *
    786791     * @param int $status XenForo numeric forum type
     
    841846
    842847        // Parse out any bbCodes in $field with the BBCode 'parser.php'
    843         require_once bbpress()->admin->admin_dir . 'parser.php';
    844         $bbcode = BBCode::getInstance();
    845         $bbcode->enable_smileys = false;
    846         $bbcode->smiley_regex   = false;
    847         return html_entity_decode( $bbcode->Parse( $field ) );
     848        return parent::callback_html( $field );
    848849    }
    849850}
Note: See TracChangeset for help on using the changeset viewer.