113 if (
isset( $attrs[
'class'] ) ) {
114 if (
is_array( $attrs[
'class'] ) ) {
115 $attrs[
'class'][] =
'mw-ui-button';
116 $attrs[
'class'] =
array_merge( $attrs[
'class'], $modifiers );
118 $attrs[
'class'] = implode(
' ', $attrs[
'class'] );
120 $attrs[
'class'] .=
' mw-ui-button ' . implode(
' ', $modifiers );
124 $attrs[
'class'] =
'mw-ui-button ' . implode(
' ', $modifiers );
140 if (
isset( $attrs[
'class'] ) ) {
141 if (
is_array( $attrs[
'class'] ) ) {
142 $attrs[
'class'][] =
'mw-ui-input';
144 $attrs[
'class'] .=
' mw-ui-input';
147 $attrs[
'class'] =
'mw-ui-input';
167 return self::element(
'a',
168 self::buttonAttributes( $attrs, $modifiers ),
187 $attrs[
'type'] =
'submit';
188 $attrs[
'value'] = $contents;
189 return self::element(
'input', self::buttonAttributes( $attrs, $modifiers ) );
211 $start = self::openElement( $element,
$attribs );
212 if (
in_array( $element, self::$voidElements ) ) {
214 return substr( $start, 0, -1 ) .
'/>';
216 return $start . $contents . self::closeElement( $element );
233 return self::rawElement( $element,
$attribs,
strtr( $contents, [
260 if (
strpos( $element,
' ' ) !==
false ) {
261 wfWarn( __METHOD__ .
" given element name with space '$element'" );
265 if ( $element ==
'input' ) {
305 return "<$element" . self::expandAttributes(
306 self::dropDefaults( $element,
$attribs ) ) .
'>';
319 return "</$element>";
342 static $attribDefaults = [
343 'area' => [
'shape' =>
'rect' ],
345 'formaction' =>
'GET',
346 'formenctype' =>
'application/x-www-form-urlencoded',
354 'autocomplete' =>
'on',
355 'enctype' =>
'application/x-www-form-urlencoded',
358 'formaction' =>
'GET',
361 'keygen' => [
'keytype' =>
'rsa' ],
362 'link' => [
'media' =>
'all' ],
363 'menu' => [
'type' =>
'list' ],
364 'script' => [
'type' =>
'text/javascript' ],
367 'type' =>
'text/css',
369 'textarea' => [
'wrap' =>
'soft' ],
383 if (
isset( $attribDefaults[$element][$lcattrib] )
384 && $attribDefaults[$element][$lcattrib] ==
$value
389 if ( $lcattrib ==
'class' &&
$value ==
'' ) {
395 if ( $element ===
'link'
400 if ( $element ===
'input' ) {
403 if (
$type ===
'checkbox' ||
$type ===
'radio' ) {
501 $spaceSeparatedListAttributes = [
511 if (
in_array( $key, $spaceSeparatedListAttributes ) ) {
519 foreach (
$value as $k => $v ) {
535 $value = implode(
' ', $newValue );
546 throw new MWException(
"HTML attribute $key can not contain a list of values" );
551 if (
in_array( $key, self::$boolAttribs ) ) {
552 $ret .=
" $key=\"\"";
575 if ( $nonce !==
null ) {
576 $attrs[
'nonce'] = $nonce;
578 wfWarn(
"no nonce set on script. CSP will break it" );
581 if (
preg_match(
'/<\/?script/i', $contents ) ) {
582 wfLogWarning( __METHOD__ .
': Illegal character sequence found in inline script.' );
583 $contents =
'/* ERROR: Invalid script */';
586 return self::rawElement(
'script', $attrs, $contents );
598 $attrs = [
'src' => $url ];
599 if ( $nonce !==
null ) {
600 $attrs[
'nonce'] = $nonce;
602 wfWarn(
"no nonce set on script. CSP will break it" );
605 return self::element(
'script', $attrs );
625 $contents =
strtr( $contents, [
629 ']]>' =>
'\5D\5D\3E '
633 $contents =
"/*<![CDATA[*/$contents/*]]>*/";
636 return self::rawElement(
'style', [
650 return self::element(
'link', [
651 'rel' =>
'stylesheet',
672 if (
in_array(
$type, [
'text',
'search',
'email',
'password',
'number' ] ) ) {
678 return self::element(
'input',
$attribs );
713 if ( $heading !==
'' ) {
714 $html = self::element(
'h2', [], $heading ) .
$html;
716 return self::rawElement(
'div', [
'class' => $className ],
$html );
726 return self::messageBox(
$html,
'warningbox' );
737 return self::messageBox(
$html,
'errorbox', $heading );
747 return self::messageBox(
$html,
'successbox' );
785 return self::element(
'label',
$attribs, $label );
821 $spacedValue =
"\n" .
$value;
825 return self::element(
'textarea', self::getTextInputAttributes(
$attribs ), $spacedValue );
845 if (
$params[
'in-user-lang'] ??
false ) {
849 $lang = MediaWikiServices::getInstance()->getContentLanguage();
856 foreach (
$options as $nsId => $nsName ) {
863 $nsName =
wfMessage(
'blanknamespace' )->text();
865 $nsName =
$lang->convertNamespace( $nsId );
890 array $selectAttribs = []
892 ksort( $selectAttribs );
917 foreach (
$options as $nsId => $nsName ) {
918 $optionsHtml[] = self::element(
922 'selected' => $nsId ===
$params[
'selected'],
928 $selectAttribs[
'id'] =
'namespace';
932 $selectAttribs[
'name'] =
'namespace';
937 $ret .= self::element(
939 'for' => $selectAttribs[
'id'] ??
null,
945 $ret .= self::openElement(
'select', $selectAttribs )
947 . implode(
"\n", $optionsHtml )
949 . self::closeElement(
'select' );
972 $ret .=
"<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n";
975 $attribs[
'xmlns'] =
'http://www.w3.org/1999/xhtml';
982 $ret .=
"<!DOCTYPE html>\n";
1004 # * Any MIME type with a subtype ending in +xml (this implicitly includes application/xhtml+xml)
1005 return (
bool)
preg_match(
'!^(text|application)/xml$|^.+/.+\+xml$!', $mimetype );
1018 static function infoBox( $text, $icon, $alt, $class =
'' ) {
1019 $s = self::openElement(
'div', [
'class' =>
"mw-infobox $class" ] );
1021 $s .= self::openElement(
'div', [
'class' =>
'mw-infobox-left' ] ) .
1022 self::element(
'img',
1028 self::closeElement(
'div' );
1030 $s .= self::openElement(
'div', [
'class' =>
'mw-infobox-right' ] ) .
1032 self::closeElement(
'div' );
1033 $s .= self::element(
'div', [
'style' =>
'clear: left;' ],
' ' );
1035 $s .= self::closeElement(
'div' );
1037 $s .= self::element(
'div', [
'style' =>
'clear: left;' ],
' ' );
1067 foreach (
$urls as $density => $url ) {
1075 ksort( $candidates, SORT_NUMERIC );
1079 foreach ( $candidates as $density => $url ) {
1080 $candidates[
$density] = $url .
' ' . $density .
'x';
1083 return implode(
", ", $candidates );
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
$wgMimeType
The default Content-Type header.
$wgUseMediaWikiUIEverywhere
Temporary variable that applies MediaWiki UI wherever it can be supported.
$wgHtml5Version
Defines the value of the version attribute in the <html> tag, if any.
$wgXhtmlNamespaces
Permit other namespaces in addition to the w3.org default.
wfWarn( $msg, $callerOffset=1, $level=E_USER_NOTICE)
Send a warning either to the debug log or in a PHP error depending on $wgDevelopmentWarnings.
wfLogWarning( $msg, $callerOffset=1, $level=E_USER_WARNING)
Send a warning as a PHP error and the debug log.
static isNonceRequired(Config $config)
Should we set nonce attribute.
This class is a collection of static functions that serve two purposes:
static inlineScript( $contents, $nonce=null)
Output an HTML script tag with the given contents.
static label( $label, $id, array $attribs=[])
Convenience function for generating a label for inputs.
static textarea( $name, $value='', array $attribs=[])
Convenience function to produce a <textarea> element.
static infoBox( $text, $icon, $alt, $class='')
Get HTML for an info box with an icon.
static namespaceSelectorOptions(array $params=[])
Helper for Html::namespaceSelector().
static linkedScript( $url, $nonce=null)
Output a "<script>" tag linking to the given URL, e.g., "<script src=foo.js></script>".
static buttonAttributes(array $attrs, array $modifiers=[])
Modifies a set of attributes meant for button elements and apply a set of default attributes when $wg...
static linkedStyle( $url, $media='all')
Output a "<link rel=stylesheet>" linking to the given URL for the given media type (if any).
static element( $element, $attribs=[], $contents='')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
static messageBox( $html, $className, $heading='')
Return the HTML for a message box.
static isXmlMimeType( $mimetype)
Determines if the given MIME type is xml.
static linkButton( $contents, array $attrs, array $modifiers=[])
Returns an HTML link element in a string styled as a button (when $wgUseMediaWikiUIEverywhere is enab...
static htmlHeader(array $attribs=[])
Constructs the opening html-tag with necessary doctypes depending on global variables.
static input( $name, $value='', $type='text', array $attribs=[])
Convenience function to produce an "<input>" element.
static dropDefaults( $element, array $attribs)
Given an element name and an associative array of element attributes, return an array that is functio...
static errorBox( $html, $heading='')
Return an error box.
static submitButton( $contents, array $attrs, array $modifiers=[])
Returns an HTML link element in a string styled as a button (when $wgUseMediaWikiUIEverywhere is enab...
static getTextInputAttributes(array $attrs)
Modifies a set of attributes meant for text input elements and apply a set of default attributes.
static radio( $name, $checked=false, array $attribs=[])
Convenience function to produce a radio button (input element with type=radio)
static expandAttributes(array $attribs)
Given an associative array of element attributes, generate a string to stick after the element name i...
static rawElement( $element, $attribs=[], $contents='')
Returns an HTML element in a string.
static warningBox( $html)
Return a warning box.
static namespaceSelector(array $params=[], array $selectAttribs=[])
Build a drop-down box for selecting a namespace.
static openElement( $element, $attribs=[])
Identical to rawElement(), but has no third parameter and omits the end tag (and the self-closing '/'...
static successBox( $html)
Return a success box.
static check( $name, $checked=false, array $attribs=[])
Convenience function to produce a checkbox (input element with type=checkbox)
static srcSet(array $urls)
Generate a srcset attribute value.
static closeElement( $element)
Returns "</$element>".
static hidden( $name, $value, array $attribs=[])
Convenience function to produce an input element with type=hidden.
static inlineStyle( $contents, $media='all', $attribs=[])
Output a "<style>" tag with the given contents for the given media type (if any).
This code would result in ircNotify being run twice when an article is and once for brion Hooks can return three possible true was required This is the default since MediaWiki *some string
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped & $options
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses & $ret
either a unescaped string or a HtmlArmor object after in associative array form externallinks including delete and has completed for all link tables whether this was an auto creation use $formDescriptor instead default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock() - offset Set to overwrite offset parameter in $wgRequest set to '' to unset offset - wrap String Wrap the message in html(usually something like "<div ...>$1</div>"). - flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException':Called before an exception(or PHP error) is logged. This is meant for integration with external error aggregation services
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses & $html
Allows to change the fields on the form that will be generated $name
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses after processing & $attribs
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))
if(!isset( $args[0])) $lang