* @todo document
*/
class OutputPage extends ContextSource {
- /// Should be private. Used with addMeta() which adds "<meta>"
- var $mMetatags = array();
+ /** @var array Should be private. Used with addMeta() which adds "<meta>" */
+ protected $mMetatags = array();
- var $mLinktags = array();
- var $mCanonicalUrl = false;
+ /** @var array */
+ protected $mLinktags = array();
- /// Additional stylesheets. Looks like this is for extensions. Might be replaced by resource loader.
- var $mExtStyles = array();
+ /** @var bool */
+ protected $mCanonicalUrl = false;
- /// Should be private - has getter and setter. Contains the HTML title
- var $mPagetitle = '';
+ /**
+ * @var array Additional stylesheets. Looks like this is for extensions.
+ * Might be replaced by resource loader.
+ */
+ protected $mExtStyles = array();
+
+ /**
+ * @var string Should be private - has getter and setter. Contains
+ * the HTML title */
+ public $mPagetitle = '';
- /// Contains all of the "<body>" content. Should be private we got set/get accessors and the append() method.
- var $mBodytext = '';
+ /**
+ * @var string Contains all of the "<body>" content. Should be private we
+ * got set/get accessors and the append() method.
+ */
+ public $mBodytext = '';
/**
* Holds the debug lines that will be output as comments in page source if
*/
public $mDebugtext = '';
- /// Should be private. Stores contents of "<title>" tag
- var $mHTMLtitle = '';
-
- /// Should be private. Is the displayed content related to the source of the corresponding wiki article.
- var $mIsarticle = false;
+ /** @var string Stores contents of "<title>" tag */
+ private $mHTMLtitle = '';
/**
- * Should be private. Has get/set methods properly documented.
- * Stores "article flag" toggle.
+ * @var bool Is the displayed content related to the source of the
+ * corresponding wiki article.
*/
- var $mIsArticleRelated = true;
+ private $mIsarticle = false;
+
+ /** @var bool Stores "article flag" toggle. */
+ private $mIsArticleRelated = true;
/**
- * Should be private. We have to set isPrintable(). Some pages should
+ * @var bool We have to set isPrintable(). Some pages should
* never be printed (ex: redirections).
*/
- var $mPrintable = false;
+ private $mPrintable = false;
/**
- * Should be private. We have set/get/append methods.
- *
- * Contains the page subtitle. Special pages usually have some links here.
- * Don't confuse with site subtitle added by skins.
+ * @var array Contains the page subtitle. Special pages usually have some
+ * links here. Don't confuse with site subtitle added by skins.
*/
private $mSubtitle = array();
- var $mRedirect = '';
- var $mStatusCode;
+ /** @var string */
+ public $mRedirect = '';
+
+ /** @var int */
+ protected $mStatusCode;
/**
- * mLastModified and mEtag are used for sending cache control.
- * The whole caching system should probably be moved into its own class.
+ * @ var string mLastModified and mEtag are used for sending cache control.
+ * The whole caching system should probably be moved into its own class.
*/
- var $mLastModified = '';
+ protected $mLastModified = '';
/**
- * Should be private. No getter but used in sendCacheControl();
* Contains an HTTP Entity Tags (see RFC 2616 section 3.13) which is used
* as a unique identifier for the content. It is later used by the client
* to compare its cached version with the server version. Client sends
* To get more information, you will have to look at HTTP/1.1 protocol which
* is properly described in RFC 2616 : http://tools.ietf.org/html/rfc2616
*/
- var $mETag = false;
+ private $mETag = false;
+
+ /** @var array */
+ protected $mCategoryLinks = array();
- var $mCategoryLinks = array();
- var $mCategories = array();
+ /** @var array */
+ protected $mCategories = array();
- /// Should be private. Array of Interwiki Prefixed (non DB key) Titles (e.g. 'fr:Test page')
- var $mLanguageLinks = array();
+ /** @var array Array of Interwiki Prefixed (non DB key) Titles (e.g. 'fr:Test page') */
+ private $mLanguageLinks = array();
/**
- * Should be private. Used for JavaScript (pre resource loader)
- * We should split js / css.
+ * Used for JavaScript (pre resource loader)
+ * @todo We should split JS / CSS.
* mScripts content is inserted as is in "<head>" by Skin. This might
- * contains either a link to a stylesheet or inline css.
+ * contain either a link to a stylesheet or inline CSS.
*/
- var $mScripts = '';
+ private $mScripts = '';
- /**
- * Inline CSS styles. Use addInlineStyle() sparingly
- */
- var $mInlineStyles = '';
+ /** @var string Inline CSS styles. Use addInlineStyle() sparingly */
+ protected $mInlineStyles = '';
- //
- var $mLinkColours;
+ /** @todo Unused? */
+ private $mLinkColours;
/**
- * Used by skin template.
+ * @var string Used by skin template.
* Example: $tpl->set( 'displaytitle', $out->mPageLinkTitle );
*/
- var $mPageLinkTitle = '';
+ public $mPageLinkTitle = '';
+
+ /** @var array Array of elements in "<head>". Parser might add its own headers! */
+ protected $mHeadItems = array();
+
+ // @todo FIXME: Next 5 variables probably come from the resource loader
+
+ /** @var array */
+ protected $mModules = array();
+
+ /** @var array */
+ protected $mModuleScripts = array();
+
+ /** @var array */
+ protected $mModuleStyles = array();
- /// Array of elements in "<head>". Parser might add its own headers!
- var $mHeadItems = array();
+ /** @var array */
+ protected $mModuleMessages = array();
- // @todo FIXME: Next variables probably comes from the resource loader
- var $mModules = array(), $mModuleScripts = array(), $mModuleStyles = array(), $mModuleMessages = array();
- var $mResourceLoader;
- var $mJsConfigVars = array();
+ /** @var ResourceLoader */
+ protected $mResourceLoader;
- /** @todo FIXME: Is this still used ?*/
- var $mInlineMsg = array();
+ /** @var array */
+ protected $mJsConfigVars = array();
- var $mTemplateIds = array();
- var $mImageTimeKeys = array();
+ /** @var array */
+ protected $mTemplateIds = array();
- var $mRedirectCode = '';
+ /** @var array */
+ protected $mImageTimeKeys = array();
- var $mFeedLinksAppendQuery = null;
+ /** @var string */
+ public $mRedirectCode = '';
- # What level of 'untrustworthiness' is allowed in CSS/JS modules loaded on this page?
- # @see ResourceLoaderModule::$origin
- # ResourceLoaderModule::ORIGIN_ALL is assumed unless overridden;
+ protected $mFeedLinksAppendQuery = null;
+
+ /** @var array
+ * What level of 'untrustworthiness' is allowed in CSS/JS modules loaded on this page?
+ * @see ResourceLoaderModule::$origin
+ * ResourceLoaderModule::ORIGIN_ALL is assumed unless overridden;
+ */
protected $mAllowedModules = array(
ResourceLoaderModule::TYPE_COMBINED => ResourceLoaderModule::ORIGIN_ALL,
);
+ /** @var bool Whether output is disabled. If this is true, the 'output' method will do nothing. */
+ protected $mDoNothing = false;
+
+ // Parser related.
+
/**
- * Whether output is disabled. If this is true, the 'output' method will do nothing.
- *
- * @var bool $mDoNothing
+ * @var int
+ * @todo Unused?
*/
- var $mDoNothing = false;
+ private $mContainsOldMagic = 0;
- // Parser related.
- var $mContainsOldMagic = 0, $mContainsNewMagic = 0;
+ /** @var int */
+ protected $mContainsNewMagic = 0;
/**
* lazy initialised, use parserOptions()
protected $mParserOptions = null;
/**
- * Handles the atom / rss links.
- * We probably only support atom in 2011.
- * Looks like a private variable.
+ * Handles the Atom / RSS links.
+ * We probably only support Atom in 2011.
* @see $wgAdvertisedFeedTypes
*/
- var $mFeedLinks = array();
+ private $mFeedLinks = array();
// Gwicke work on squid caching? Roughly from 2003.
- var $mEnableClientCache = true;
+ protected $mEnableClientCache = true;
- /**
- * Flag if output should only contain the body of the article.
- * Should be private.
- */
- var $mArticleBodyOnly = false;
+ /** @var bool Flag if output should only contain the body of the article. */
+ private $mArticleBodyOnly = false;
+
+ /** @var bool */
+ protected $mNewSectionLink = false;
- var $mNewSectionLink = false;
- var $mHideNewSectionLink = false;
+ /** @var bool */
+ protected $mHideNewSectionLink = false;
/**
- * Comes from the parser. This was probably made to load CSS/JS only
- * if we had "<gallery>". Used directly in CategoryPage.php
+ * @var bool Comes from the parser. This was probably made to load CSS/JS
+ * only if we had "<gallery>". Used directly in CategoryPage.php.
* Looks like resource loader can replace this.
*/
- var $mNoGallery = false;
+ public $mNoGallery = false;
+
+ /** @var string */
+ private $mPageTitleActionText = '';
- // should be private.
- var $mPageTitleActionText = '';
- var $mParseWarnings = array();
+ /** @var array */
+ private $mParseWarnings = array();
- // Cache stuff. Looks like mEnableClientCache
- var $mSquidMaxage = 0;
+ /** @var int Cache stuff. Looks like mEnableClientCache */
+ protected $mSquidMaxage = 0;
- // @todo document
- var $mPreventClickjacking = true;
+ /**
+ * @var bool
+ * @todo Document
+ */
+ protected $mPreventClickjacking = true;
+
+ /** @var int To include the variable {{REVISIONID}} */
+ private $mRevisionId = null;
- /// should be private. To include the variable {{REVISIONID}}
- var $mRevisionId = null;
+ /** @var string */
private $mRevisionTimestamp = null;
- var $mFileVersion = null;
+ /** @var array */
+ protected $mFileVersion = null;
/**
- * An array of stylesheet filenames (relative from skins path), with options
- * for CSS media, IE conditions, and RTL/LTR direction.
+ * @var array An array of stylesheet filenames (relative from skins path),
+ * with options for CSS media, IE conditions, and RTL/LTR direction.
* For internal use; add settings in the skin via $this->addStyle()
*
* Style again! This seems like a code duplication since we already have
- * mStyles. This is what makes OpenSource amazing.
+ * mStyles. This is what makes Open Source amazing.
*/
- var $styles = array();
+ protected $styles = array();
/**
* Whether jQuery is already handled.
* @param string $type
* @return array
*/
- protected function filterModules( $modules, $position = null, $type = ResourceLoaderModule::TYPE_COMBINED ) {
+ protected function filterModules( $modules, $position = null,
+ $type = ResourceLoaderModule::TYPE_COMBINED
+ ) {
$resourceLoader = $this->getResourceLoader();
$filteredModules = array();
foreach ( $modules as $val ) {
$clientHeaderTime = strtotime( $clientHeader );
wfRestoreWarnings();
if ( !$clientHeaderTime ) {
- wfDebug( __METHOD__ . ": unable to parse the client's If-Modified-Since header: $clientHeader\n" );
+ wfDebug( __METHOD__
+ . ": unable to parse the client's If-Modified-Since header: $clientHeader\n" );
return false;
}
$clientHeaderTime = wfTimestamp( TS_MW, $clientHeaderTime );
}
/**
- * "Page title" means the contents of \<h1\>. It is stored as a valid HTML fragment.
- * This function allows good tags like \<sup\> in the \<h1\> tag, but not bad tags like \<script\>.
- * This function automatically sets \<title\> to the same content as \<h1\> but with all tags removed.
- * Bad tags that were escaped in \<h1\> will still be escaped in \<title\>, and good tags like \<i\> will be dropped entirely.
+ * "Page title" means the contents of \<h1\>. It is stored as a valid HTML
+ * fragment. This function allows good tags like \<sup\> in the \<h1\> tag,
+ * but not bad tags like \<script\>. This function automatically sets
+ * \<title\> to the same content as \<h1\> but with all tags removed. Bad
+ * tags that were escaped in \<h1\> will still be escaped in \<title\>, and
+ * good tags like \<i\> will be dropped entirely.
*
* @param string|Message $name
*/
if ( $title->isRedirect() ) {
$query['redirect'] = 'no';
}
- $this->addSubtitle( $this->msg( 'backlinksubtitle' )->rawParams( Linker::link( $title, null, array(), $query ) ) );
+ $this->addSubtitle( $this->msg( 'backlinksubtitle' )
+ ->rawParams( Linker::link( $title, null, array(), $query ) ) );
}
/**
# Fetch existence plus the hiddencat property
$dbr = wfGetDB( DB_SLAVE );
$res = $dbr->select( array( 'page', 'page_props' ),
- array( 'page_id', 'page_namespace', 'page_title', 'page_len', 'page_is_redirect', 'page_latest', 'pp_value' ),
+ array( 'page_id', 'page_namespace', 'page_title', 'page_len',
+ 'page_is_redirect', 'page_latest', 'pp_value' ),
$lb->constructSet( 'page', $dbr ),
__METHOD__,
array(),
- array( 'page_props' => array( 'LEFT JOIN', array( 'pp_propname' => 'hiddencat', 'pp_page = page_id' ) ) )
+ array( 'page_props' => array( 'LEFT JOIN', array(
+ 'pp_propname' => 'hiddencat',
+ 'pp_page = page_id'
+ ) ) )
);
# Add the results to the link cache
}
# Add the remaining categories to the skin
- if ( wfRunHooks( 'OutputPageMakeCategoryLinks', array( &$this, $categories, &$this->mCategoryLinks ) ) ) {
+ if ( wfRunHooks(
+ 'OutputPageMakeCategoryLinks',
+ array( &$this, $categories, &$this->mCategoryLinks ) )
+ ) {
foreach ( $categories as $category => $type ) {
$origcategory = $category;
$title = Title::makeTitleSafe( NS_CATEGORY, $category );
*/
public function isUserJsAllowed() {
wfDeprecated( __METHOD__, '1.18' );
- return $this->getAllowedModules( ResourceLoaderModule::TYPE_SCRIPTS ) >= ResourceLoaderModule::ORIGIN_USER_INDIVIDUAL;
+ return $this->getAllowedModules( ResourceLoaderModule::TYPE_SCRIPTS ) >=
+ ResourceLoaderModule::ORIGIN_USER_INDIVIDUAL;
}
/**
* @param bool $interface Whether it is an interface message
* (for example disables conversion)
*/
- public function addWikiTextTitle( $text, Title $title, $linestart, $tidy = false, $interface = false ) {
+ public function addWikiTextTitle( $text, Title $title, $linestart,
+ $tidy = false, $interface = false
+ ) {
global $wgParser;
wfProfileIn( __METHOD__ );
wfDebug( __METHOD__ . ": proxy caching with ESI; {$this->mLastModified} **\n", 'log' );
# start with a shorter timeout for initial testing
# header( 'Surrogate-Control: max-age=2678400+2678400, content="ESI/1.0"');
- $response->header( 'Surrogate-Control: max-age=' . $wgSquidMaxage . '+' . $this->mSquidMaxage . ', content="ESI/1.0"' );
+ $response->header( 'Surrogate-Control: max-age=' . $wgSquidMaxage
+ . '+' . $this->mSquidMaxage . ', content="ESI/1.0"' );
$response->header( 'Cache-Control: s-maxage=0, must-revalidate, max-age=0' );
} else {
# We'll purge the proxy cache for anons explicitly, but require end user agents
wfDebug( __METHOD__ . ": local proxy caching; {$this->mLastModified} **\n", 'log' );
# start with a shorter timeout for initial testing
# header( "Cache-Control: s-maxage=2678400, must-revalidate, max-age=0" );
- $response->header( 'Cache-Control: s-maxage=' . $this->mSquidMaxage . ', must-revalidate, max-age=0' );
+ $response->header( 'Cache-Control: s-maxage=' . $this->mSquidMaxage
+ . ', must-revalidate, max-age=0' );
}
} else {
# We do want clients to cache if they can, but they *must* check for updates
if ( $msg instanceof Message ) {
if ( $params !== array() ) {
- trigger_error( 'Argument ignored: $params. The message parameters argument is discarded when the $msg argument is a Message object instead of a string.', E_USER_NOTICE );
+ trigger_error( 'Argument ignored: $params. The message parameters argument '
+ . 'is discarded when the $msg argument is a Message object instead of '
+ . 'a string.', E_USER_NOTICE );
}
$this->addHTML( $msg->parseAsBlock() );
} else {
*
* @param string $source Source code to show (or null).
* @param bool $protected Is this a permissions error?
- * @param array $reasons List of reasons for this error, as returned by Title::getUserPermissionsErrors().
+ * @param array $reasons List of reasons for this error, as returned by
+ * Title::getUserPermissionsErrors().
* @param string $action Action that was denied or null if unknown
* @throws ReadOnlyError
*/
- public function readOnlyPage( $source = null, $protected = false, $reasons = array(), $action = null ) {
+ public function readOnlyPage( $source = null, $protected = false,
+ $reasons = array(), $action = null
+ ) {
$this->setRobotPolicy( 'noindex,nofollow' );
$this->setArticleRelated( false );
$bodyClasses[] = $sk->getPageClasses( $this->getTitle() );
$bodyClasses[] = 'skin-' . Sanitizer::escapeClass( $sk->getSkinName() );
- $bodyClasses[] = 'action-' . Sanitizer::escapeClass( Action::getActionName( $this->getContext() ) );
+ $bodyClasses[] =
+ 'action-' . Sanitizer::escapeClass( Action::getActionName( $this->getContext() ) );
$bodyAttrs = array();
// While the implode() is not strictly needed, it's used for backwards compatibility
}
/**
- * TODO: Document
+ * @todo Document
* @param array|string $modules One or more module names
* @param string $only ResourceLoaderModule TYPE_ class constant
* @param bool $useESI
- * @param array $extraQuery Array with extra query parameters to add to each request. array( param => value )
- * @param bool $loadCall If true, output an (asynchronous) mw.loader.load() call rather than a "<script src='...'>" tag
+ * @param array $extraQuery Array with extra query parameters to add to each
+ * request. array( param => value ).
+ * @param bool $loadCall If true, output an (asynchronous) mw.loader.load()
+ * call rather than a "<script src='...'>" tag.
* @return string The html "<script>", "<link>" and "<style>" tags
*/
- protected function makeResourceLoaderLink( $modules, $only, $useESI = false, array $extraQuery = array(), $loadCall = false ) {
+ protected function makeResourceLoaderLink( $modules, $only, $useESI = false,
+ array $extraQuery = array(), $loadCall = false
+ ) {
global $wgResourceLoaderUseESI;
$modules = (array)$modules;
return $links;
}
-
if ( count( $modules ) > 1 ) {
// Remove duplicate module requests
$modules = array_unique( $modules );
// Scripts and messages "only" requests marked for top inclusion
// Messages should go first
- $links[] = $this->makeResourceLoaderLink( $this->getModuleMessages( true, 'top' ), ResourceLoaderModule::TYPE_MESSAGES );
- $links[] = $this->makeResourceLoaderLink( $this->getModuleScripts( true, 'top' ), ResourceLoaderModule::TYPE_SCRIPTS );
+ $links[] = $this->makeResourceLoaderLink(
+ $this->getModuleMessages( true, 'top' ),
+ ResourceLoaderModule::TYPE_MESSAGES
+ );
+ $links[] = $this->makeResourceLoaderLink(
+ $this->getModuleScripts( true, 'top' ),
+ ResourceLoaderModule::TYPE_SCRIPTS
+ );
// Modules requests - let the client calculate dependencies and batch requests as it likes
// Only load modules that have marked themselves for loading at the top
}
/**
- * JS stuff to put at the 'bottom', which can either be the bottom of the "<body>"
- * or the bottom of the "<head>" depending on $wgResourceLoaderExperimentalAsyncLoading:
- * modules marked with position 'bottom', legacy scripts ($this->mScripts),
- * user preferences, site JS and user JS.
+ * JS stuff to put at the 'bottom', which can either be the bottom of the
+ * "<body>" or the bottom of the "<head>" depending on
+ * $wgResourceLoaderExperimentalAsyncLoading: modules marked with position
+ * 'bottom', legacy scripts ($this->mScripts), user preferences, site JS
+ * and user JS.
*
- * @param bool $inHead If true, this HTML goes into the "<head>", if false it goes into the "<body>"
+ * @param bool $inHead If true, this HTML goes into the "<head>",
+ * if false it goes into the "<body>".
* @return string
*/
function getScriptsForBottomQueue( $inHead ) {
);
// Add user JS if enabled
- if ( $wgAllowUserJs && $this->getUser()->isLoggedIn() && $this->getTitle() && $this->getTitle()->isJsSubpage() && $this->userCanPreview() ) {
+ if ( $wgAllowUserJs
+ && $this->getUser()->isLoggedIn()
+ && $this->getTitle()
+ && $this->getTitle()->isJsSubpage()
+ && $this->userCanPreview()
+ ) {
# XXX: additional security check/prompt?
// We're on a preview of a JS subpage
// Exclude this page from the user module in case it's in there (bug 26283)
array( 'excludepage' => $this->getTitle()->getPrefixedDBkey() ), $inHead
);
// Load the previewed JS
- $links[] = Html::inlineScript( "\n" . $this->getRequest()->getText( 'wpTextbox1' ) . "\n" ) . "\n";
+ $links[] = Html::inlineScript( "\n"
+ . $this->getRequest()->getText( 'wpTextbox1' ) . "\n" ) . "\n";
// FIXME: If the user is previewing, say, ./vector.js, his ./common.js will be loaded
// asynchronously and may arrive *after* the inline script here. So the previewed code
$title = $this->getTitle();
$ns = $title->getNamespace();
- $canonicalNamespace = MWNamespace::exists( $ns ) ? MWNamespace::getCanonicalName( $ns ) : $title->getNsText();
+ $canonicalNamespace = MWNamespace::exists( $ns )
+ ? MWNamespace::getCanonicalName( $ns )
+ : $title->getNsText();
$sk = $this->getSkin();
// Get the relevant title so that AJAX features can use the correct page name
$relevantUser = $sk->getRelevantUser();
if ( $ns == NS_SPECIAL ) {
- list( $canonicalSpecialPageName, /*...*/ ) = SpecialPageFactory::resolveAlias( $title->getDBkey() );
+ list( $canonicalSpecialPageName, /*...*/ ) =
+ SpecialPageFactory::resolveAlias( $title->getDBkey() );
} elseif ( $this->canUseWikiPage() ) {
$wikiPage = $this->getWikiPage();
$curRevisionId = $wikiPage->getLatest();
'wgMonthNamesShort' => $lang->getMonthAbbreviationsArray(),
'wgRelevantPageName' => $relevantTitle->getPrefixedDBkey(),
);
+
if ( $user->isLoggedIn() ) {
$vars['wgUserId'] = $user->getId();
$vars['wgUserEditCount'] = $user->getEditCount();
// the client side.
$vars['wgUserNewMsgRevisionId'] = $user->getNewMessageRevisionId();
}
+
if ( $wgContLang->hasVariants() ) {
$vars['wgUserVariant'] = $wgContLang->getPreferredVariant();
}
// Same test as SkinTemplate
- $vars['wgIsProbablyEditable'] = $title->quickUserCan( 'edit', $user ) && ( $title->exists() || $title->quickUserCan( 'create', $user ) );
+ $vars['wgIsProbablyEditable'] = $title->quickUserCan( 'edit', $user )
+ && ( $title->exists() || $title->quickUserCan( 'create', $user ) );
+
foreach ( $title->getRestrictionTypes() as $type ) {
$vars['wgRestriction' . ucfirst( $type )] = $title->getRestrictions( $type );
}
+
if ( $title->isMainPage() ) {
$vars['wgIsMainPage'] = true;
}
+
if ( $this->mRedirectedFrom ) {
$vars['wgRedirectedFrom'] = $this->mRedirectedFrom->getPrefixedDBkey();
}
+
if ( $relevantUser ) {
$vars['wgRelevantUserName'] = $relevantUser->getName();
}
# uses whichever one appears later in the HTML source. Make sure
# apple-touch-icon is specified first to avoid this.
if ( $wgAppleTouchIcon !== false ) {
- $tags['apple-touch-icon'] = Html::element( 'link', array( 'rel' => 'apple-touch-icon', 'href' => $wgAppleTouchIcon ) );
+ $tags['apple-touch-icon'] = Html::element( 'link', array(
+ 'rel' => 'apple-touch-icon',
+ 'href' => $wgAppleTouchIcon
+ ) );
}
if ( $wgFavicon !== false ) {
- $tags['favicon'] = Html::element( 'link', array( 'rel' => 'shortcut icon', 'href' => $wgFavicon ) );
+ $tags['favicon'] = Html::element( 'link', array(
+ 'rel' => 'shortcut icon',
+ 'href' => $wgFavicon
+ ) );
}
# OpenSearch description link
'type' => 'application/rsd+xml',
// Output a protocol-relative URL here if $wgServer is protocol-relative
// Whether RSD accepts relative or protocol-relative URLs is completely undocumented, though
- 'href' => wfExpandUrl( wfAppendQuery( wfScript( 'api' ), array( 'action' => 'rsd' ) ), PROTO_RELATIVE ),
+ 'href' => wfExpandUrl( wfAppendQuery(
+ wfScript( 'api' ),
+ array( 'action' => 'rsd' ) ),
+ PROTO_RELATIVE
+ ),
) );
}
$tags[] = $this->feedLink(
$format,
$rctitle->getLocalURL( array( 'feed' => $format ) ),
- $this->msg( "site-{$format}-feed", $wgSitename )->text() # For grep: 'site-rss-feed', 'site-atom-feed'.
+ # For grep: 'site-rss-feed', 'site-atom-feed'
+ $this->msg( "site-{$format}-feed", $wgSitename )->text()
);
}
}
// Add ResourceLoader styles
// Split the styles into these groups
- $styles = array( 'other' => array(), 'user' => array(), 'site' => array(), 'private' => array(), 'noscript' => array() );
+ $styles = array(
+ 'other' => array(),
+ 'user' => array(),
+ 'site' => array(),
+ 'private' => array(),
+ 'noscript' => array()
+ );
$links = array();
$otherTags = ''; // Tags to append after the normal <link> tags
$resourceLoader = $this->getResourceLoader();
$styles[ isset( $styles[$group] ) ? $group : 'other' ][] = $name;
}
- // We want site, private and user styles to override dynamically added styles from modules, but we want
- // dynamically added styles to override statically added styles from other modules. So the order
- // has to be other, dynamic, site, private, user
- // Add statically added styles for other modules
+ // We want site, private and user styles to override dynamically added
+ // styles from modules, but we want dynamically added styles to override
+ // statically added styles from other modules. So the order has to be
+ // other, dynamic, site, private, user. Add statically added styles for
+ // other modules
$links[] = $this->makeResourceLoaderLink( $styles['other'], ResourceLoaderModule::TYPE_STYLES );
// Add normal styles added through addStyle()/addInlineStyle() here
$links[] = implode( "\n", $this->buildCssLinksArray() ) . $this->mInlineStyles;
// Add marker tag to mark the place where the client-side loader should inject dynamic styles
// We use a <meta> tag with a made-up name for this because that's valid HTML
- $links[] = Html::element( 'meta', array( 'name' => 'ResourceLoaderDynamicStyles', 'content' => '' ) ) . "\n";
+ $links[] = Html::element(
+ 'meta',
+ array( 'name' => 'ResourceLoaderDynamicStyles', 'content' => '' )
+ ) . "\n";
// Add site, private and user styles
// 'private' at present only contains user.options, so put that before 'user'
} elseif ( preg_match( $screenMediaQueryRegex, $media ) === 1 ) {
// This regex will not attempt to understand a comma-separated media_query_list
//
- // Example supported values for $media: 'screen', 'only screen', 'screen and (min-width: 982px)' ),
- // Example NOT supported value for $media: '3d-glasses, screen, print and resolution > 90dpi'
+ // Example supported values for $media:
+ // 'screen', 'only screen', 'screen and (min-width: 982px)' ),
+ // Example NOT supported value for $media:
+ // '3d-glasses, screen, print and resolution > 90dpi'
//
// If it's a print request, we never want any kind of screen stylesheets
// If it's a handheld request (currently the only other choice with a switch),
*
* Is equivalent to:
*
- * $wgOut->addWikiText( "<div class='error'>\n" . wfMessage( 'some-error' )->plain() . "\n</div>" );
+ * $wgOut->addWikiText( "<div class='error'>\n"
+ * . wfMessage( 'some-error' )->plain() . "\n</div>" );
*
* The newline after opening div is needed in some wikitext. See bug 19226.
*