Go to the documentation of this file.
14 parent::__construct(
'Gadgets',
'',
true );
22 $parts = explode(
'/', $par );
24 if (
count( $parts ) == 2 && $parts[0] ==
'export' ) {
32 return 'gadget-' . Sanitizer::escapeId( $gadgetName, [
'noninitial' ] );
43 $output->setPageTitle( $this->
msg(
'gadgets-title' ) );
44 $output->addWikiMsg(
'gadgets-pagetext' );
55 $langSuffix =
"/" .
$lang->getCode();
60 $editInterfaceMessage = $this->
getUser()->isAllowed(
'editinterface' )
70 [], [
'action' =>
'edit' ] )
72 $lnk =
"    [$lnkTarget]";
74 $ttext = $this->
msg(
"gadget-section-$section" )->parse();
87 foreach ( $entries
as $gadget ) {
88 $name = $gadget->getName();
97 $this->
msg( $editInterfaceMessage )->
text(),
99 [
'action' =>
'edit' ]
103 $this->
msg(
'gadgets-export' )->
text()
106 $ttext = $this->
msg(
"gadget-{$name}" )->parse();
113 $actions =
'  ' .
114 $this->
msg(
'parentheses' )->rawParams(
$lang->pipeList( $links ) )->escaped();
117 $ttext . $actions .
"<br />" .
118 $this->
msg(
'gadgets-uses' )->escaped() .
119 $this->
msg(
'colon-separator' )->escaped()
123 foreach ( $gadget->getPeers()
as $peer ) {
126 [
'href' =>
'#' . $this->
makeAnchor( $peer ) ],
130 foreach ( $gadget->getScriptsAndStyles()
as $codePage ) {
140 if ( $gadget->getLegacyScripts() ) {
143 [
'class' =>
'mw-gadget-legacy errorbox' ],
144 $this->
msg(
'gadgets-legacy' )->parse()
149 foreach ( $gadget->getRequiredRights()
as $right ) {
150 $rights[] =
'* ' . $this->
msg(
"right-$right" )->plain();
152 if (
count( $rights ) ) {
154 $this->
msg(
'gadgets-required-rights', implode(
"\n", $rights ),
count( $rights ) )->parse()
158 $requiredSkins = $gadget->getRequiredSkins();
160 if ( is_array( $requiredSkins ) ) {
163 foreach ( $requiredSkins
as $skinid ) {
164 if ( isset( $validskins[$skinid] ) ) {
165 $skins[] = $this->
msg(
"skinname-$skinid" )->plain();
170 if (
count( $skins ) ) {
173 $this->
msg(
'gadgets-required-skins',
$lang->commaList( $skins ) )
174 ->numParams(
count( $skins ) )->parse()
179 if ( $gadget->isOnByDefault() ) {
180 $output->addHTML(
'<br />' . $this->
msg(
'gadgets-default' )->parse() );
202 }
catch ( InvalidArgumentException
$e ) {
203 $output->showErrorPage(
'error',
'gadgets-not-found', [ $gadget ] );
208 $output->setPageTitle( $this->
msg(
'gadgets-export-title' ) );
209 $output->addWikiMsg(
'gadgets-export-text', $gadget, $g->getDefinition() );
211 $exportList =
"MediaWiki:gadget-$gadget\n";
212 foreach ( $g->getScriptsAndStyles()
as $page ) {
213 $exportList .=
"$page\n";
getPageTitle( $subpage=false)
Get a self-referential title object.
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
msg( $key)
Wrapper around wfMessage that sets the current context.
getOutput()
Get the OutputPage being used for this instance.
if(!isset( $args[0])) $lang
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add text
$wgScript
The URL path to index.php.
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name If you don't need a full Title object,...
Allows to change the fields on the form that will be generated $name
getLanguage()
Shortcut to get user's language.
showExportForm( $gadget)
Exports a gadget with its dependencies in a serialized form.
static openElement( $element, $attribs=null)
This opens an XML element.
static configuration should be added through ResourceLoaderGetConfigVars instead can be used to get the real title after the basic globals have been set but before ordinary actions take place $output
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
static getSkinNames()
Fetch the set of available skins.
static closeElement( $element)
Returns "</$element>".
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
getUser()
Shortcut to get the User executing this instance.
when a variable name is used in a it is silently declared as a new masking the global
static singleton()
Get the configured default GadgetRepo.
showMainForm()
Displays form showing the list of installed gadgets.
static hidden( $name, $value, array $attribs=[])
Convenience function to produce an input element with type=hidden.
static makeTitleSafe( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
div flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException' returning false will NOT prevent logging $e
Parent class for all special pages.
static closeElement( $element)
Shortcut to close an XML element.
usually copyright or history_copyright This message must be in HTML not wikitext if the section is included from a template $section
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
static openElement( $element, $attribs=[])
Identical to rawElement(), but has no third parameter and omits the end tag (and the self-closing '/'...
static rawElement( $element, $attribs=[], $contents='')
Returns an HTML element in a string.
MediaWiki Linker LinkRenderer null $linkRenderer
static element( $element, $attribs=[], $contents='')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
execute( $par)
Main execution function.
static submitButton( $value, $attribs=[])
Convenience function to build an HTML submit button When $wgUseMediaWikiUIEverywhere is true it will ...
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as and the content language as $wgContLang