/**
* The main skin class which provides methods and properties for all other skins.
- * This base class is also the "Standard" skin.
*
* See docs/skin.txt for more information.
*
* @ingroup Skins
*/
abstract class Skin extends ContextSource {
- protected $skinname = 'standard';
+ protected $skinname = null;
protected $mRelevantTitle = null;
protected $mRelevantUser = null;
static function getSkinNameMessages() {
$messages = array();
foreach ( self::getSkinNames() as $skinKey => $skinName ) {
- // Messages: skinname-cologneblue, skinname-monobook, skinname-modern, skinname-vector
+ // Messages: skinname-vector, skinname-monobook
$messages[] = "skinname-$skinKey";
}
return $messages;
/**
* Normalize a skin preference value to a form that can be loaded.
* If a skin can't be found, it will fall back to the configured
- * default (or the old 'Classic' skin if that's broken).
- * @param string $key 'monobook', 'standard', etc.
+ * default, or the hardcoded default if that's broken.
+ * @param string $key 'monobook', 'vector', etc.
* @return string
*/
static function normalizeKey( $key ) {
/**
* Factory method for loading a skin of a given type
- * @param string $key 'monobook', 'standard', etc.
+ * @param string $key 'monobook', 'vector', etc.
* @return Skin
*/
static function &newFromKey( $key ) {
function printSource() {
$oldid = $this->getRevisionId();
if ( $oldid ) {
- $url = htmlspecialchars( wfExpandIRI( $this->getTitle()->getCanonicalURL( 'oldid=' . $oldid ) ) );
+ $canonicalUrl = $this->getTitle()->getCanonicalURL( 'oldid=' . $oldid );
+ $url = htmlspecialchars( wfExpandIRI( $canonicalUrl ) );
} else {
// oldid not available for non existing pages
$url = htmlspecialchars( wfExpandIRI( $this->getTitle()->getCanonicalURL() ) );
}
- return $this->msg( 'retrievedfrom', '<a dir="ltr" href="' . $url . '">' . $url . '</a>' )->text();
+
+ return $this->msg( 'retrievedfrom', '<a dir="ltr" href="' . $url
+ . '">' . $url . '</a>' )->text();
}
/**
* @return string
*/
function subPageSubtitle() {
- global $wgLang;
$out = $this->getOutput();
$subpages = '';
$c = 0;
$growinglink = '';
$display = '';
+ $lang = $this->getLanguage();
foreach ( $links as $link ) {
$growinglink .= $link;
$c++;
if ( $c > 1 ) {
- $subpages .= $wgLang->getDirMarkEntity() . $this->msg( 'pipe-separator' )->escaped();
+ $subpages .= $lang->getDirMarkEntity() . $this->msg( 'pipe-separator' )->escaped();
} else {
$subpages .= '< ';
}
global $wgRightsPage, $wgRightsUrl, $wgRightsText, $wgContLang;
if ( $type == 'detect' ) {
- if ( !$this->isRevisionCurrent() && !$this->msg( 'history_copyright' )->inContentLanguage()->isDisabled() ) {
+ if ( !$this->isRevisionCurrent()
+ && !$this->msg( 'history_copyright' )->inContentLanguage()->isDisabled()
+ ) {
$type = 'history';
} else {
$type = 'normal';
}
// Allow for site and per-namespace customization of copyright notice.
+ // @todo Remove deprecated $forContent param from hook handlers and then remove here.
$forContent = true;
- wfRunHooks( 'SkinCopyrightFooter', array( $this->getTitle(), $type, &$msg, &$link, &$forContent ) );
+ wfRunHooks(
+ 'SkinCopyrightFooter',
+ array( $this->getTitle(), $type, &$msg, &$link, &$forContent )
+ );
- $msgObj = $this->msg( $msg )->rawParams( $link );
- if ( $forContent ) {
- $msg = $msgObj->inContentLanguage()->text();
- if ( $this->getLanguage()->getCode() !== $wgContLang->getCode() ) {
- $msg = Html::rawElement( 'span', array( 'lang' => $wgContLang->getHtmlCode(), 'dir' => $wgContLang->getDir() ), $msg );
- }
- return $msg;
- } else {
- return $msgObj->text();
- }
+ return $this->msg( $msg )->rawParams( $link )->text();
}
/**
global $wgStylePath;
$url = htmlspecialchars( "$wgStylePath/common/images/poweredby_mediawiki_88x31.png" );
- $text = '<a href="//www.mediawiki.org/"><img src="' . $url . '" height="31" width="88" alt="Powered by MediaWiki" /></a>';
+ $text = '<a href="//www.mediawiki.org/"><img src="' . $url
+ . '" height="31" width="88" alt="Powered by MediaWiki" /></a>';
wfRunHooks( 'SkinGetPoweredBy', array( &$text, $this ) );
return $text;
}
/**
* Renders a $wgFooterIcons icon according to the method's arguments
- * @param array $icon The icon to build the html for, see $wgFooterIcons for the format of this array
- * @param bool|string $withImage Whether to use the icon's image or output a text-only footericon
+ * @param array $icon The icon to build the html for, see $wgFooterIcons
+ * for the format of this array.
+ * @param bool|string $withImage Whether to use the icon's image or output
+ * a text-only footericon.
* @return string HTML
*/
function makeFooterIcon( $icon, $withImage = 'withImage' ) {
$url = isset( $icon["url"] ) ? $icon["url"] : null;
unset( $icon["url"] );
if ( isset( $icon["src"] ) && $withImage === 'withImage' ) {
- $html = Html::element( 'img', $icon ); // do this the lazy way, just pass icon data as an attribute array
+ // do this the lazy way, just pass icon data as an attribute array
+ $html = Html::element( 'img', $icon );
} else {
$html = htmlspecialchars( $icon["alt"] );
}
} else {
$targetUser = User::newFromId( $id );
}
- return $this->getUser()->canSendEmail() && # the sending user must have a confirmed email address
- $targetUser->canReceiveEmail(); # the target user must have a confirmed email address and allow emails from users
+
+ # The sending user must have a confirmed email address and the target
+ # user must have a confirmed email address and allow emails from users.
+ return $this->getUser()->canSendEmail() &&
+ $targetUser->canReceiveEmail();
}
/**
if ( $wgEnableSidebarCache ) {
$cachedsidebar = $wgMemc->get( $key );
if ( $cachedsidebar ) {
+ wfRunHooks( 'SidebarBeforeOutput', array( $this, &$cachedsidebar ) );
+
wfProfileOut( __METHOD__ );
return $cachedsidebar;
}
$wgMemc->set( $key, $bar, $wgSidebarCacheExpiry );
}
+ wfRunHooks( 'SidebarBeforeOutput', array( $this, &$bar ) );
+
wfProfileOut( __METHOD__ );
return $bar;
}