wfProfileIn( 'Skin::outputPage' );
$this->initPage( $out );
+
$out->out( $out->headElement() );
$out->out( "\n<body" );
$out->out( "<!-- Wiki debugging output:\n" .
$out->mDebugtext . "-->\n" );
}
+
$out->out( $this->beforeContent() );
$out->out( $out->mBodytext . "\n" );
*/
function userCanPreview( $action ) {
global $wgTitle, $wgRequest, $wgUser;
-
+
if( $action != 'submit' )
return false;
if( !$wgRequest->wasPosted() )
return false;
- if( !$wgTitle->userCanEditCssJsSubpage() )
+ if( !$wgTitle->userCanEditCssJsSubpage() )
return false;
return $wgUser->matchEditToken(
$wgRequest->getVal( 'wpEditToken' ) );
}
-
+
# get the user/site-specific stylesheet, SkinPHPTal called from RawPage.php (settings are cached that way)
function getUserStylesheet() {
global $wgOut, $wgStylePath, $wgContLang, $wgUser, $wgRequest, $wgTitle, $wgAllowUserCss;
return $s . $this->reallyDoGetUserStyles();
}
-
+
function reallyDoGetUserStyles() {
global $wgUser;
$s = '';
END;
}
if( $wgUser->getOption( 'justify' ) ) {
- $s .= "#article { text-align: justify; }\n";
+ $s .= "#article, #bodyContent { text-align: justify; }\n";
}
if( !$wgUser->getOption( 'showtoc' ) ) {
$s .= "#toc { display: none; }\n";
return $s;
}
-
+
function getCategoryLinks () {
global $wgOut, $wgTitle, $wgParser;
global $wgUseCategoryMagic, $wgUseCategoryBrowser, $wgLang;
# get a big array of the parents tree
$parenttree = $wgTitle->getParentCategoryTree();
- # Render the array as a serie of links
- # Need to give skin cause $this is undefined at this level
- function walkThrough ($tree, &$skin) {
- $return = '';
- foreach($tree as $element => $parent) {
- if(empty($parent)) {
- # element start a new list
- $return .= '<br />';
- } else {
- # grab the others elements
- $return .= walkThrough($parent, $skin);
- }
- # add our current element to the list
- $eltitle = Title::NewFromText($element);
- if(!empty($parent)) $return .= ' > ';
- $return .= $skin->makeLinkObj( $eltitle, $eltitle->getText() ) ;
- }
- return $return;
- }
-
# Skin object passed by reference cause it can not be
# accessed under the method subfunction walkThrough.
- $s .= walkThrough($parenttree, $this);
+ $s .= Skin::drawCategoryBrowser($parenttree, $this);
}
return $s;
}
+ # Render the array as a serie of links
+ function drawCategoryBrowser ($tree, &$skin) {
+ $return = '';
+ foreach ($tree as $element => $parent) {
+ if (empty($parent)) {
+ # element start a new list
+ $return .= '<br />';
+ } else {
+ # grab the others elements
+ $return .= Skin::drawCategoryBrowser($parent, $skin);
+ }
+ # add our current element to the list
+ $eltitle = Title::NewFromText($element);
+ if (!empty($parent)) $return .= ' > ';
+ $return .= $skin->makeLinkObj( $eltitle, $eltitle->getText() ) ;
+ }
+ return $return;
+ }
+
function getCategories() {
$catlinks=$this->getCategoryLinks();
if(!empty($catlinks)) {
# do not show "You have new messages" text when we are viewing our
# own talk page
- if( $wgTitle->equals( $wgUser->getTalkPage() ) ) {
+ if( !$wgTitle->equals( $wgUser->getTalkPage() ) ) {
$tl = $this->makeKnownLinkObj( $wgUser->getTalkPage(),
wfMsg('newmessageslink') );
$s.= ' | <strong>'. wfMsg( 'newmessages', $tl ) . '</strong>';
}
}
}
-
+
$go = wfMsg( 'go' );
$sp = wfMsg( 'specialpages' );
$spp = $wgContLang->specialPage( 'Specialpages' );
$s .= "<select name=\"wpDropdown\">\n";
$s .= "<option value=\"{$spp}\">{$sp}</option>\n";
-
+
foreach ( $a as $name => $desc ) {
$p = $wgContLang->specialPage( $name );
$s .= "<option value=\"{$p}\">{$desc}</option>\n";
# 0 != $id->getEmailauthenticationtimestamp() && # .. which is authenticated
# 1 != $wgUser->getOption('disablemail'); # and not disabled
}
-
+
function emailUserLink() {
global $wgTitle;
}
function otherLanguages() {
- global $wgOut, $wgContLang, $wgTitle;
+ global $wgOut, $wgContLang, $wgTitle, $wgHideInterlanguageLinks;
+
+ if ( $wgHideInterlanguageLinks ) {
+ return '';
+ }
$a = $wgOut->getLanguageLinks();
if ( 0 == count( $a ) ) {
$title = Title::makeTitle( NS_SPECIAL, $name );
return $title->getLocalURL( $urlaction );
}
-
+
/*static*/ function makeI18nUrl ( $name, $urlaction='' ) {
$title = Title::newFromText( wfMsgForContent($name) );
$this->checkTitle($title, $name);
return $title->getLocalURL( $urlaction );
}
-
+
/*static*/ function makeUrl ( $name, $urlaction='' ) {
$title = Title::newFromText( $name );
$this->checkTitle($title, $name);
}
}
+ /**
+ * Build an array that represents the sidebar(s), the navigation bar among them
+ *
+ * @return array
+ * @access private
+ */
+ function buildSidebar() {
+ $fname = 'SkinTemplate::buildSidebar';
+ wfProfileIn( $fname );
+
+ $bar = array();
+ $lines = explode( "\n", wfMsgForContent( 'sidebar' ) );
+ foreach ($lines as $line) {
+ if (strpos($line, '*') !== 0)
+ continue;
+ if (strpos($line, '**') !== 0) {
+ $line = trim($line, '* ');
+ $heading = $line;
+ } else {
+ if (strpos($line, '|') !== false) { // sanity check
+ $line = explode( '|' , trim($line, '* '), 2 );
+ $link = wfMsgForContent( $line[0] );
+ if ($link == '-')
+ continue;
+ $bar[$heading][] = array(
+ 'text' => wfMsg( $line[1] ),
+ 'href' => $this->makeInternalOrExternalUrl( $link ),
+ 'id' => 'n-' . $line[1],
+ );
+ } else { continue; }
+ }
+ }
+
+ wfProfileOut( $fname );
+ return $bar;
+ }
}
}