global $wgTitle, $wgArticle, $wgUser, $wgLang, $wgContLang, $wgOut;
global $wgScript, $wgStylePath, $wgLanguageCode, $wgContLanguageCode, $wgUseNewInterlanguage;
global $wgMimeType, $wgOutputEncoding, $wgUseDatabaseMessages, $wgRequest;
- global $wgDisableCounters, $wgLogo, $action, $wgFeedClasses, $wgSiteNotice;
+ global $wgDisableCounters, $wgLogo, $action, $wgFeedClasses;
global $wgMaxCredits, $wgShowCreditsIfMax;
global $wgPageShowWatchingUsers;
} else {
$tpl->set('viewcount', false);
}
+ } else {
+ $tpl->set('viewcount', false);
}
if ($wgPageShowWatchingUsers) {
$tpl->setRef( 'debug', $out->mDebugtext );
$tpl->set( 'reporttime', $out->reportTime() );
- $tpl->set( 'sitenotice', $wgSiteNotice );
- $tpl->set( 'tagline', wfMsg('tagline') );
+ $tpl->set( 'sitenotice', wfGetSiteNotice() );
$printfooter = "<div class=\"printfooter\">\n" . $this->printSource() . "</div>\n";
$out->mBodytext .= $printfooter ;
} else {
$tpl->set('body_ondblclick', false);
}
+ if( $this->iseditable && $wgUser->getOption( 'editsectiononrightclick' ) ) {
+ $tpl->set( 'body_onload', 'setupRightClickEdit()' );
+ } else {
+ $tpl->set( 'body_onload', false );
+ }
$tpl->set( 'navigation_urls', $this->buildNavigationUrls() );
$tpl->set( 'nav_urls', $this->buildNavUrls() );
);
}
}
- }
} else {
//article doesn't exist or is deleted
if($wgUser->isAllowed('delete')){
}
wfProfileOut( "$fname-live" );
- if ( $wgUser->isLoggedIn() and $action != 'submit' ) {
+ if( $wgUser->isLoggedIn() and $action != 'submit' ) {
if( !$this->mTitle->userIsWatching()) {
$content_actions['watch'] = array(
'class' => ($action == 'watch' or $action == 'unwatch') ? 'selected' : false,
);
}
- # Validate tab. TODO: add validation to logged-in user rights
- if($wgUseValidation){ # && $wgUser->isAllowed('validate')){
- $content_actions['validate'] = array(
- 'class' => ($action == 'validate') ? 'selected' : false,
- 'text' => wfMsg('val_tab'),
- 'href' => $this->mTitle->getLocalUrl( 'action=validate' )
- );
+ # Validate tab. TODO: add validation to logged-in user rights
+ if($wgUseValidation && ( $action == "" || $action=='view' ) ){ # && $wgUser->isAllowed('validate')){
+ if ( $oldid ) $oid = IntVal( $oldid ) ; # Use the oldid
+ else
+ {# Trying to get the current article revision through this weird stunt
+ $tid = $this->mTitle->getArticleID();
+ $tns = $this->mTitle->getNamespace();
+ $sql = "SELECT page_latest FROM page WHERE page_id={$tid} AND page_namespace={$tns}" ;
+ $res = wfQuery( $sql, DB_READ );
+ if( $s = wfFetchObject( $res ) )
+ $oid = $s->page_latest ;
+ else $oid = "" ; # Something's wrong, like the article has been deleted in the last 10 ns
+ }
+ if ( $oid != "" ) {
+ $oid = "&revision={$oid}" ;
+ $content_actions['validate'] = array(
+ 'class' => ($action == 'validate') ? 'selected' : false,
+ 'text' => wfMsg('val_tab'),
+ 'href' => $this->mTitle->getLocalUrl( "action=validate{$oid}" )
+ );
+ }
+ }
}
-
} else {
/* show special page tab */
wfProfileOut( $fname );
return $content_actions;
}
+
+ function getNavigationLinks() {
+ global $wgNavigationLinks;
+ return $wgNavigationLinks;
+ }
/**
* build array of global navigation links
$fname = 'SkinTemplate::buildNavigationUrls';
wfProfileIn( $fname );
- global $wgNavigationLinks;
+ $links = $this->getNavigationLinks();
+
$result = array();
- foreach ( $wgNavigationLinks as $link ) {
+ foreach ( $links as $link ) {
$text = wfMsg( $link['text'] );
wfProfileIn( "$fname-{$link['text']}" );
if ($text != '-') {
$dest = wfMsgForContent( $link['href'] );
wfProfileIn( "$fname-{$link['text']}2" );
- $result[] = array(
- 'text' => $text,
- 'href' => $this->makeInternalOrExternalUrl( $dest ),
- 'id' => 'n-'.$link['text']
- );
+ $result[] = array(
+ 'text' => $text,
+ 'href' => $this->makeInternalOrExternalUrl( $dest ),
+ 'id' => 'n-'.$link['text']
+ );
wfProfileOut( "$fname-{$link['text']}2" );
}
wfProfileOut( "$fname-{$link['text']}" );
wfProfileIn( $fname );
global $wgUser, $wgRequest;
- global $wgSiteSupportPage, $wgDisableUploads;
+ global $wgSiteSupportPage, $wgEnableUploads, $wgUploadNavigationUrl;
$action = $wgRequest->getText( 'action' );
$oldid = $wgRequest->getVal( 'oldid' );
// $nav_urls['sitesupport'] = array('href' => $this->makeI18nUrl('sitesupportpage'));
$nav_urls['sitesupport'] = array('href' => $wgSiteSupportPage);
$nav_urls['help'] = array('href' => $this->makeI18nUrl('helppage'));
- if( $this->loggedin && !$wgDisableUploads ) {
- $nav_urls['upload'] = array('href' => $this->makeSpecialUrl('Upload'));
+ if( $wgEnableUploads ) {
+ if ($wgUploadNavigationUrl) {
+ $nav_urls['upload'] = array('href' => $wgUploadNavigationUrl );
+ } else {
+ $nav_urls['upload'] = array('href' => $this->makeSpecialUrl('Upload'));
+ }
} else {
$nav_urls['upload'] = false;
}
* returns css with user-specific options
* @access public
*/
+
function getUserStylesheet() {
$fname = 'SkinTemplate::getUserStylesheet';
wfProfileIn( $fname );
global $wgUser;
$s = "/* generated user stylesheet */\n";
-
- if( $wgUser->isLoggedIn() ) {
- if ( $wgUser->getOption( "underline" ) ) {
- $s .= "a { text-decoration: underline; }\n";
- } else {
- $s .= "a { text-decoration: none; }\n";
- }
- }
- if ( !$wgUser->getOption( "highlightbroken" ) ) {
- $s .= "a.new, #quickbar a.new { color: #CC2200; }\n";
- }
- if ( $wgUser->getOption( "justify" ) ) {
- $s .= "#bodyContent { text-align: justify; }\n";
- }
+ $s .= $this->reallyDoGetUserStyles();
wfProfileOut( $fname );
return $s;
}