r14922 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r14921‎ | r14922 | r14923 >
Date:04:56, 23 June 2006
Author:dale
Status:old
Tags:
Comment:
moved NS_MEDIA parse to enable matching of passed text param.
Modified paths:
  • /branches/embed_media/phase3/includes/Parser.php (modified) (history)

Diff [purge]

Index: branches/embed_media/phase3/includes/Parser.php
@@ -1493,7 +1493,7 @@
14941494
14951495 # Link not escaped by : , create the various objects
14961496 if( $noforce ) {
1497 -
 1497+ wfDebug("nofroce called: \n");
14981498 # Interwikis
14991499 if( $iw && $this->mOptions->getInterwikiMagic() && $nottalk && $wgContLang->getLanguageName( $iw ) ) {
15001500 $this->mOutput->addLanguageLink( $nt->getFullText() );
@@ -1521,7 +1521,27 @@
15221522 wfProfileOut( "$fname-image" );
15231523
15241524 }
 1525+
 1526+ if ( $ns == NS_MEDIA ) {
 1527+ wfDebug("USES my_NSmedia \n");
 1528+ wfProfileIn( "$fname-media" );
 1529+ # recursively parse links inside the media caption
 1530+ # actually, this will parse them in any other parameters, too,
 1531+ # but it might be hard to fix that, and it doesn't matter ATM
 1532+ $text = $this->replaceExternalLinks($text);
 1533+ $text = $this->replaceInternalLinks($text);
15251534
 1535+ # cloak any absolute URLs inside the media markup, so replaceExternalLinks() won't touch them
 1536+ $link = $sk->makeMediaLinkObj( $nt, $text );
 1537+ $s .= $prefix . $this->armorLinks( $link ) . $trail;
 1538+ $this->mOutput->addImage( $nt->getDBkey() );
 1539+
 1540+ wfProfileOut( "$fname-media" );
 1541+
 1542+ wfProfileOut( "$fname-media" );
 1543+ continue;
 1544+ }
 1545+
15261546 if ( $ns == NS_CATEGORY ) {
15271547 wfProfileIn( "$fname-category" );
15281548 $s = rtrim($s . "\n"); # bug 87
@@ -1558,13 +1578,7 @@
15591579 }
15601580
15611581 # Special and Media are pseudo-namespaces; no pages actually exist in them
1562 - if( $ns == NS_MEDIA ) {
1563 - $link = $sk->makeMediaLinkObj( $nt, $text );
1564 - # Cloak with NOPARSE to avoid replacement in replaceExternalLinks
1565 - $s .= $prefix . $this->armorLinks( $link ) . $trail;
1566 - $this->mOutput->addImage( $nt->getDBkey() );
1567 - continue;
1568 - } elseif( $ns == NS_SPECIAL ) {
 1582+ if( $ns == NS_SPECIAL ) {
15691583 $s .= $this->makeKnownLinkHolder( $nt, $text, '', $trail, $prefix );
15701584 continue;
15711585 } elseif( $ns == NS_IMAGE ) {
@@ -4140,7 +4154,9 @@
41414155 }
41424156 return $ig->toHTML();
41434157 }
4144 -
 4158+ function makeMedia( &$nt, $options){
 4159+
 4160+ }
41454161 /**
41464162 * Parse image options text and use it to make an image
41474163 */

Status & tagging log