*/
class Skin extends Linker {
/**#@+
- * @access private
+ * @private
*/
var $lastdate, $lastline;
var $rc_cache ; # Cache for Enhanced Recent Changes
*
* @param string $action
* @return bool
- * @access private
+ * @private
*/
function userCanPreview( $action ) {
global $wgTitle, $wgRequest, $wgUser;
/**
* Some styles that are set by user through the user settings interface.
+ * @todo undefined variables (bug #4940)
*/
function doGetUserStyles() {
global $wgUser, $wgUser, $wgRequest, $wgTitle, $wgAllowUserCss;
$s = '';
if( $wgAllowUserCss && $wgUser->isLoggedIn() ) { # logged in
+ # FIXME: $action undefined, bug #4940
if($wgTitle->isCssSubpage() && $this->userCanPreview( $action ) ) {
$s .= $wgRequest->getText('wpTextbox1');
} else {
if( count( $wgOut->mCategoryLinks ) == 0 ) return '';
+ # Separator
+ $sep = wfMsgHtml( 'catseparator' );
+
// Use Unicode bidi embedding override characters,
// to make sure links don't smash each other up in ugly ways.
$dir = $wgContLang->isRTL() ? 'rtl' : 'ltr';
$embed = "<span dir='$dir'>";
$pop = '</span>';
- $t = $embed . implode ( "$pop | $embed" , $wgOut->mCategoryLinks ) . $pop;
+ $t = $embed . implode ( "{$pop} {$sep} {$embed}" , $wgOut->mCategoryLinks ) . $pop;
- $msg = count( $wgOut->mCategoryLinks ) === 1 ? 'categories1' : 'categories';
+ $msg = wfMsgExt('categories', array('parsemag', 'escape'), count( $wgOut->mCategoryLinks ));
$s = $this->makeKnownLinkObj( Title::makeTitle( NS_SPECIAL, 'Categories' ),
- wfMsg( $msg ), 'article=' . urlencode( $wgTitle->getPrefixedDBkey() ) )
+ $msg, 'article=' . urlencode( $wgTitle->getPrefixedDBkey() ) )
. ': ' . $t;
# optional 'dmoz-like' category browser. Will be shown under the list
}
/** Render the array as a serie of links.
- * @param array $tree Categories tree returned by Title::getParentCategoryTree
- * @param object &skin Skin passed by reference
- * @return string separated by >, terminate with "\n"
+ * @param $tree Array: categories tree returned by Title::getParentCategoryTree
+ * @param &skin Object: skin passed by reference
+ * @return String separated by >, terminate with "\n"
*/
function drawCategoryBrowser($tree, &$skin) {
$return = '';
}
/**
- * This gets called immediately before the </body> tag.
- * @return string HTML to be put after </body> ???
+ * 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 wfMsg( $msg,
$this->makeKnownLink(
$wgContLang->SpecialPage( 'Undelete/' . $wgTitle->getPrefixedDBkey() ),
- wfMsg( 'restorelink' . ($n == 1 ? '1' : ''), $n ) ) );
+ wfMsgExt( 'restorelink', array( 'parsemag', 'escape' ), $n ) ) );
}
return '';
}
function pageTitle() {
global $wgOut;
-
$s = '<h1 class="pagetitle">' . htmlspecialchars( $wgOut->getPageTitle() ) . '</h1>';
return $s;
}
if ( !$wgDisableCounters ) {
$count = $wgLang->formatNum( $wgArticle->getCount() );
if ( $count ) {
- $s = wfMsg( 'viewcount', $count );
+ $s = wfMsgExt( 'viewcount', array( 'parseinline' ), $count );
}
}
* This may include an 'oldid' specifier, if the current page view is such.
*
* @return string
- * @access private
+ * @private
*/
function editUrlOptions() {
global $wgArticle;
$text = wfMsg('userpage');
break;
case NS_PROJECT:
- $text = wfMsg('wikipediapage');
+ $text = wfMsg('projectpage');
break;
case NS_IMAGE:
$text = wfMsg('imagepage');
}
function commentLink() {
- global $wgTitle;
+ global $wgTitle, $wgOut;
if ( $wgTitle->getNamespace() == NS_SPECIAL ) {
return '';
}
- return $this->makeKnownLinkObj( $wgTitle->getTalkPage(),
- wfMsg( 'postcomment' ), 'action=edit§ion=new' );
+
+ # __NEWSECTIONLINK___ changes behaviour here
+ # If it's present, the link points to this page, otherwise
+ # it points to the talk page
+ if( $wgTitle->isTalkPage() ) {
+ $title =& $wgTitle;
+ } elseif( $wgOut->showNewSectionLink() ) {
+ $title =& $wgTitle;
+ } else {
+ $title =& $wgTitle->getTalkPage();
+ }
+
+ return $this->makeKnownLinkObj( $title, wfMsg( 'postcomment' ), 'action=edit§ion=new' );
}
/* these are used extensively in SkinTemplate, but also some other places */
* Build an array that represents the sidebar(s), the navigation bar among them
*
* @return array
- * @access private
+ * @private
*/
function buildSidebar() {
- global $wgDBname, $parserMemc;
+ global $wgDBname, $parserMemc, $wgEnableSidebarCache;
global $wgLanguageCode, $wgContLanguageCode;
$fname = 'SkinTemplate::buildSidebar';
wfProfileIn( $fname );
- if ($wgLanguageCode == $wgContLanguageCode)
- $cacheSidebar = true;
- else
- $cacheSidebar = false;
+ $key = "{$wgDBname}:sidebar";
+ $cacheSidebar = $wgEnableSidebarCache &&
+ ($wgLanguageCode == $wgContLanguageCode);
if ($cacheSidebar) {
- $cachedsidebar=$parserMemc->get("{$wgDBname}:sidebar");
+ $cachedsidebar = $parserMemc->get( $key );
if ($cachedsidebar!="") {
wfProfileOut($fname);
return $cachedsidebar;
}
}
if ($cacheSidebar)
- $cachednotice=$parserMemc->set("{$wgDBname}:sidebar",$bar,86400);
+ $cachednotice = $parserMemc->set( $key, $bar, 86400 );
wfProfileOut( $fname );
return $bar;
}