dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Skin: Make skins aware of their registered skin name
[lhc/web/wiklou.git]
/
includes
/
skins
/
Skin.php
diff --git
a/includes/skins/Skin.php
b/includes/skins/Skin.php
index
a8f9d0c
..
f92a66f
100644
(file)
--- a/
includes/skins/Skin.php
+++ b/
includes/skins/Skin.php
@@
-34,7
+34,11
@@
use MediaWiki\MediaWikiServices;
* @ingroup Skins
*/
abstract class Skin extends ContextSource {
* @ingroup Skins
*/
abstract class Skin extends ContextSource {
+ /**
+ * @var string|null
+ */
protected $skinname = null;
protected $skinname = null;
+
protected $mRelevantTitle = null;
protected $mRelevantUser = null;
protected $mRelevantTitle = null;
protected $mRelevantUser = null;
@@
-95,7
+99,7
@@
abstract class Skin extends ContextSource {
static function normalizeKey( $key ) {
global $wgDefaultSkin, $wgFallbackSkin;
static function normalizeKey( $key ) {
global $wgDefaultSkin, $wgFallbackSkin;
- $skinNames =
Skin
::getSkinNames();
+ $skinNames =
self
::getSkinNames();
// Make keys lowercase for case-insensitive matching.
$skinNames = array_change_key_case( $skinNames, CASE_LOWER );
// Make keys lowercase for case-insensitive matching.
$skinNames = array_change_key_case( $skinNames, CASE_LOWER );
@@
-134,7
+138,17
@@
abstract class Skin extends ContextSource {
}
/**
}
/**
- * @return string Skin name
+ * @since 1.31
+ * @param string|null $skinname
+ */
+ public function __construct( $skinname = null ) {
+ if ( is_string( $skinname ) ) {
+ $this->skinname = $skinname;
+ }
+ }
+
+ /**
+ * @return string|null Skin name
*/
public function getSkinName() {
return $this->skinname;
*/
public function getSkinName() {
return $this->skinname;
@@
-449,7
+463,7
@@
abstract class Skin extends ContextSource {
* "<body>" tag, skins can override it if they have a need to add in any
* body attributes or classes of their own.
* @param OutputPage $out
* "<body>" tag, skins can override it if they have a need to add in any
* body attributes or classes of their own.
* @param OutputPage $out
- * @param array $bodyAttrs
+ * @param array
&
$bodyAttrs
*/
function addToBodyAttributes( $out, &$bodyAttrs ) {
// does nothing by default
*/
function addToBodyAttributes( $out, &$bodyAttrs ) {
// does nothing by default
@@
-1215,7
+1229,7
@@
abstract class Skin extends ContextSource {
/**
* make sure we have some title to operate on
*
/**
* make sure we have some title to operate on
*
- * @param Title $title
+ * @param Title
&
$title
* @param string $name
*/
static function checkTitle( &$title, $name ) {
* @param string $name
*/
static function checkTitle( &$title, $name ) {
@@
-1286,7
+1300,7
@@
abstract class Skin extends ContextSource {
*
* This is just a wrapper around addToSidebarPlain() for backwards compatibility
*
*
* This is just a wrapper around addToSidebarPlain() for backwards compatibility
*
- * @param array $bar
+ * @param array
&
$bar
* @param string $message
*/
public function addToSidebar( &$bar, $message ) {
* @param string $message
*/
public function addToSidebar( &$bar, $message ) {
@@
-1296,7
+1310,7
@@
abstract class Skin extends ContextSource {
/**
* Add content from plain text
* @since 1.17
/**
* Add content from plain text
* @since 1.17
- * @param array $bar
+ * @param array
&
$bar
* @param string $text
* @return array
*/
* @param string $text
* @return array
*/
@@
-1375,8
+1389,8
@@
abstract class Skin extends ContextSource {
$bar[$heading][] = array_merge( [
'text' => $text,
'href' => $href,
$bar[$heading][] = array_merge( [
'text' => $text,
'href' => $href,
- 'id' =>
'n-' . Sanitizer::escapeId( strtr( $line[1], ' ', '-' ), 'noninitial'
),
- 'active' => false
+ 'id' =>
Sanitizer::escapeIdForAttribute( 'n-' . strtr( $line[1], ' ', '-' )
),
+ 'active' => false
,
], $extraAttribs );
} else {
continue;
], $extraAttribs );
} else {
continue;