MediaWiki
REL1_32
GadgetDefinitionContentHandler.php
Go to the documentation of this file.
1
<?php
23
class
GadgetDefinitionContentHandler
extends
JsonContentHandler
{
24
public
function
__construct
() {
25
parent::__construct(
'GadgetDefinition'
);
26
}
27
32
public
function
canBeUsedOn
(
Title
$title ) {
33
return
$title->inNamespace( NS_GADGET_DEFINITION );
34
}
35
36
protected
function
getContentClass
() {
37
return
'GadgetDefinitionContent'
;
38
}
39
40
public
function
makeEmptyContent
() {
41
$class = $this->
getContentClass
();
42
return
new
$class( FormatJson::encode( $this->
getDefaultMetadata
(),
"\t"
) );
43
}
44
45
public
function
getDefaultMetadata
() {
46
return
[
47
'settings'
=> [
48
'rights'
=> [],
49
'default'
=>
false
,
50
'hidden'
=>
false
,
51
'skins'
=> [],
52
'category'
=>
''
53
],
54
'module'
=> [
55
'scripts'
=> [],
56
'styles'
=> [],
57
'peers'
=> [],
58
'dependencies'
=> [],
59
'messages'
=> [],
60
'type'
=>
''
,
61
],
62
];
63
}
64
}
GadgetDefinitionContentHandler
Definition
GadgetDefinitionContentHandler.php:23
GadgetDefinitionContentHandler\__construct
__construct()
Definition
GadgetDefinitionContentHandler.php:24
GadgetDefinitionContentHandler\getDefaultMetadata
getDefaultMetadata()
Definition
GadgetDefinitionContentHandler.php:45
GadgetDefinitionContentHandler\canBeUsedOn
canBeUsedOn(Title $title)
Definition
GadgetDefinitionContentHandler.php:32
GadgetDefinitionContentHandler\getContentClass
getContentClass()
Definition
GadgetDefinitionContentHandler.php:36
GadgetDefinitionContentHandler\makeEmptyContent
makeEmptyContent()
Creates an empty TextContent object.
Definition
GadgetDefinitionContentHandler.php:40
JsonContentHandler
Content handler for JSON.
Definition
JsonContentHandler.php:30
Title
Represents a title within MediaWiki.
Definition
Title.php:39
extensions
Gadgets
includes
content
GadgetDefinitionContentHandler.php
Generated on Mon Nov 25 2024 15:56:35 for MediaWiki by
1.10.0