function pageSubtitle()
{
- global $wgOut,$wgTitle,$wgNamespacesWithSubpages;
+ global $wgOut;
$sub = $wgOut->getSubtitle();
if ( "" == $sub ) {
global $wgExtraSubtitle;
$sub = wfMsg( "fromwikipedia" ) . $wgExtraSubtitle;
}
+ $subpages = $this->subPageSubtitle();
+ $sub .= !empty($subpages)?"</p><p class='subpages'>$subpages":'';
+ $s = "<p class='subtitle'>{$sub}</p>\n";
+ return $s;
+ }
+
+ function subPageSubtitle()
+ {
+ global $wgOut,$wgTitle,$wgNamespacesWithSubpages;
+ $subpages = '';
if($wgOut->isArticle() && !empty($wgNamespacesWithSubpages[$wgTitle->getNamespace()])) {
$ptext=$wgTitle->getPrefixedText();
if(preg_match("/\//",$ptext)) {
- $sub.="</p><p class='subpages'>";
$links=explode("/",$ptext);
$c=0;
$growinglink="";
$getlink = $this->makeLink( $growinglink, $link );
if(preg_match("/class='new'/i",$getlink)) { break; } # this is a hack, but it saves time
if ($c>1) {
- $sub .= " | ";
+ $subpages .= " | ";
} else {
- $sub .="< ";
+ $subpages .="< ";
}
- $sub .= $getlink;
+ $subpages .= $getlink;
$growinglink.="/";
}
-
}
}
}
- $s = "<p class='subtitle'>{$sub}</p>\n";
- return $s;
+ return $subpages;
}
function nameAndLogin()
{
var $_context = array();
- function set($varName, $value)
- {
+ function set($varName, $value) {
$this->_context[$varName] = $value;
}
- function translate($value)
- {
+ function translate($value) {
$value = wfMsg( $value );
-
// interpolate variables
while (preg_match('/\$([0-9]*?)/sm', $value, $m)) {
list($src, $var) = $m;
- $varValue = $this->_context[$var];
+ $varValue = @$this->_context[$var];
$value = str_replace($src, $varValue, $value);
}
return $value;
$tpl->set( "pagetitle", $wgOut->getHTMLTitle() );
$tpl->setRef( "thispage", &$this->thispage );
- $tpl->set( "subtitle", $out->getSubtitle() );
+ $subpagestr = $this->subPageSubtitle();
+ $tpl->set(
+ "subtitle", !empty($subpagestr)?
+ '<span class="subpages">'.$subpagestr.'</span>'.$out->getSubtitle():
+ $out->getSubtitle()
+ );
$tpl->set( 'catlinks', $this->getCategories());
if( $wgOut->isSyndicated() ) {
$feeds = array();