31 $info[
'nodata'] =
true;
32 if ( isset( $info[
'flags'] ) ) {
33 $this->mFlags = $info[
'flags'];
36 # Generate the label from a message, if possible
37 if ( isset( $info[
'buttonlabel-message'] ) ) {
38 $this->buttonLabel = $this->
getMessage( $info[
'buttonlabel-message'] )->parse();
39 } elseif ( isset( $info[
'buttonlabel'] ) ) {
40 if ( $info[
'buttonlabel'] ===
' ' ) {
42 $this->buttonLabel =
' ';
44 $this->buttonLabel = htmlspecialchars( $info[
'buttonlabel'] );
46 } elseif ( isset( $info[
'buttonlabel-raw'] ) ) {
47 $this->buttonLabel = $info[
'buttonlabel-raw'];
52 parent::__construct( $info );
57 $prefix =
'mw-htmlform-';
59 $this->mParent->
getConfig()->get(
'UseMediaWikiUIEverywhere' )
63 $flags .=
' ' . $prefix .
'button';
65 foreach ( $this->mFlags
as $flag ) {
66 $flags .=
' ' . $prefix . $flag;
69 'class' =>
'mw-htmlform-submit ' . $this->mClass .
$flags,
80 $this->buttonLabel ?: htmlspecialchars( $this->
getDefault() ) );
90 return new OOUI\ButtonInputWidget( [
91 'name' => $this->mName,
93 'label' => !$this->
isBadIE() && $this->buttonLabel
94 ?
new OOUI\HtmlSnippet( $this->buttonLabel )
96 'type' => $this->buttonType,
97 'classes' => [
'mw-htmlform-submit', $this->mClass ],
99 'flags' => $this->mFlags,
100 'useInputTag' => $this->
isBadIE(),
101 ] + OOUI\Element::configFromHtmlAttributes(
130 return preg_match(
'/MSIE [1-7]\./i',
$request->getHeader(
'User-Agent' ) );
static rawElement($element, $attribs=[], $contents= '')
Returns an HTML element in a string.
it s the revision text itself In either if gzip is the revision text is gzipped $flags
getRequest()
Get the WebRequest object.
static getMain()
Static methods.
getConfig()
Get the Config object.
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
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
error also a ContextSource you ll probably need to make sure the header is varied on $request
static element($element, $attribs=[], $contents= '')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).