Index: branches/embed_media/phase3/includes/Parser.php |
— | — | @@ -1493,7 +1493,7 @@ |
1494 | 1494 | |
1495 | 1495 | # Link not escaped by : , create the various objects |
1496 | 1496 | if( $noforce ) { |
1497 | | - |
| 1497 | + wfDebug("nofroce called: \n"); |
1498 | 1498 | # Interwikis |
1499 | 1499 | if( $iw && $this->mOptions->getInterwikiMagic() && $nottalk && $wgContLang->getLanguageName( $iw ) ) { |
1500 | 1500 | $this->mOutput->addLanguageLink( $nt->getFullText() ); |
— | — | @@ -1521,7 +1521,27 @@ |
1522 | 1522 | wfProfileOut( "$fname-image" ); |
1523 | 1523 | |
1524 | 1524 | } |
| 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); |
1525 | 1534 | |
| 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 | + |
1526 | 1546 | if ( $ns == NS_CATEGORY ) { |
1527 | 1547 | wfProfileIn( "$fname-category" ); |
1528 | 1548 | $s = rtrim($s . "\n"); # bug 87 |
— | — | @@ -1558,13 +1578,7 @@ |
1559 | 1579 | } |
1560 | 1580 | |
1561 | 1581 | # 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 ) { |
1569 | 1583 | $s .= $this->makeKnownLinkHolder( $nt, $text, '', $trail, $prefix ); |
1570 | 1584 | continue; |
1571 | 1585 | } elseif( $ns == NS_IMAGE ) { |
— | — | @@ -4140,7 +4154,9 @@ |
4141 | 4155 | } |
4142 | 4156 | return $ig->toHTML(); |
4143 | 4157 | } |
4144 | | - |
| 4158 | + function makeMedia( &$nt, $options){ |
| 4159 | + |
| 4160 | + } |
4145 | 4161 | /** |
4146 | 4162 | * Parse image options text and use it to make an image |
4147 | 4163 | */ |