'nostalgia' => "Nostalgia",
'cologneblue' => "CologneBlue"
);
-if( $wgUseSmarty ) {
- $wgValidSkinNames['smarty'] = "Smarty";
- $wgValidSkinNames['montparnasse'] = "Montparnasse";
-}
if( $wgUsePHPTal ) {
#$wgValidSkinNames[] = "PHPTal";
#$wgValidSkinNames['davinci'] = "DaVinci";
$fname = "Skin::initPage";
wfProfileIn( $fname );
- $out->addLink( "shortcut icon", "", "/favicon.ico" );
-
- $this->addMetadataLinks($out);
+ $out->addLink( array( "rel" => "shortcut icon", "href" => "/favicon.ico" ) );
+
+ $this->addMetadataLinks($out);
wfProfileOut( $fname );
}
- function addMetadataLinks( &$out ) {
- global $wgTitle, $wgEnableDublinCoreRdf, $wgEnableCreativeCommonsRdf, $wgRdfMimeType, $action;
-
- if ($action == 'view') {
- # note: buggy CC software only reads first "meta" link
- if ($wgEnableCreativeCommonsRdf) {
- $out->addMetadataLink('application/rdf+xml', wfLocalUrl($wgTitle->getPrefixedURL(), "action=creativecommons"));
+ function addMetadataLinks( &$out ) {
+ global $wgTitle, $wgEnableDublinCoreRdf, $wgEnableCreativeCommonsRdf, $wgRdfMimeType, $action;
+ global $wgRightsPage, $wgRightsUrl;
+
+ if( $out->isArticleRelated() ) {
+ # note: buggy CC software only reads first "meta" link
+ if( $wgEnableCreativeCommonsRdf ) {
+ $out->addMetadataLink( array(
+ 'title' => 'Creative Commons',
+ 'type' => 'application/rdf+xml',
+ 'href' => $wgTitle->getLocalURL( "action=creativecommons") ) );
+ }
+ if( $wgEnableDublinCoreRdf ) {
+ $out->addMetadataLink( array(
+ 'title' => 'Dublin Core',
+ 'type' => 'application/rdf+xml',
+ 'href' => $wgTitle->getLocalURL( "action=dublincore" ) ) );
+ }
+ }
+ $copyright = "";
+ if( $wgRightsPage ) {
+ $copy = Title::newFromText( $wgRightsPage );
+ if( $copy ) {
+ $copyright = $copy->getLocalURL();
+ }
}
- if ($wgEnableDublinCoreRdf) {
- $out->addMetadataLink('application/rdf+xml', wfLocalUrl($wgTitle->getPrefixedURL(), "action=dublincore"));
+ if( !$copyright && $wgRightsUrl ) {
+ $copyright = $wgRightsUrl;
+ }
+ if( $copyright ) {
+ $out->addLink( array(
+ "rel" => "copyright",
+ "href" => $copyright ) );
}
- }
}
function outputPage( &$out ) {
} else {
# CHECK MERGE @@@
# Force no underline
- $s .= "a.stub, a.new, a.internal, a.external { " .
+ $s .= "a { " .
"text-decoration: none; }\n";
}
if ( 1 == $wgUser->getOption( "highlightbroken" ) ) {
(!$wgTitle->isProtected() || $wgUser->isSysop()) ) {
$t = wfMsg( "editthispage" );
$oid = $red = "";
- if ( $redirect ) {
+ if ( !empty($redirect) ) {
$red = "&redirect={$redirect}";
}
if ( !empty($oldid) && ! isset( $diff ) ) {
if($wgLang->isRTL()) $left = !$left;
if ( !$shove ) {
- $s .= "<td class='top' align=left valign=top rowspan='{$rows}'>\n" .
+ $s .= "<td class='top' align='left' valign='top' rowspan='{$rows}'>\n" .
$this->logoText() . "</td>";
} elseif( $left ) {
$s .= $this->getQuickbarCompensator( $rows );
$action = $wgRequest->getText( 'action' );
$s = $this->printableLink();
- if ( wfMsg ( "disclaimers" ) != "-" ) $s .= " | " . $this->makeKnownLink( wfMsg( "disclaimerpage" ), wfMsg( "disclaimers" ) ) ;
+ if ( wfMsg ( "disclaimers" ) != "" ) $s .= " | " . $this->makeKnownLink( wfMsg( "disclaimerpage" ), wfMsg( "disclaimers" ) ) ;
if ( $wgOut->isArticleRelated() ) {
if ( $wgTitle->getNamespace() == Namespace::getImage() ) {
{
global $wgOut, $wgTitle, $wgUser;
- $s = "<h1 class='pagetitle'>" . $wgOut->getPageTitle() . "</h1>";
+ $s = "<h1 class='pagetitle'>" . htmlspecialchars( $wgOut->getPageTitle() ) . "</h1>";
if($wgUser->getOption("editsectiononrightclick") && $wgTitle->userCanEdit()) { $s=$this->editSectionScript(0,$s);}
return $s;
}
global $wgExtraSubtitle;
$sub = wfMsg( "fromwikipedia" ) . $wgExtraSubtitle;
}
- if($wgOut->isArticle() && $wgNamespacesWithSubpages[$wgTitle->getNamespace()]) {
+ if($wgOut->isArticle() && !empty($wgNamespacesWithSubpages[$wgTitle->getNamespace()])) {
$ptext=$wgTitle->getPrefixedText();
if(preg_match("/\//",$ptext)) {
$sub.="</p><p class='subpages'>";
}
}
$s .= $this->lastModified();
- $s .= " " . wfMsg( "gnunote" );
- return $s;
+ return $s . " " . $this->getCopyright();
+ }
+
+ function getCopyright() {
+ global $wgRightsPage, $wgRightsUrl, $wgRightsText;
+ $out = "";
+ if( $wgRightsPage ) {
+ $link = $this->makeKnownLink( $wgRightsPage, $wgRightsText );
+ } elseif( $wgRightsUrl ) {
+ $link = $this->makeExternalLink( $wgRightsUrl, $wgRightsText );
+ } else {
+ # Give up now
+ return $out;
+ }
+ $out .= wfMsg( "copyright", $link );
+ return $out;
+ }
+
+ function getCopyrightIcon() {
+ global $wgRightsPage, $wgRightsUrl, $wgRightsText, $wgRightsIcon;
+ $out = "";
+ if( $wgRightsIcon ) {
+ $icon = htmlspecialchars( $wgRightsIcon );
+ if( $wgRightsUrl ) {
+ $url = htmlspecialchars( $wgRightsUrl );
+ $out .= "<a href=\"$url\">";
+ }
+ $text = htmlspecialchars( $wgRightsText );
+ $out .= "<img src=\"$icon\" alt='$text' />";
+ if( $wgRightsUrl ) {
+ $out .= "</a>";
+ }
+ }
+ return $out;
+ }
+
+ function getPoweredBy() {
+ global $wgUploadPath;
+ $url = htmlspecialchars( "$wgUploadPath/poweredby_mediawiki_88x31.png" );
+ $img = "<a href='http://www.mediawiki.org/'><img src='$url' alt='MediaWiki' /></a>";
+ return $img;
}
function lastModified()
}
// only show watchlist link if logged in
- if ( wfMsg ( "currentevents" ) != "-" ) $s .= $sep . $this->makeKnownLink( wfMsg( "currentevents" ), "" ) ;
+ if ( wfMsg ( "currentevents" ) != "" ) $s .= $sep . $this->makeKnownLink( wfMsg( "currentevents" ), "" ) ;
$s .= "\n<br /><hr class='sep' />";
$articleExists = $wgTitle->getArticleId();
if ( $wgOut->isArticle() || $action =="edit" || $action =="history" || $wpPreview) {
$spp = $wgLang->specialPage( "Specialpages" );
$s = "<form id=\"specialpages\" method=\"get\" class=\"inline\" " .
- "action=\"{$wgServer}{$wgRedirectScript}\">\n";
+ "action=\"" . htmlspecialchars( "{$wgServer}{$wgRedirectScript}" ) . "\">\n";
$s .= "<select name=\"wpDropdown\">\n";
$s .= "<option value=\"{$spp}\">{$sp}</option>\n";
$s .= "<option value=\"{$p}\">{$desc}</option>\n";
}
$s .= "</select>\n";
- $s .= "<input type=submit value=\"{$go}\" name=redirect>\n";
+ $s .= "<input type='submit' value=\"{$go}\" name='redirect' />\n";
$s .= "</form>\n";
return $s;
}
return $result;
}
- function makeKnownLink( $title, $text = "", $query = "", $trail = "" ) {
+ function makeKnownLink( $title, $text = "", $query = "", $trail = "", $prefix = '',$aprops = '') {
$nt = Title::newFromText( $title );
if ($nt) {
- return $this->makeKnownLinkObj( Title::newFromText( $title ), $text, $query, $trail );
+ return $this->makeKnownLinkObj( Title::newFromText( $title ), $text, $query, $trail, $prefix , $aprops );
} else {
wfDebug( "Invalid title passed to Skin::makeKnownLink(): \"$title\"\n" );
return $text == "" ? $title : $text;
global $wgOut, $wgUser;
if ( $nt->isExternal() ) {
$u = $nt->getFullURL();
+ $link = $nt->getPrefixedURL();
if ( "" == $text ) { $text = $nt->getPrefixedText(); }
$style = $this->getExternalLinkAttributes( $link, $text );
}
# Pass a title object, not a title string
- function makeKnownLinkObj( &$nt, $text = "", $query = "", $trail = "", $prefix = "" )
+ function makeKnownLinkObj( &$nt, $text = "", $query = "", $trail = "", $prefix = "" , $aprops = '')
{
global $wgOut, $wgTitle;
if ( "" == $link ) {
$u = "";
- if ( "" == $text ) { $text = $nt->getFragment(); }
+ if ( "" == $text ) {
+ $text = htmlspecialchars( $nt->getFragment() );
+ }
} else {
$u = $nt->escapeLocalURL( $query );
}
if ( "" != $nt->getFragment() ) {
- $u .= "#" . wfEscapeHTML( $nt->getFragment() );
+ $u .= "#" . htmlspecialchars( $nt->getFragment() );
+ }
+ if ( "" == $text ) {
+ $text = htmlspecialchars( $nt->getPrefixedText() );
}
- if ( "" == $text ) { $text = $nt->getPrefixedText(); }
$style = $this->getInternalLinkAttributesObj( $nt, $text );
$inside = "";
$trail = $m[2];
}
}
- $r = "<a href=\"{$u}\"{$style}>{$prefix}{$text}{$inside}</a>{$trail}";
+ $r = "<a href=\"{$u}\"{$style}{$aprops}>{$prefix}{$text}{$inside}</a>{$trail}";
wfProfileOut( $fname );
return $r;
}
}
$u = $nt->escapeLocalURL( $q );
- if ( "" == $text ) { $text = $nt->getPrefixedText(); }
+ if ( "" == $text ) {
+ $text = htmlspecialchars( $nt->getPrefixedText() );
+ }
$style = $this->getInternalLinkAttributesObj( $nt, $text, "yes" );
$inside = "";
$u = $nt->escapeLocalURL( $query );
- if ( "" == $text ) { $text = $nt->getPrefixedText(); }
+ if ( "" == $text ) {
+ $text = htmlspecialchars( $nt->getPrefixedText() );
+ }
$style = $this->getInternalLinkAttributesObj( $nt, $text, "stub" );
$inside = "";
{
$s = str_replace( "$1", $name, wfMsg("missingimage") );
} else {
- $s = "\n <a href=\"{$u}\" class='image' title=\"{$alt}\">\n" .
- " <img src=\"{$url}\" alt=\"{$alt}\" />\n </a>";
+ $s = "<a href=\"{$u}\" class='image' title=\"{$alt}\">" .
+ "<img src=\"{$url}\" alt=\"{$alt}\" /></a>";
}
if ( "" != $align ) {
- $s = "<div class=\"float{$align}\"><span>{$s}\n</span></div>";
+ $s = "<div class=\"float{$align}\"><span>{$s}</span>\n</div>";
}
return $prefix.$s.$postfix;
}
global $wgUseImageMagick;
global $wgUseSquid, $wgInternalServer;
$imgPath = wfImagePath( $name );
- $thumbName = $width."px-".$icon.$name;
+ $thumbName = $width."px-".$name;
$thumbPath = wfImageThumbDir( $thumbName )."/".$thumbName;
$thumbUrl = wfImageThumbUrl( $thumbName );
if ( $thumbUrl == "" ) {
$s .= str_replace( "$1", $name, wfMsg("missingimage") );
} else {
- $s .= "\n".' <a href="'.$u.'" class="internal" title="'.$alt.'">'."\n".
- ' <img src="'.$thumbUrl.'" alt="'.$alt.'" ' .
- ' width="'.$boxwidth.'" height="'.$boxheight.'" /></a>' ."\n".
- ' <a href="'.$u.'" class="internal" title="'.$more.'"> ' ."\n".
- ' <img src="'.$wgUploadPath.'/magnify-clip.png" ' .
- 'width="26" height="24" align="'.$magnifyalign.'" alt="'.$more.'" /> </a>'."\n";
- }
- $s .= ' <p'.$textalign.'>'.$label."</p>\n</div></div>";
+ $s .= '<a href="'.$u.'" class="internal" title="'.$alt.'">'.
+ '<img src="'.$thumbUrl.'" alt="'.$alt.'" ' .
+ 'width="'.$boxwidth.'" height="'.$boxheight.'" /></a>'.
+ '<a href="'.$u.'" class="internal" title="'.$more.'"> '.
+ '<img src="'.$wgUploadPath.'/magnify-clip.png" ' .
+ 'width="26" height="24" align="'.$magnifyalign.'" alt="'.$more.'" /> </a>';
+ }
+ $s .= ' <div'.$textalign.'>'.$label."</div></div>\n</div>";
return $s;
}
return $this->makeKnownLink( $wgLang->specialPage( $pn ),
wfMsg( $key ) );
}
+
+ function makeExternalLink( $url, $text, $escape = true ) {
+ $style = $this->getExternalLinkAttributes( $url, $text );
+ $url = htmlspecialchars( $url );
+ if( $escape ) {
+ $text = htmlspecialchars( $text );
+ }
+ return "<a href=\"$url\"$style>$text</a>";
+ }
# Called by history lists and recent changes
#
$this->rcMoveIndex = 0;
$this->rcCacheIndex = 0 ;
$this->lastdate = "";
+ $this->rclistOpen = false;
return "";
}
function beginImageHistoryList()
{
$s = "\n<h2>" . wfMsg( "imghistory" ) . "</h2>\n" .
- "<p>" . wfMsg( "imghistlegend" ) . "\n<ul class='special'>";
+ "<p>" . wfMsg( "imghistlegend" ) . "</p>\n<ul class='special'>";
return $s;
}
function endRecentChangesList()
{
$s = $this->recentChangesBlock() ;
- $s .= "</ul>\n";
+ if( $this->rclistOpen ) {
+ $s .= "</ul>\n";
+ }
return $s;
}
if ( "" != $this->lastdate ) { $s .= "</ul>\n"; }
$s .= "<h4>{$date}</h4>\n<ul class='special'>";
$this->lastdate = $date;
+ $this->rclistOpen = true;
}
$s .= "<li> ";
$diffLink = wfMsg( "diff" );
} else {
$diffLink = $this->makeKnownLinkObj( $rc->getTitle(), wfMsg( "diff" ),
- "{$curIdEq}&diff={$rc_this_oldid}&oldid={$rc_last_oldid}" );
+ "{$curIdEq}&diff={$rc_this_oldid}&oldid={$rc_last_oldid}" ,'' ,'' , ' tabindex="'.$rc->counter.'"');
}
$s .= "($diffLink) (";
$curLink = wfMsg( "cur" );
} else {
$curLink = $this->makeKnownLinkObj( $rc->getTitle(), wfMsg( "cur" ),
- "{$curIdEq}&diff=0&oldid={$rc_this_oldid}" );
+ "{$curIdEq}&diff=0&oldid={$rc_this_oldid}" ,'' ,'' , ' tabindex="'.$baseRC->counter.'"' );
}
# Make "last" link
and by the user contributions list. It is responsible for formatting edit
comments. It escapes any HTML in the comment, but adds some CSS to format
auto-generated comments (from section editing) and formats [[wikilinks]].
- Main author: Erik Möller (moeller@scireview.de)
+ Main author: Erik Möller (moeller@scireview.de)
*/
function formatComment($comment)
{
if(preg_match("/^".$medians."/i",$match[1])) {
$func="makeMediaLink";
}
- if($match[3]) {
+ if(isset($match[3]) ) {
$comment=
preg_replace("/\[\[(.*?)\]\]/",
$this->$func($match[1],$match[3]),$comment,1);
"key"=>"R"
)
);
- $toolbar ="<script type='text/javascript'>\n";
-
- $xml = ($wgMimeType == "text/xml");
- if( $xml ) {
- $toolbar .= "<![CDATA[";
- }
-
+ $toolbar ="<script type='text/javascript'>\n/*<![CDATA[*/\n";
+
$toolbar.="document.writeln(\"<div id='toolbar'>\");\n";
foreach($toolarray as $tool) {
$toolbar.="addInfobox('" . addslashes( wfMsg( "infobox" ) ) . "','" . addslashes(wfMsg("infobox_alert")) . "');\n";
$toolbar.="document.writeln(\"</div>\");\n";
-
- if( $xml ) {
- $toolbar .= "]]>";
- }
- $toolbar.="</script>";
+
+ $toolbar.="/*]]>*/\n</script>";
return $toolbar;
}
}
include_once( "SkinNostalgia.php" );
include_once( "SkinCologneBlue.php" );
-if( $wgUseSmarty ) {
- include_once( "SkinSmarty.php" );
-}
if( $wgUsePHPTal ) {
include_once( "SkinPHPTal.php" );
}