MediaWiki  1.23.15
Html.php
Go to the documentation of this file.
1 <?php
48 class Html {
49  // List of void elements from HTML5, section 8.1.2 as of 2011-08-12
50  private static $voidElements = array(
51  'area',
52  'base',
53  'br',
54  'col',
55  'command',
56  'embed',
57  'hr',
58  'img',
59  'input',
60  'keygen',
61  'link',
62  'meta',
63  'param',
64  'source',
65  'track',
66  'wbr',
67  );
68 
69  // Boolean attributes, which may have the value omitted entirely. Manually
70  // collected from the HTML5 spec as of 2011-08-12.
71  private static $boolAttribs = array(
72  'async',
73  'autofocus',
74  'autoplay',
75  'checked',
76  'controls',
77  'default',
78  'defer',
79  'disabled',
80  'formnovalidate',
81  'hidden',
82  'ismap',
83  'itemscope',
84  'loop',
85  'multiple',
86  'muted',
87  'novalidate',
88  'open',
89  'pubdate',
90  'readonly',
91  'required',
92  'reversed',
93  'scoped',
94  'seamless',
95  'selected',
96  'truespeed',
97  'typemustmatch',
98  // HTML5 Microdata
99  'itemscope',
100  );
101 
121  public static function rawElement( $element, $attribs = array(), $contents = '' ) {
122  $start = self::openElement( $element, $attribs );
123  if ( in_array( $element, self::$voidElements ) ) {
124  // Silly XML.
125  return substr( $start, 0, -1 ) . '/>';
126  } else {
127  return "$start$contents" . self::closeElement( $element );
128  }
129  }
130 
141  public static function element( $element, $attribs = array(), $contents = '' ) {
142  return self::rawElement( $element, $attribs, strtr( $contents, array(
143  // There's no point in escaping quotes, >, etc. in the contents of
144  // elements.
145  '&' => '&amp;',
146  '<' => '&lt;'
147  ) ) );
148  }
149 
159  public static function openElement( $element, $attribs = array() ) {
161  // This is not required in HTML5, but let's do it anyway, for
162  // consistency and better compression.
163  $element = strtolower( $element );
164 
165  // Remove invalid input types
166  if ( $element == 'input' ) {
167  $validTypes = array(
168  'hidden',
169  'text',
170  'password',
171  'checkbox',
172  'radio',
173  'file',
174  'submit',
175  'image',
176  'reset',
177  'button',
178 
179  // HTML input types
180  'datetime',
181  'datetime-local',
182  'date',
183  'month',
184  'time',
185  'week',
186  'number',
187  'range',
188  'email',
189  'url',
190  'search',
191  'tel',
192  'color',
193  );
194  if ( isset( $attribs['type'] )
195  && !in_array( $attribs['type'], $validTypes ) ) {
196  unset( $attribs['type'] );
197  }
198  }
199 
200  // According to standard the default type for <button> elements is "submit".
201  // Depending on compatibility mode IE might use "button", instead.
202  // We enforce the standard "submit".
203  if ( $element == 'button' && !isset( $attribs['type'] ) ) {
204  $attribs['type'] = 'submit';
205  }
206 
207  return "<$element" . self::expandAttributes(
208  self::dropDefaults( $element, $attribs ) ) . '>';
209  }
210 
218  public static function closeElement( $element ) {
219  $element = strtolower( $element );
220 
221  return "</$element>";
222  }
223 
241  private static function dropDefaults( $element, $attribs ) {
242 
243  // Whenever altering this array, please provide a covering test case
244  // in HtmlTest::provideElementsWithAttributesHavingDefaultValues
245  static $attribDefaults = array(
246  'area' => array( 'shape' => 'rect' ),
247  'button' => array(
248  'formaction' => 'GET',
249  'formenctype' => 'application/x-www-form-urlencoded',
250  ),
251  'canvas' => array(
252  'height' => '150',
253  'width' => '300',
254  ),
255  'command' => array( 'type' => 'command' ),
256  'form' => array(
257  'action' => 'GET',
258  'autocomplete' => 'on',
259  'enctype' => 'application/x-www-form-urlencoded',
260  ),
261  'input' => array(
262  'formaction' => 'GET',
263  'type' => 'text',
264  ),
265  'keygen' => array( 'keytype' => 'rsa' ),
266  'link' => array( 'media' => 'all' ),
267  'menu' => array( 'type' => 'list' ),
268  // Note: the use of text/javascript here instead of other JavaScript
269  // MIME types follows the HTML5 spec.
270  'script' => array( 'type' => 'text/javascript' ),
271  'style' => array(
272  'media' => 'all',
273  'type' => 'text/css',
274  ),
275  'textarea' => array( 'wrap' => 'soft' ),
276  );
277 
278  $element = strtolower( $element );
279 
280  foreach ( $attribs as $attrib => $value ) {
281  $lcattrib = strtolower( $attrib );
282  if ( is_array( $value ) ) {
283  $value = implode( ' ', $value );
284  } else {
285  $value = strval( $value );
286  }
287 
288  // Simple checks using $attribDefaults
289  if ( isset( $attribDefaults[$element][$lcattrib] ) &&
290  $attribDefaults[$element][$lcattrib] == $value ) {
291  unset( $attribs[$attrib] );
292  }
293 
294  if ( $lcattrib == 'class' && $value == '' ) {
295  unset( $attribs[$attrib] );
296  }
297  }
298 
299  // More subtle checks
300  if ( $element === 'link' && isset( $attribs['type'] )
301  && strval( $attribs['type'] ) == 'text/css' ) {
302  unset( $attribs['type'] );
303  }
304  if ( $element === 'input' ) {
305  $type = isset( $attribs['type'] ) ? $attribs['type'] : null;
306  $value = isset( $attribs['value'] ) ? $attribs['value'] : null;
307  if ( $type === 'checkbox' || $type === 'radio' ) {
308  // The default value for checkboxes and radio buttons is 'on'
309  // not ''. By stripping value="" we break radio boxes that
310  // actually wants empty values.
311  if ( $value === 'on' ) {
312  unset( $attribs['value'] );
313  }
314  } elseif ( $type === 'submit' ) {
315  // The default value for submit appears to be "Submit" but
316  // let's not bother stripping out localized text that matches
317  // that.
318  } else {
319  // The default value for nearly every other field type is ''
320  // The 'range' and 'color' types use different defaults but
321  // stripping a value="" does not hurt them.
322  if ( $value === '' ) {
323  unset( $attribs['value'] );
324  }
325  }
326  }
327  if ( $element === 'select' && isset( $attribs['size'] ) ) {
328  if ( in_array( 'multiple', $attribs )
329  || ( isset( $attribs['multiple'] ) && $attribs['multiple'] !== false )
330  ) {
331  // A multi-select
332  if ( strval( $attribs['size'] ) == '4' ) {
333  unset( $attribs['size'] );
334  }
335  } else {
336  // Single select
337  if ( strval( $attribs['size'] ) == '1' ) {
338  unset( $attribs['size'] );
339  }
340  }
341  }
342 
343  return $attribs;
344  }
345 
383  public static function expandAttributes( $attribs ) {
384  $ret = '';
386  foreach ( $attribs as $key => $value ) {
387  // Support intuitive array( 'checked' => true/false ) form
388  if ( $value === false || is_null( $value ) ) {
389  continue;
390  }
391 
392  // For boolean attributes, support array( 'foo' ) instead of
393  // requiring array( 'foo' => 'meaningless' ).
394  if ( is_int( $key )
395  && in_array( strtolower( $value ), self::$boolAttribs ) ) {
396  $key = $value;
397  }
398 
399  // Not technically required in HTML5 but we'd like consistency
400  // and better compression anyway.
401  $key = strtolower( $key );
402 
403  // Bug 23769: Blacklist all form validation attributes for now. Current
404  // (June 2010) WebKit has no UI, so the form just refuses to submit
405  // without telling the user why, which is much worse than failing
406  // server-side validation. Opera is the only other implementation at
407  // this time, and has ugly UI, so just kill the feature entirely until
408  // we have at least one good implementation.
409 
410  // As the default value of "1" for "step" rejects decimal
411  // numbers to be entered in 'type="number"' fields, allow
412  // the special case 'step="any"'.
413 
414  if ( in_array( $key, array( 'max', 'min', 'pattern', 'required' ) )
415  || $key === 'step' && $value !== 'any' ) {
416  continue;
417  }
418 
419  // http://www.w3.org/TR/html401/index/attributes.html ("space-separated")
420  // http://www.w3.org/TR/html5/index.html#attributes-1 ("space-separated")
421  $spaceSeparatedListAttributes = array(
422  'class', // html4, html5
423  'accesskey', // as of html5, multiple space-separated values allowed
424  // html4-spec doesn't document rel= as space-separated
425  // but has been used like that and is now documented as such
426  // in the html5-spec.
427  'rel',
428  );
429 
430  // Specific features for attributes that allow a list of space-separated values
431  if ( in_array( $key, $spaceSeparatedListAttributes ) ) {
432  // Apply some normalization and remove duplicates
433 
434  // Convert into correct array. Array can contain space-separated
435  // values. Implode/explode to get those into the main array as well.
436  if ( is_array( $value ) ) {
437  // If input wasn't an array, we can skip this step
438  $newValue = array();
439  foreach ( $value as $k => $v ) {
440  if ( is_string( $v ) ) {
441  // String values should be normal `array( 'foo' )`
442  // Just append them
443  if ( !isset( $value[$v] ) ) {
444  // As a special case don't set 'foo' if a
445  // separate 'foo' => true/false exists in the array
446  // keys should be authoritative
447  $newValue[] = $v;
448  }
449  } elseif ( $v ) {
450  // If the value is truthy but not a string this is likely
451  // an array( 'foo' => true ), falsy values don't add strings
452  $newValue[] = $k;
453  }
454  }
455  $value = implode( ' ', $newValue );
456  }
457  $value = explode( ' ', $value );
458 
459  // Normalize spacing by fixing up cases where people used
460  // more than 1 space and/or a trailing/leading space
461  $value = array_diff( $value, array( '', ' ' ) );
462 
463  // Remove duplicates and create the string
464  $value = implode( ' ', array_unique( $value ) );
465  }
466 
467  $quote = '"';
468 
469  if ( in_array( $key, self::$boolAttribs ) ) {
470  $ret .= " $key=\"\"";
471  } else {
472  // Apparently we need to entity-encode \n, \r, \t, although the
473  // spec doesn't mention that. Since we're doing strtr() anyway,
474  // we may as well not call htmlspecialchars().
475  // @todo FIXME: Verify that we actually need to
476  // escape \n\r\t here, and explain why, exactly.
477  #
478  // We could call Sanitizer::encodeAttribute() for this, but we
479  // don't because we're stubborn and like our marginal savings on
480  // byte size from not having to encode unnecessary quotes.
481  // The only difference between this transform and the one by
482  // Sanitizer::encodeAttribute() is ' is not encoded.
483  $map = array(
484  '&' => '&amp;',
485  '"' => '&quot;',
486  '>' => '&gt;',
487  // '<' allegedly allowed per spec
488  // but breaks some tools if not escaped.
489  "<" => '&lt;',
490  "\n" => '&#10;',
491  "\r" => '&#13;',
492  "\t" => '&#9;'
493  );
494  $ret .= " $key=$quote" . strtr( $value, $map ) . $quote;
495  }
496  }
497  return $ret;
498  }
499 
509  public static function inlineScript( $contents ) {
510  $attrs = array();
511 
512  if ( preg_match( '/[<&]/', $contents ) ) {
513  $contents = "/*<![CDATA[*/$contents/*]]>*/";
514  }
515 
516  return self::rawElement( 'script', $attrs, $contents );
517  }
518 
526  public static function linkedScript( $url ) {
527  $attrs = array( 'src' => $url );
528 
529  return self::element( 'script', $attrs );
530  }
531 
540  public static function inlineStyle( $contents, $media = 'all' ) {
541  // Don't escape '>' since that is used
542  // as direct child selector.
543  // Remember, in css, there is no "x" for hexadecimal escapes, and
544  // the space immediately after an escape sequence is swallowed.
545  $contents = strtr( $contents, array(
546  '<' => '\3C ',
547  // CDATA end tag for good measure, but the main security
548  // is from escaping the '<'.
549  ']]>' => '\5D\5D\3E '
550  ) );
551 
552  if ( preg_match( '/[<&]/', $contents ) ) {
553  $contents = "/*<![CDATA[*/$contents/*]]>*/";
554  }
555 
556  return self::rawElement( 'style', array(
557  'type' => 'text/css',
558  'media' => $media,
559  ), $contents );
560  }
561 
570  public static function linkedStyle( $url, $media = 'all' ) {
571  return self::element( 'link', array(
572  'rel' => 'stylesheet',
573  'href' => $url,
574  'type' => 'text/css',
575  'media' => $media,
576  ) );
577  }
578 
590  public static function input( $name, $value = '', $type = 'text', $attribs = array() ) {
591  $attribs['type'] = $type;
592  $attribs['value'] = $value;
593  $attribs['name'] = $name;
594 
595  return self::element( 'input', $attribs );
596  }
597 
607  public static function hidden( $name, $value, $attribs = array() ) {
608  return self::input( $name, $value, 'hidden', $attribs );
609  }
610 
623  public static function textarea( $name, $value = '', $attribs = array() ) {
624  $attribs['name'] = $name;
625 
626  if ( substr( $value, 0, 1 ) == "\n" ) {
627  // Workaround for bug 12130: browsers eat the initial newline
628  // assuming that it's just for show, but they do keep the later
629  // newlines, which we may want to preserve during editing.
630  // Prepending a single newline
631  $spacedValue = "\n" . $value;
632  } else {
633  $spacedValue = $value;
634  }
635  return self::element( 'textarea', $attribs, $spacedValue );
636  }
637 
652  public static function namespaceSelector( array $params = array(), array $selectAttribs = array() ) {
654 
655  ksort( $selectAttribs );
656 
657  // Is a namespace selected?
658  if ( isset( $params['selected'] ) ) {
659  // If string only contains digits, convert to clean int. Selected could also
660  // be "all" or "" etc. which needs to be left untouched.
661  // PHP is_numeric() has issues with large strings, PHP ctype_digit has other issues
662  // and returns false for already clean ints. Use regex instead..
663  if ( preg_match( '/^\d+$/', $params['selected'] ) ) {
664  $params['selected'] = intval( $params['selected'] );
665  }
666  // else: leaves it untouched for later processing
667  } else {
668  $params['selected'] = '';
669  }
670 
671  if ( !isset( $params['exclude'] ) || !is_array( $params['exclude'] ) ) {
672  $params['exclude'] = array();
673  }
674  if ( !isset( $params['disable'] ) || !is_array( $params['disable'] ) ) {
675  $params['disable'] = array();
676  }
677 
678  // Associative array between option-values and option-labels
679  $options = array();
680 
681  if ( isset( $params['all'] ) ) {
682  // add an option that would let the user select all namespaces.
683  // Value is provided by user, the name shown is localized for the user.
684  $options[$params['all']] = wfMessage( 'namespacesall' )->text();
685  }
686  // Add all namespaces as options (in the content language)
687  $options += $wgContLang->getFormattedNamespaces();
688 
689  // Convert $options to HTML and filter out namespaces below 0
690  $optionsHtml = array();
691  foreach ( $options as $nsId => $nsName ) {
692  if ( $nsId < NS_MAIN || in_array( $nsId, $params['exclude'] ) ) {
693  continue;
694  }
695  if ( $nsId === NS_MAIN ) {
696  // For other namespaces use use the namespace prefix as label, but for
697  // main we don't use "" but the user message describing it (e.g. "(Main)" or "(Article)")
698  $nsName = wfMessage( 'blanknamespace' )->text();
699  } elseif ( is_int( $nsId ) ) {
700  $nsName = $wgContLang->convertNamespace( $nsId );
701  }
702  $optionsHtml[] = Html::element(
703  'option', array(
704  'disabled' => in_array( $nsId, $params['disable'] ),
705  'value' => $nsId,
706  'selected' => $nsId === $params['selected'],
707  ), $nsName
708  );
709  }
710 
711  if ( !array_key_exists( 'id', $selectAttribs ) ) {
712  $selectAttribs['id'] = 'namespace';
713  }
714 
715  if ( !array_key_exists( 'name', $selectAttribs ) ) {
716  $selectAttribs['name'] = 'namespace';
717  }
718 
719  $ret = '';
720  if ( isset( $params['label'] ) ) {
721  $ret .= Html::element(
722  'label', array(
723  'for' => isset( $selectAttribs['id'] ) ? $selectAttribs['id'] : null,
724  ), $params['label']
725  ) . '&#160;';
726  }
727 
728  // Wrap options in a <select>
729  $ret .= Html::openElement( 'select', $selectAttribs )
730  . "\n"
731  . implode( "\n", $optionsHtml )
732  . "\n"
733  . Html::closeElement( 'select' );
734 
735  return $ret;
736  }
737 
746  public static function htmlHeader( $attribs = array() ) {
747  $ret = '';
748 
749  global $wgHtml5Version, $wgMimeType, $wgXhtmlNamespaces;
750 
751  $isXHTML = self::isXmlMimeType( $wgMimeType );
752 
753  if ( $isXHTML ) { // XHTML5
754  // XML mimetyped markup should have an xml header.
755  // However a DOCTYPE is not needed.
756  $ret .= "<?xml version=\"1.0\" encoding=\"UTF-8\" ?" . ">\n";
757 
758  // Add the standard xmlns
759  $attribs['xmlns'] = 'http://www.w3.org/1999/xhtml';
760 
761  // And support custom namespaces
762  foreach ( $wgXhtmlNamespaces as $tag => $ns ) {
763  $attribs["xmlns:$tag"] = $ns;
764  }
765  } else { // HTML5
766  // DOCTYPE
767  $ret .= "<!DOCTYPE html>\n";
768  }
769 
770  if ( $wgHtml5Version ) {
771  $attribs['version'] = $wgHtml5Version;
772  }
773 
774  $html = Html::openElement( 'html', $attribs );
775 
776  if ( $html ) {
777  $html .= "\n";
778  }
779 
780  $ret .= $html;
781 
782  return $ret;
783  }
784 
791  public static function isXmlMimeType( $mimetype ) {
792  # http://www.whatwg.org/html/infrastructure.html#xml-mime-type
793  # * text/xml
794  # * application/xml
795  # * Any mimetype with a subtype ending in +xml (this implicitly includes application/xhtml+xml)
796  return (bool)preg_match( '!^(text|application)/xml$|^.+/.+\+xml$!', $mimetype );
797  }
798 
810  static function infoBox( $text, $icon, $alt, $class = false, $useStylePath = true ) {
811  global $wgStylePath;
812 
813  if ( $useStylePath ) {
814  $icon = $wgStylePath . '/common/images/' . $icon;
815  }
816 
817  $s = Html::openElement( 'div', array( 'class' => "mw-infobox $class" ) );
818 
819  $s .= Html::openElement( 'div', array( 'class' => 'mw-infobox-left' ) ) .
820  Html::element( 'img',
821  array(
822  'src' => $icon,
823  'alt' => $alt,
824  )
825  ) .
826  Html::closeElement( 'div' );
827 
828  $s .= Html::openElement( 'div', array( 'class' => 'mw-infobox-right' ) ) .
829  $text .
830  Html::closeElement( 'div' );
831  $s .= Html::element( 'div', array( 'style' => 'clear: left;' ), ' ' );
832 
833  $s .= Html::closeElement( 'div' );
834 
835  $s .= Html::element( 'div', array( 'style' => 'clear: left;' ), ' ' );
836 
837  return $s;
838  }
839 
848  static function srcSet( $urls ) {
849  $candidates = array();
850  foreach ( $urls as $density => $url ) {
851  // Image candidate syntax per current whatwg live spec, 2012-09-23:
852  // http://www.whatwg.org/html/embedded-content-1.html#attr-img-srcset
853  $candidates[] = "{$url} {$density}x";
854  }
855  return implode( ", ", $candidates );
856  }
857 }
Html\srcSet
static srcSet( $urls)
Generate a srcset attribute value from an array mapping pixel densities to URLs.
Definition: Html.php:848
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
Html\htmlHeader
static htmlHeader( $attribs=array())
Constructs the opening html-tag with necessary doctypes depending on global variables.
Definition: Html.php:746
$html
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
Definition: hooks.txt:1530
Html\textarea
static textarea( $name, $value='', $attribs=array())
Convenience function to produce a <textarea> element.
Definition: Html.php:623
Html\dropDefaults
static dropDefaults( $element, $attribs)
Given an element name and an associative array of element attributes, return an array that is functio...
Definition: Html.php:241
$ret
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
Definition: hooks.txt:1530
Html\expandAttributes
static expandAttributes( $attribs)
Given an associative array of element attributes, generate a string to stick after the element name i...
Definition: Html.php:383
$params
$params
Definition: styleTest.css.php:40
$s
$s
Definition: mergeMessageFileList.php:156
Html\hidden
static hidden( $name, $value, $attribs=array())
Convenience function to produce an input element with type=hidden.
Definition: Html.php:607
$wgContLang
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
Definition: design.txt:56
Html\inlineScript
static inlineScript( $contents)
Output a "<script>" tag with the given contents.
Definition: Html.php:509
NS_MAIN
const NS_MAIN
Definition: Defines.php:79
Html\closeElement
static closeElement( $element)
Returns "</$element>".
Definition: Html.php:218
Html\isXmlMimeType
static isXmlMimeType( $mimetype)
Determines if the given mime type is xml.
Definition: Html.php:791
Html\openElement
static openElement( $element, $attribs=array())
Identical to rawElement(), but has no third parameter and omits the end tag (and the self-closing '/'...
Definition: Html.php:159
Html\element
static element( $element, $attribs=array(), $contents='')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
Definition: Html.php:141
Html\linkedScript
static linkedScript( $url)
Output a "<script>" tag linking to the given URL, e.g., "<script src=foo.js></script>".
Definition: Html.php:526
wfMessage
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 after in associative array form externallinks including delete and has completed for all link tables 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 "&lt
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
Html\$voidElements
static $voidElements
Definition: Html.php:50
global
when a variable name is used in a it is silently declared as a new masking the global
Definition: design.txt:93
Html\$boolAttribs
static $boolAttribs
Definition: Html.php:71
Html\infoBox
static infoBox( $text, $icon, $alt, $class=false, $useStylePath=true)
Get HTML for an info box with an icon.
Definition: Html.php:810
Html\input
static input( $name, $value='', $type='text', $attribs=array())
Convenience function to produce an "<input>" element.
Definition: Html.php:590
$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 & $options
Definition: hooks.txt:1530
$name
Allows to change the fields on the form that will be generated $name
Definition: hooks.txt:336
$value
$value
Definition: styleTest.css.php:45
Html\inlineStyle
static inlineStyle( $contents, $media='all')
Output a "<style>" tag with the given contents for the given media type (if any).
Definition: Html.php:540
Html\linkedStyle
static linkedStyle( $url, $media='all')
Output a "<link rel=stylesheet>" linking to the given URL for the given media type (if any).
Definition: Html.php:570
as
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
Definition: distributors.txt:9
Html\namespaceSelector
static namespaceSelector(array $params=array(), array $selectAttribs=array())
Build a drop-down box for selecting a namespace.
Definition: Html.php:652
Html\rawElement
static rawElement( $element, $attribs=array(), $contents='')
Returns an HTML element in a string.
Definition: Html.php:121
$attribs
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
Definition: hooks.txt:1530
Html
This class is a collection of static functions that serve two purposes:
Definition: Html.php:48
$type
$type
Definition: testCompression.php:46