*/
if( defined( "MEDIAWIKI" ) ) {
-# See skin.doc
+# See skin.txt
require_once( 'Linker.php' );
require_once( 'Image.php' );
var $rcMoveIndex;
/**#@-*/
- function Skin() {
- parent::Linker();
- }
+ /** Constructor, call parent constructor */
+ function Skin() { parent::Linker(); }
function getSkinNames() {
global $wgValidSkinNames;
return $wgValidSkinNames;
}
- function getStylesheet() {
- return 'common/wikistandard.css';
- }
+ /** @return string path to the skin stylesheet */
+ function getStylesheet() { return 'common/wikistandard.css'; }
+ /** @return string skin name */
function getSkinName() {
return 'standard';
}
$csspage = $wgContLang->getNsText( NS_MEDIAWIKI ) . ':' . $this->getSkinName() . '.css';
$s = '@import "'.$this->makeUrl($csspage, 'action=raw&ctype=text/css')."\";\n";
- if ( 1 == $wgUser->getOption( 'underline' ) ) {
- # Don't override browser settings
- } else {
- # CHECK MERGE @@@
- # Force no underline
- $s .= "a { text-decoration: none; }\n";
- }
- if ( 1 == $this->mOptions['highlightbroken'] ) {
+ return $s . $this->reallyDoGetUserStyles();
+ }
+
+ function reallyDoGetUserStyles() {
+ global $wgUser;
+ $s = '';
+ $underline = $wgUser->getOption( "underline" ) ? 'underline' : 'none';
+ $s .= "a { text-decoration: $underline; }\n";
+ if( $wgUser->getOption( 'highlightbroken' ) ) {
$s .= "a.new, #quickbar a.new { color: #CC2200; }\n";
+ } else {
+ $s .= <<<END
+a.new, #quickbar a.new,
+a.stub, #quickbar a.stub {
+ color: inherit;
+ text-decoration: inherit;
+}
+a.new:after, #quickbar a.new:after {
+ content: "?";
+ color: #CC2200;
+ text-decoration: $underline;
+}
+a.stub:after, #quickbar a.stub:after {
+ content: "!";
+ color: #772233;
+ text-decoration: $underline;
+}
+END;
}
- if ( 1 == $wgUser->getOption( 'justify' ) ) {
+ if( $wgUser->getOption( 'justify' ) ) {
$s .= "#article { text-align: justify; }\n";
}
+ if( !$wgUser->getOption( 'showtoc' ) ) {
+ $s .= "#toc { display: none; }\n";
+ }
return $s;
}
}
$a['onload'] = $wgOut->getOnloadHandler();
+ if( $wgUser->getOption( 'editsectiononrightclick' ) ) {
+ if( $a['onload'] != '' ) {
+ $a['onload'] .= ';';
+ }
+ $a['onload'] .= 'setupRightClickEdit()';
+ }
return $a;
}
}
function doBeforeContent() {
- global $wgOut, $wgTitle, $wgContLang, $wgSiteNotice;
+ global $wgOut, $wgTitle, $wgContLang;
$fname = 'Skin::doBeforeContent';
wfProfileIn( $fname );
$s .= "</tr>\n</table>\n</div>\n";
$s .= "\n<div id='article'>\n";
- if( $wgSiteNotice ) {
- $s .= "\n<div id='siteNotice'>$wgSiteNotice</div>\n";
+ $notice = wfGetSiteNotice();
+ if( $notice ) {
+ $s .= "\n<div id='siteNotice'>$notice</div>\n";
}
$s .= $this->pageTitle();
$s .= $this->pageSubtitle() ;
}
# add our current element to the list
$eltitle = Title::NewFromText($element);
- # FIXME : should be makeLink() [AV]
- $return .= $skin->makeLinkObj( $eltitle, $eltitle->getText() ) . ' > ';
+ if(!empty($parent)) $return .= ' > ';
+ $return .= $skin->makeLinkObj( $eltitle, $eltitle->getText() ) ;
}
return $return;
}
return "<td width='152' rowspan='{$rows}'> </td>";
}
- # This gets called immediately before the </body> tag.
- #
+ /**
+ * This gets called immediately before the </body> tag.
+ * @return string HTML to be put after </body> ???
+ */
function afterContent() {
$printfooter = "<div class=\"printfooter\">\n" . $this->printFooter() . "</div>\n";
return $printfooter . $this->doAfterContent();
}
+ /** @return string Retrievied from HTML text */
function printSource() {
global $wgTitle;
$url = htmlspecialchars( $wgTitle->getFullURL() );
- return wfMsg( "retrievedfrom", "<a href=\"$url\">$url</a>" );
+ return wfMsg( 'retrievedfrom', '<a href="'.$url.'">'.$url.'</a>' );
}
function printFooter() {
"</p>\n\n<p>" . $this->pageStats() . "</p>\n";
}
- function doAfterContent() {
- # overloaded by derived classes
- }
+ /** overloaded by derived classes */
+ function doAfterContent() { }
function pageTitleLinks() {
global $wgOut, $wgTitle, $wgUser, $wgContLang, $wgUseApproval, $wgRequest;
if ( $wgOut->isArticleRelated() ) {
if ( $wgTitle->getNamespace() == NS_IMAGE ) {
$name = $wgTitle->getDBkey();
- $image = new Image( $wgTitle->getDBkey() );
+ $image = new Image( $wgTitle );
if( $image->exists() ) {
$link = htmlspecialchars( $image->getURL() );
$style = $this->getInternalLinkAttributes( $link, $name );
global $wgOut, $wgTitle, $wgUser;
$s = '<h1 class="pagetitle">' . htmlspecialchars( $wgOut->getPageTitle() ) . '</h1>';
- if($wgUser->getOption( 'editsectiononrightclick' ) && $wgTitle->userCanEdit()) { $s=$this->editSectionScript($wgTitle, 0,$s);}
return $s;
}
}
}
-
-
return $s;
}
}
if (isset($wgMaxCredits) && $wgMaxCredits != 0) {
- require_once("Credits.php");
+ require_once('Credits.php');
$s .= ' ' . getCredits($wgArticle, $wgMaxCredits, $wgShowCreditsIfMax);
} else {
$s .= $this->lastModified();
$timestamp = $wgArticle->getTimestamp();
if ( $timestamp ) {
- $d = $wgLang->timeanddate( $wgArticle->getTimestamp(), true );
+ $d = $wgLang->timeanddate( $timestamp, true );
$s = ' ' . wfMsg( 'lastmodified', $d );
} else {
$s = '';
function disclaimerLink() {
$disclaimers = wfMsg( 'disclaimers' );
if ($disclaimers == '-') {
- return "";
+ return '';
} else {
return $this->makeKnownLink( wfMsgForContent( 'disclaimerpage' ),
$disclaimers );