From: Brion Vibber Date: Sun, 11 Apr 2004 01:25:00 +0000 (+0000) Subject: Skin updates: X-Git-Tag: 1.3.0beta1~462 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/membres/fiche.php?a=commitdiff_plain;h=8172d54c366535a5663d6536798f472e90d6a2e5;p=lhc%2Fweb%2Fwiklou.git Skin updates: * Add 'pagetitle' message to customize the HTML page title format (eg, "$1 - Wikipedia Encyclopedia") * Some XHTML fixes to Nostalgia skin, prefs * Removing the unfinished Smarty skins, renamed Standard to Classic * Remove "gnunote" message in favor of general "copyright" msg, which is filled with the link & name in $wgRightsPage/$wgRightsURL and $wgRightsText * Support a copyright-related icon as $wgRightsIcon (includes sample gnu-fdl.png) * Show "Powered by MediaWiki" icon in footer (poweredby_mediawiki_88x31.png by Dan Carlson) --- diff --git a/images/gnu-fdl.png b/images/gnu-fdl.png new file mode 100644 index 0000000000..1371aba886 Binary files /dev/null and b/images/gnu-fdl.png differ diff --git a/images/gnu-fdl.xcf b/images/gnu-fdl.xcf new file mode 100644 index 0000000000..364440dd77 Binary files /dev/null and b/images/gnu-fdl.xcf differ diff --git a/images/poweredby_mediawiki_88x31.png b/images/poweredby_mediawiki_88x31.png new file mode 100644 index 0000000000..f9175eb10c Binary files /dev/null and b/images/poweredby_mediawiki_88x31.png differ diff --git a/includes/OutputPage.php b/includes/OutputPage.php index a1a96aad18..d32792a129 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -597,7 +597,7 @@ class OutputPage { $ret .= "\n"; if ( "" == $this->mHTMLtitle ) { - $this->mHTMLtitle = $this->mPagetitle; + $this->mHTMLtitle = wfMsg( "pagetitle", $this->mPagetitle ); } if( $xml ) { $xmlbits = "xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\""; @@ -606,8 +606,9 @@ class OutputPage { } $rtl = $wgLang->isRTL() ? " dir='RTL'" : ""; $ret .= "\n"; - $ret .= "\n{$this->mHTMLtitle}\n"; + $ret .= "\n" . htmlspecialchars( $this->mHTMLtitle ) . "\n"; array_push( $this->mMetatags, array( "http:Content-type", "$wgMimeType; charset={$wgOutputEncoding}" ) ); + $ret .= $this->getHeadLinks(); global $wgStyleSheetPath; if( $this->isPrintable() ) { diff --git a/includes/Skin.php b/includes/Skin.php index b1cab1e39b..806ef1591d 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -527,7 +527,7 @@ class Skin { { global $wgOut, $wgTitle, $wgUser; - $s = "

" . $wgOut->getPageTitle() . "

"; + $s = "

" . htmlspecialchars( $wgOut->getPageTitle() ) . "

"; if($wgUser->getOption("editsectiononrightclick") && $wgTitle->userCanEdit()) { $s=$this->editSectionScript(0,$s);} return $s; } @@ -713,8 +713,47 @@ class Skin { } } $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 .= ""; + } + $text = htmlspecialchars( $wgRightsText ); + $out .= "$text"; + if( $wgRightsUrl ) { + $out .= ""; + } + } + return $out; + } + + function getPoweredBy() { + global $wgUploadPath; + $url = htmlspecialchars( "$wgUploadPath/poweredby_mediawiki_88x31.png" ); + $img = "MediaWiki"; + return $img; } function lastModified() @@ -924,7 +963,7 @@ class Skin { $spp = $wgLang->specialPage( "Specialpages" ); $s = "
\n"; + "action=\"" . htmlspecialchars( "{$wgServer}{$wgRedirectScript}" ) . "\">\n"; $s .= "\n"; - $s .= "\n"; + $s .= "\n"; $s .= "
\n"; return $s; } @@ -1384,14 +1423,18 @@ class Skin { 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 = ""; @@ -1421,7 +1464,9 @@ class Skin { } $u = $nt->escapeLocalURL( $q ); - if ( "" == $text ) { $text = $nt->getPrefixedText(); } + if ( "" == $text ) { + $text = htmlspecialchars( $nt->getPrefixedText() ); + } $style = $this->getInternalLinkAttributesObj( $nt, $text, "yes" ); $inside = ""; @@ -1450,7 +1495,9 @@ class Skin { $u = $nt->escapeLocalURL( $query ); - if ( "" == $text ) { $text = $nt->getPrefixedText(); } + if ( "" == $text ) { + $text = htmlspecialchars( $nt->getPrefixedText() ); + } $style = $this->getInternalLinkAttributesObj( $nt, $text, "stub" ); $inside = ""; @@ -1764,6 +1811,15 @@ class Skin { 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 "$text"; + } # Called by history lists and recent changes # diff --git a/includes/SkinNostalgia.php b/includes/SkinNostalgia.php index 557c88f112..3d990ee670 100644 --- a/includes/SkinNostalgia.php +++ b/includes/SkinNostalgia.php @@ -21,15 +21,15 @@ class SkinNostalgia extends Skin { $s .= $this->logoText( "right" ); $s .= $this->pageTitle(); - $s .= $this->pageSubtitle() . "\n

"; + $s .= $this->pageSubtitle() . "\n"; - $s .= $this->topLinks() . "\n
"; + $s .= $this->topLinks() . "\n
"; $s .= $this->pageTitleLinks(); $ol = $this->otherLanguages(); - if($ol) $s .= "
" . $ol; + if($ol) $s .= "
" . $ol; - $s .= "


\n\n"; + $s .= "

\n\n"; $s .= "\n
"; return $s; @@ -61,13 +61,13 @@ class SkinNostalgia extends Skin { { global $wgUser, $wgOut; - $s = "\n

\n"; + $s = "\n
\n"; - $s .= "\n