X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FOutputPage.php;h=1e0c396a2710920a65029605ce4302ad7828d121;hb=c0d61543b21d3beed183c109acb326dc90ab7d81;hp=577d6105acf65b1ab06f302c0fac3a3dcfcb9853;hpb=5572b8644ff033c1f4042bca77da2f0ef3d88a4d;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 577d6105ac..08eb3ae667 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -123,7 +123,7 @@ class OutputPage extends ContextSource { var $mScripts = ''; /** - * Inline CSS styles. Use addInlineStyle() sparsingly + * Inline CSS styles. Use addInlineStyle() sparingly */ var $mInlineStyles = ''; @@ -248,6 +248,16 @@ class OutputPage extends ContextSource { */ private $mRedirectedFrom = null; + /** + * Additional key => value data + */ + private $mProperties = array(); + + /** + * @var string|null: ResourceLoader target for load.php links. If null, will be omitted + */ + private $mTarget = null; + /** * Constructor for OutputPage. This should not be called directly. * Instead a new RequestContext should be created and it will implicitly create @@ -265,8 +275,8 @@ class OutputPage extends ContextSource { /** * Redirect to $url rather than displaying the normal page * - * @param $url String: URL - * @param $responsecode String: HTTP status code + * @param string $url URL + * @param string $responsecode HTTP status code */ public function redirect( $url, $responsecode = '302' ) { # Strip newlines as a paranoia check for header injection in PHP<5.1.2 @@ -296,8 +306,8 @@ class OutputPage extends ContextSource { * Add a new "" tag * To add an http-equiv meta tag, precede the name with "http:" * - * @param $name String tag name - * @param $val String tag value + * @param string $name tag name + * @param string $val tag value */ function addMeta( $name, $val ) { array_push( $this->mMetatags, array( $name, $val ) ); @@ -306,10 +316,10 @@ class OutputPage extends ContextSource { /** * Add a keyword or a list of keywords in the page header * - * @param $text String or array of strings + * @param string $text or array of strings */ function addKeyword( $text ) { - if( is_array( $text ) ) { + if ( is_array( $text ) ) { $this->mKeywords = array_merge( $this->mKeywords, $text ); } else { array_push( $this->mKeywords, $text ); @@ -321,7 +331,7 @@ class OutputPage extends ContextSource { * * Note: use setCanonicalUrl() for rel=canonical. * - * @param $linkarr Array: associative array of attributes. + * @param array $linkarr associative array of attributes. */ function addLink( $linkarr ) { array_push( $this->mLinktags, $linkarr ); @@ -330,7 +340,7 @@ class OutputPage extends ContextSource { /** * Add a new \ with "rel" attribute set to "meta" * - * @param $linkarr Array: associative array mapping attribute names to their + * @param array $linkarr associative array mapping attribute names to their * values, both keys and values will be escaped, and the * "rel" attribute will be automatically added */ @@ -366,7 +376,7 @@ class OutputPage extends ContextSource { /** * Add raw HTML to the list of scripts (including \ tag, etc.) * - * @param $script String: raw HTML + * @param string $script raw HTML */ function addScript( $script ) { $this->mScripts .= $script . "\n"; @@ -375,7 +385,7 @@ class OutputPage extends ContextSource { /** * Register and add a stylesheet from an extension directory. * - * @param $url String path to sheet. Provide either a full url (beginning + * @param string $url path to sheet. Provide either a full url (beginning * with 'http', etc) or a relative path from the document root * (beginning with '/'). Otherwise it behaves identically to * addStyle() and draws from the /skins folder. @@ -396,27 +406,28 @@ class OutputPage extends ContextSource { /** * Add a JavaScript file out of skins/common, or a given relative path. * - * @param $file String: filename in skins/common or complete on-server path + * @param string $file filename in skins/common or complete on-server path * (/foo/bar.js) - * @param $version String: style version of the file. Defaults to $wgStyleVersion + * @param string $version style version of the file. Defaults to $wgStyleVersion */ public function addScriptFile( $file, $version = null ) { global $wgStylePath, $wgStyleVersion; // See if $file parameter is an absolute URL or begins with a slash - if( substr( $file, 0, 1 ) == '/' || preg_match( '#^[a-z]*://#i', $file ) ) { + if ( substr( $file, 0, 1 ) == '/' || preg_match( '#^[a-z]*://#i', $file ) ) { $path = $file; } else { $path = "{$wgStylePath}/common/{$file}"; } - if ( is_null( $version ) ) + if ( is_null( $version ) ) { $version = $wgStyleVersion; + } $this->addScript( Html::linkedScript( wfAppendQuery( $path, $version ) ) ); } /** * Add a self-contained script tag with the given contents * - * @param $script String: JavaScript text, no "