Ticket #2508: 2508 _2.patch

File 2508 _2.patch, 3.3 KB (added by Artur Formella, 16 years ago)
  • FCKeditorParser.body.php

     
    153153         * @private
    154154         */
    155155        function strip( $text, $state, $stripcomments = false , $dontstrip = array () ) {
    156                 global $wgContLang, $wgUseTeX, $wgScriptPath;
     156                global $wgContLang, $wgUseTeX, $wgScriptPath, $showRef;
    157157
    158158                wfProfileIn( __METHOD__ );
    159159                $render = ($this->mOutputType == OT_HTML);
     
    166166                $elements = array_merge(
    167167                array( 'nowiki', 'gallery', 'math' ),
    168168                array_keys( $this->mTagHooks ) );
     169                if ((isset ($wgHooks['ParserFirstCallInit']) && (in_array('wfCite',$wgHooks['ParserFirstCallInit']) ))
     170                        || (isset ($wgExtensionFunctions) && (in_array('wfCite',$wgExtensionFunctions) ))){
     171                        $elements = array_merge( $elements, array( 'ref', 'references' ) );
     172                }
    169173                global $wgRawHtml;
    170174                if( $wgRawHtml ) {
    171175                        $elements[] = 'html';
     
    177181                        unset ( $elements[$k] );
    178182                }
    179183
     184                $elements = array_unique($elements);   
    180185                $matches = array();
    181186                $text = Parser::extractTagsAndParams( $elements, $text, $matches, $uniq_prefix );
    182187
     
    196201                                                        $output = "$tag-->";
    197202                                                }
    198203                                                break;
     204                                        case 'references':
     205                                                        $output = $this->fck_wikiTag('references', $content, $params);
     206                                                break;
     207                                        case 'ref':
     208                                                        $output = $this->fck_wikiTag('ref', $content, $params);
     209                                                break;
    199210                                        case 'html':
    200211                                                if( $wgRawHtml ) {
    201212                                                        $output = $this->fck_wikiTag('html', $content, $params);
  • mw12/FCKeditorParser_OldPP.body.php

     
    154154         * @private
    155155         */
    156156        function strip( $text, $state, $stripcomments = false , $dontstrip = array () ) {
    157                 global $wgContLang, $wgUseTeX, $wgScriptPath;
     157                global $wgContLang, $wgUseTeX, $wgScriptPath, $wgHooks;
    158158
    159159                wfProfileIn( __METHOD__ );
    160160                $render = ($this->mOutputType == OT_HTML);
     
    165165                $generalItems = array();
    166166
    167167                $elements = array_merge(
    168                 array( 'nowiki', 'gallery', 'math' ),
    169                 array_keys( $this->mTagHooks ) );
     168                array( 'nowiki', 'gallery', 'math' ),   
     169                array_keys( $this->mTagHooks ) );               
     170                if ((isset ($wgHooks['ParserFirstCallInit']) && (in_array('wfCite',$wgHooks['ParserFirstCallInit']) ))
     171                        || (isset ($wgExtensionFunctions) && (in_array('wfCite',$wgExtensionFunctions) ))){
     172                        $elements = array_merge( $elements, array( 'ref', 'references' ) );
     173                }
    170174                global $wgRawHtml;
    171175                if( $wgRawHtml ) {
    172176                        $elements[] = 'html';
     
    178182                        unset ( $elements[$k] );
    179183                }
    180184
     185                $elements = array_unique($elements);   
    181186                $matches = array();
    182187                $text = self::extractTagsAndParams( $elements, $text, $matches, $uniq_prefix );
    183188
     
    197202                                                        $output = "$tag-->";
    198203                                                }
    199204                                                break;
     205                                        case 'references':
     206                                                        $output = $this->fck_wikiTag('references', $content, $params);
     207                                                break;
     208                                        case 'ref':
     209                                                        $output = $this->fck_wikiTag('ref', $content, $params);
     210                                                break;
    200211                                        case 'html':
    201212                                                if( $wgRawHtml ) {
    202213                                                        $output = $this->fck_wikiTag('html', $content, $params);
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy