/**
* Fetch the set of available skins.
- * @return array associative array of strings
+ * @return array Associative array of strings
*/
static function getSkinNames() {
global $wgValidSkinNames;
/**
* Fetch the skinname messages for available skins.
- * @return array of strings
+ * @return string[]
*/
static function getSkinNameMessages() {
$messages = array();
* Useful for Special:Preferences and other places where you
* only want to show skins users _can_ use.
* @return string[]
+ * @since 1.23
*/
public static function getAllowedSkins() {
global $wgSkipSkins;
}
/**
- * @deprecated since 1.22, use getAllowedSkins
+ * @deprecated since 1.23, use getAllowedSkins
* @return string[]
*/
public static function getUsableSkins() {
- wfDeprecated( __METHOD__, '1.22' );
+ wfDeprecated( __METHOD__, '1.23' );
return self::getAllowedSkins();
}
}
/**
- * @return string skin name
+ * @return string Skin name
*/
public function getSkinName() {
return $this->skinname;
}
/**
- * @param $out OutputPage
+ * @param OutputPage $out
*/
function initPage( OutputPage $out ) {
wfProfileIn( __METHOD__ );
* Defines the ResourceLoader modules that should be added to the skin
* It is recommended that skins wishing to override call parent::getDefaultModules()
* and substitute out any modules they wish to change by using a key to look them up
- * @return Array of modules with helper keys for easy overriding
+ * @return array Array of modules with helper keys for easy overriding
*/
public function getDefaultModules() {
global $wgIncludeLegacyJavaScript, $wgPreloadJavaScriptMwUtil, $wgUseAjax,
/**
* Get the current revision ID
*
- * @return Integer
+ * @return int
*/
public function getRevisionId() {
return $this->getOutput()->getRevisionId();
/**
* Whether the revision displayed is the latest revision of the page
*
- * @return Boolean
+ * @return bool
*/
public function isRevisionCurrent() {
$revID = $this->getRevisionId();
/**
* Set the "relevant" title
* @see self::getRelevantTitle()
- * @param $t Title object to use
+ * @param Title $t
*/
public function setRelevantTitle( $t ) {
$this->mRelevantTitle = $t;
/**
* Set the "relevant" user
* @see self::getRelevantUser()
- * @param $u User object to use
+ * @param User $u
*/
public function setRelevantUser( $u ) {
$this->mRelevantUser = $u;
/**
* Outputs the HTML generated by other functions.
- * @param $out OutputPage
+ * @param OutputPage $out
*/
abstract function outputPage( OutputPage $out = null );
/**
- * @param $data array
+ * @param array $data
* @return string
*/
static function makeVariablesScript( $data ) {
/**
* Make a "<script>" tag containing global variables
*
- * @deprecated in 1.19
- * @param $unused
+ * @deprecated since 1.19
+ * @param mixed $unused
* @return string HTML fragment
*/
public static function makeGlobalVariablesScript( $unused ) {
* Calling this method with an $out of anything but the same OutputPage
* inside ->getOutput() is deprecated. The $out arg is kept
* for compatibility purposes with skins.
- * @param $out OutputPage
+ * @param OutputPage $out
* @todo delete
*/
abstract function setupSkinUserCss( OutputPage $out );
/**
* TODO: document
- * @param $title Title
- * @return String
+ * @param Title $title
+ * @return string
*/
function getPageClasses( $title ) {
$numeric = 'ns-' . $title->getNamespace();
* This will be called by OutputPage::headElement when it is creating the
* "<body>" tag, skins can override it if they have a need to add in any
* body attributes or classes of their own.
- * @param $out OutputPage
- * @param $bodyAttrs Array
+ * @param OutputPage $out
+ * @param array $bodyAttrs
*/
function addToBodyAttributes( $out, &$bodyAttrs ) {
// does nothing by default
/**
* URL to the logo
- * @return String
+ * @return string
*/
function getLogo() {
global $wgLogo;
/**
* Render the array as a series of links.
- * @param array $tree categories tree returned by Title::getParentCategoryTree
- * @return String separated by >, terminate with "\n"
+ * @param array $tree Categories tree returned by Title::getParentCategoryTree
+ * @return string Separated by >, terminate with "\n"
*/
function drawCategoryBrowser( $tree ) {
$return = '';
* The output of this function gets processed in SkinTemplate::outputPage() for
* the SkinTemplate based skins, all other skins should directly echo it.
*
- * @return String, empty by default, if not changed by any hook function.
+ * @return string Empty by default, if not changed by any hook function.
*/
protected function afterContentHook() {
$data = '';
/**
* Generate debug data HTML for displaying at the bottom of the main content
* area.
- * @return String HTML containing debug data, if enabled (otherwise empty).
+ * @return string HTML containing debug data, if enabled (otherwise empty).
*/
protected function generateDebugHTML() {
return MWDebug::getHTMLDebugLog();
/**
* This gets called shortly before the "</body>" tag.
*
- * @return String HTML-wrapped JS code to be put before "</body>"
+ * @return string HTML-wrapped JS code to be put before "</body>"
*/
function bottomScripts() {
// TODO and the suckage continues. This function is really just a wrapper around
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 href="' . $url . '">' . $url . '</a>' )->text();
+
+ return $this->msg( 'retrievedfrom', '<a dir="ltr" href="' . $url
+ . '">' . $url . '</a>' )->text();
}
/**
- * @return String
+ * @return string
*/
function getUndeleteLink() {
$action = $this->getRequest()->getVal( 'action', 'view' );
/**
* Returns true if the IP should be shown in the header
- * @return Bool
+ * @return bool
*/
function showIPinHeader() {
global $wgShowIPinHeader;
}
/**
- * @return String
+ * @return string
*/
function getSearchLink() {
$searchPage = SpecialPage::getTitleFor( 'Search' );
}
/**
- * @param $type string
+ * @param string $type
* @return string
*/
function getCopyright( $type = 'detect' ) {
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.
$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 );
+ $msg = Html::rawElement( 'span', array(
+ 'lang' => $wgContLang->getHtmlCode(),
+ 'dir' => $wgContLang->getDir()
+ ), $msg );
}
+
return $msg;
} else {
return $msgObj->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;
}
/**
* Get the timestamp of the latest revision, formatted in user language
*
- * @return String
+ * @return string
*/
protected function lastModified() {
$timestamp = $this->getOutput()->getRevisionTimestamp();
}
/**
- * @param $align string
+ * @param string $align
* @return string
*/
function logoText( $align = '' ) {
/**
* 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
- * @return String HTML
+ * @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' ) {
if ( is_string( $icon ) ) {
$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"] );
}
/**
* Gets the link to the wiki's privacy policy page.
- * @return String HTML
+ * @return string HTML
*/
function privacyLink() {
return $this->footerLink( 'privacy', 'privacypage' );
/**
* Gets the link to the wiki's about page.
- * @return String HTML
+ * @return string HTML
*/
function aboutLink() {
return $this->footerLink( 'aboutsite', 'aboutpage' );
/**
* Gets the link to the wiki's general disclaimers page.
- * @return String HTML
+ * @return string HTML
*/
function disclaimerLink() {
return $this->footerLink( 'disclaimers', 'disclaimerpage' );
}
/**
- * @param $id User|int
+ * @param User|int $id
* @return bool
*/
function showEmailUser( $id ) {
} 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();
}
/**
* This method returns a url resolved using the configured skin style path
* and includes the style version inside of the url.
* @param string $name The name or path of a skin resource file
- * @return String The fully resolved style path url including styleversion
+ * @return string The fully resolved style path url including styleversion
*/
function getCommonStylePath( $name ) {
global $wgStylePath, $wgStyleVersion;
* This method returns a url resolved using the configured skin style path
* and includes the style version inside of the url.
* @param string $name The name or path of a skin resource file
- * @return String The fully resolved style path url including styleversion
+ * @return string The fully resolved style path url including styleversion
*/
function getSkinStylePath( $name ) {
global $wgStylePath, $wgStyleVersion;
/* these are used extensively in SkinTemplate, but also some other places */
/**
- * @param $urlaction string
- * @return String
+ * @param string $urlaction
+ * @return string
*/
static function makeMainPageUrl( $urlaction = '' ) {
$title = Title::newMainPage();
*
* @param string $name Name of the Special page
* @param string $urlaction Query to append
- * @param $proto Protocol to use or null for a local URL
- * @return String
+ * @param string|null $proto Protocol to use or null for a local URL
+ * @return string
*/
static function makeSpecialUrl( $name, $urlaction = '', $proto = null ) {
$title = SpecialPage::getSafeTitleFor( $name );
}
/**
- * @param $name string
- * @param $subpage string
- * @param $urlaction string
- * @return String
+ * @param string $name
+ * @param string $subpage
+ * @param string $urlaction
+ * @return string
*/
static function makeSpecialUrlSubpage( $name, $subpage, $urlaction = '' ) {
$title = SpecialPage::getSafeTitleFor( $name, $subpage );
}
/**
- * @param $name string
- * @param $urlaction string
- * @return String
+ * @param string $name
+ * @param string $urlaction
+ * @return string
*/
static function makeI18nUrl( $name, $urlaction = '' ) {
$title = Title::newFromText( wfMessage( $name )->inContentLanguage()->text() );
}
/**
- * @param $name string
- * @param $urlaction string
- * @return String
+ * @param string $name
+ * @param string $urlaction
+ * @return string
*/
static function makeUrl( $name, $urlaction = '' ) {
$title = Title::newFromText( $name );
/**
* If url string starts with http, consider as external URL, else
* internal
- * @param $name String
- * @return String URL
+ * @param string $name
+ * @return string URL
*/
static function makeInternalOrExternalUrl( $name ) {
if ( preg_match( '/^(?i:' . wfUrlProtocols() . ')/', $name ) ) {
/**
* this can be passed the NS number as defined in Language.php
- * @param $name
- * @param $urlaction string
- * @param $namespace int
- * @return String
+ * @param string $name
+ * @param string $urlaction
+ * @param int $namespace
+ * @return string
*/
static function makeNSUrl( $name, $urlaction = '', $namespace = NS_MAIN ) {
$title = Title::makeTitleSafe( $namespace, $name );
/**
* these return an array with the 'href' and boolean 'exists'
- * @param $name
- * @param $urlaction string
+ * @param string $name
+ * @param string $urlaction
* @return array
*/
static function makeUrlDetails( $name, $urlaction = '' ) {
/**
* Make URL details where the article exists (or at least it's convenient to think so)
* @param string $name Article name
- * @param $urlaction String
- * @return Array
+ * @param string $urlaction
+ * @return array
*/
static function makeKnownUrlDetails( $name, $urlaction = '' ) {
$title = Title::newFromText( $name );
/**
* make sure we have some title to operate on
*
- * @param $title Title
- * @param $name string
+ * @param Title $title
+ * @param string $name
*/
static function checkTitle( &$title, $name ) {
if ( !is_object( $title ) ) {
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;
}
*
* This is just a wrapper around addToSidebarPlain() for backwards compatibility
*
- * @param $bar array
- * @param $message String
+ * @param array $bar
+ * @param string $message
*/
function addToSidebar( &$bar, $message ) {
$this->addToSidebarPlain( $bar, wfMessage( $message )->inContentLanguage()->plain() );
/**
* Add content from plain text
* @since 1.17
- * @param $bar array
- * @param $text string
- * @return Array
+ * @param array $bar
+ * @param string $text
+ * @return array
*/
function addToSidebarPlain( &$bar, $text ) {
$lines = explode( "\n", $text );
/**
* Gets new talk page messages for the current user and returns an
* appropriate alert message (or an empty string if there are no messages)
- * @return String
+ * @return string
*/
function getNewtalks() {
/**
* Get a cached notice
*
- * @param string $name message name, or 'default' for $wgSiteNotice
- * @return String: HTML fragment
+ * @param string $name Message name, or 'default' for $wgSiteNotice
+ * @return string HTML fragment
*/
private function getCachedNotice( $name ) {
global $wgRenderHashAppend, $parserMemc, $wgContLang;
/**
* Get a notice based on page's namespace
*
- * @return String: HTML fragment
+ * @return string HTML fragment
*/
function getNamespaceNotice() {
wfProfileIn( __METHOD__ );
/**
* Get the site notice
*
- * @return String: HTML fragment
+ * @return string HTML fragment
*/
function getSiteNotice() {
wfProfileIn( __METHOD__ );
* Create a section edit link. This supersedes editSectionLink() and
* editSectionLinkForOther().
*
- * @param $nt Title The title being linked to (may not be the same as
+ * @param Title $nt The title being linked to (may not be the same as
* the current page, if the section is included from a template)
* @param string $section The designation of the section being pointed to,
* to be included in the link, like "§ion=$section"
* @param string $tooltip The tooltip to use for the link: will be escaped
* and wrapped in the 'editsectionhint' message
- * @param $lang string Language code
+ * @param string $lang Language code
* @return string HTML to use for edit link
*/
public function doEditSectionLink( Title $nt, $section, $tooltip = null, $lang = false ) {