MediaWiki
REL1_21
|
Module of static functions for generating XML. More...
Static Public Member Functions | |
static | attrib ($name, $present=true) |
Internal function for use in checkboxes and radio buttons and such. | |
static | buildForm ($fields, $submitLabel=null) |
Generate a form (without the opening form element). | |
static | buildTable ($rows, $attribs=array(), $headers=null) |
Build a table of data. | |
static | buildTableRow ($attribs, $cells) |
Build a row for a table. | |
static | check ($name, $checked=false, $attribs=array()) |
Convenience function to build an HTML checkbox. | |
static | checkLabel ($label, $name, $id, $checked=false, $attribs=array()) |
Convenience function to build an HTML checkbox with a label. | |
static | closeElement ($element) |
Shortcut to close an XML element. | |
static | dateMenu ($year, $month) |
static | element ($element, $attribs=null, $contents= '', $allowShortTag=true) |
Format an XML element with given attributes and, optionally, text content. | |
static | elementClean ($element, $attribs=array(), $contents= '') |
Format an XML element as with self::element(), but run text through the $wgContLang->normalize() validator first to ensure that no invalid UTF-8 is passed. | |
static | encodeJsCall ($name, $args) |
Create a call to a JavaScript function. | |
static | encodeJsVar ($value) |
Encode a variable of unknown type to JavaScript. | |
static | escapeJsString ($string) |
Returns an escaped string suitable for inclusion in a string literal for JavaScript source code. | |
static | escapeTagsOnly ($in) |
Replace " > and < with their respective HTML entities ( ", >, <) | |
static | expandAttributes ($attribs) |
Given an array of ('attributename' => 'value'), it generates the code to set the XML attributes : attributename="value". | |
static | fieldset ($legend=false, $content=false, $attribs=array()) |
Shortcut for creating fieldsets. | |
static | input ($name, $size=false, $value=false, $attribs=array()) |
Convenience function to build an HTML text input field. | |
static | inputLabel ($label, $name, $id, $size=false, $value=false, $attribs=array()) |
Convenience function to build an HTML text input field with a label. | |
static | inputLabelSep ($label, $name, $id, $size=false, $value=false, $attribs=array()) |
Same as Xml::inputLabel() but return input and label in an array. | |
static | isWellFormed ($text) |
Check if a string is well-formed XML. | |
static | isWellFormedXmlFragment ($text) |
Check if a string is a well-formed XML fragment. | |
static | label ($label, $id, $attribs=array()) |
Convenience function to build an HTML form label. | |
static | languageSelector ($selected, $customisedOnly=true, $inLanguage=null, $overrideAttrs=array(), Message $msg=null) |
Construct a language selector appropriate for use in a form or preferences. | |
static | listDropDown ($name= '', $list= '', $other= '', $selected= '', $class= '', $tabindex=null) |
Build a drop-down box from a textual list. | |
static | monthSelector ($selected= '', $allmonths=null, $id= 'month') |
Create a date selector. | |
static | namespaceSelector ($selected= '', $all=null, $element_name= 'namespace', $label=null) |
Build a drop-down box for selecting a namespace. | |
static | openElement ($element, $attribs=null) |
This opens an XML element. | |
static | option ($text, $value=null, $selected=false, $attribs=array()) |
Convenience function to build an HTML drop-down list item. | |
static | password ($name, $size=false, $value=false, $attribs=array()) |
Convenience function to build an HTML password input field. | |
static | radio ($name, $value, $checked=false, $attribs=array()) |
Convenience function to build an HTML radio button. | |
static | radioLabel ($label, $name, $value, $id, $checked=false, $attribs=array()) |
Convenience function to build an HTML radio button with a label. | |
static | span ($text, $class, $attribs=array()) |
Shortcut to make a span element. | |
static | submitButton ($value, $attribs=array()) |
Convenience function to build an HTML submit button. | |
static | tags ($element, $attribs=null, $contents) |
Same as Xml::element(), but does not escape contents. | |
static | textarea ($name, $content, $cols=40, $rows=5, $attribs=array()) |
Shortcut for creating textareas. | |
static | wrapClass ($text, $class, $tag= 'span', $attribs=array()) |
Shortcut to make a specific element with a class attribute. |
static Xml::attrib | ( | $ | name, |
$ | present = true |
||
) | [static] |
static Xml::buildForm | ( | $ | fields, |
$ | submitLabel = null |
||
) | [static] |
Generate a form (without the opening form element).
Output optionally includes a submit button.
array | $fields | Associative array, key is message corresponding to a description for the field (colon is in the message), value is appropriate input. |
string | $submitLabel | A message containing a label for the submit button. |
Definition at line 760 of file Xml.php.
References $form, $input, array(), as, closeElement(), openElement(), submitButton(), tags(), text, and wfMessage().
Referenced by ImageListPager\getForm().
static Xml::buildTable | ( | $ | rows, |
$ | attribs = array() , |
||
$ | headers = null |
||
) | [static] |
Build a table of data.
array | $rows | An array of arrays of strings, each to be a row in a table |
array | $attribs | An array of attributes to apply to the table tag [optional] |
array | $headers | An array of strings to use as table headers [optional] |
Definition at line 791 of file Xml.php.
References $attribs, $s, array(), as, buildTableRow(), closeElement(), element(), and openElement().
static Xml::buildTableRow | ( | $ | attribs, |
$ | cells | ||
) | [static] |
Build a row for a table.
array | $attribs | An array of attributes to apply to the tr tag |
array | $cells | An array of strings to put in |
Definition at line 830 of file Xml.php.
References $attribs, $s, array(), as, closeElement(), element(), and openElement().
Referenced by buildTable().
static Xml::check | ( | $ | name, |
$ | checked = false , |
||
$ | attribs = array() |
||
) | [static] |
Convenience function to build an HTML checkbox.
string | $name | value of the name attribute |
bool | $checked | Whether the checkbox is checked or not |
array | $attribs | other attributes |
Definition at line 333 of file Xml.php.
References $attribs, $name, array(), and element().
Referenced by checkLabel(), and SpecialRecentchangeslinked\getExtraOptions().
static Xml::checkLabel | ( | $ | label, |
$ | name, | ||
$ | id, | ||
$ | checked = false , |
||
$ | attribs = array() |
||
) | [static] |
Convenience function to build an HTML checkbox with a label.
$label | |
$name | |
$id | |
$checked | bool |
$attribs | array |
Definition at line 427 of file Xml.php.
References $attribs, $name, array(), check(), and label().
Referenced by SpecialRevisionDelete\buildCheckBoxes(), ProtectionForm\buildForm(), SpecialRecentChanges\categoryFilterForm(), SpecialWatchlist\execute(), SpecialExport\execute(), UsercreateTemplate\execute(), SpecialNewpages\form(), SpecialProtectedpages\getCascadeCheck(), SpecialProtectedpages\getExpiryCheck(), SpecialContributions\getForm(), UsersPager\getPageHeader(), UserrightsPage\groupCheckboxes(), SpecialRecentChanges\namespaceFilterForm(), SpecialPrefixindex\namespacePrefixForm(), HistoryAction\onView(), SpecialChangePassword\showForm(), and SpecialImport\showForm().
static Xml::closeElement | ( | $ | element | ) | [static] |
Shortcut to close an XML element.
string | $element | element name |
Definition at line 118 of file Xml.php.
Referenced by ProtectionForm\buildForm(), buildForm(), ProtectionForm\buildSelector(), buildTable(), buildTableRow(), SpecialRecentChanges\doHeader(), SpecialWatchlist\execute(), SpecialStatistics\execute(), SpecialExport\execute(), SpecialListGroupRights\execute(), MIMEsearchPage\execute(), FileDuplicateSearchPage\execute(), fieldset(), SpecialNewpages\form(), SpecialStatistics\formatRowHeader(), SpecialStatistics\getEditStats(), SpecialVersion\getExtensionCredits(), SpecialContributions\getForm(), DeletedContributionsPage\getForm(), SpecialStatistics\getMostViewedPages(), WithoutInterwikiPage\getPageHeader(), UsersPager\getPageHeader(), SpecialStatistics\getPageStats(), MysqlInstaller\getSettingsForm(), SpecialStatistics\getUserStats(), SpecialStatistics\getViewsStats(), SpecialVersion\getWgHooks(), UserrightsPage\groupCheckboxes(), listDropDown(), SpecialBookSources\makeForm(), monthSelector(), SpecialPrefixindex\namespacePrefixForm(), ApiFormatXml\recXmlPrint(), UserrightsPage\showEditUserGroupsForm(), SpecialChangePassword\showForm(), SpecialImport\showForm(), SpecialRevisionDelete\showForm(), SpecialMergeHistory\showHistory(), SpecialMergeHistory\showMergeForm(), SpecialProtectedpages\showOptions(), SpecialPrefixindex\showPrefixChunk(), EmailConfirmation\showRequestForm(), SpecialSearch\showResults(), SpecialVersion\softwareInformation(), XmlTest\testCloseElement(), and SpecialEmailUser\userForm().
static Xml::dateMenu | ( | $ | year, |
$ | month | ||
) | [static] |
$year | Integer |
$month | Integer |
Definition at line 183 of file Xml.php.
References array(), input(), label(), monthSelector(), text, and wfMessage().
Referenced by SpecialContributions\getForm(), HistoryAction\onView(), and XmlTest\testDateMenu().
static Xml::element | ( | $ | element, |
$ | attribs = null , |
||
$ | contents = '' , |
||
$ | allowShortTag = true |
||
) | [static] |
Format an XML element with given attributes and, optionally, text content.
Element and attribute names are assumed to be ready for literal inclusion. Strings are assumed to not contain XML-illegal characters; special characters (<, >, &) are escaped but illegals are not touched.
string | $element | element name |
array | $attribs | Name=>value pairs. Values will be escaped. |
string | $contents | NULL to make an open tag only; '' for a contentless closed tag (default) |
bool | $allowShortTag | whether '' in $contents will result in a contentless closed tag |
Definition at line 39 of file Xml.php.
References $attribs, $out, and expandAttributes().
Referenced by ProtectionForm\buildForm(), buildTable(), buildTableRow(), ChangeTags\buildTagFilterSelector(), check(), Preferences\datetimePreferences(), SpecialTags\doTagRow(), elementClean(), SpecialChangePassword\error(), escapeJsString(), SpecialExport\execute(), SpecialListGroupRights\execute(), MIMEsearchPage\execute(), FileDuplicateSearchPage\execute(), LegacyTemplate\extensionTabLinks(), fieldset(), SpecialStatistics\formatRow(), ImageListPager\formatValue(), SpecialVersion\getExtensionCredits(), DeletedContributionsPage\getForm(), SpecialVersion\getMediaWikiCredits(), Skin\getNewtalks(), WithoutInterwikiPage\getPageHeader(), SpecialVersion\getWgHooks(), UserrightsPage\groupCheckboxes(), ImageHistoryList\imageHistoryLine(), input(), label(), SpecialPrefixindex\namespacePrefixForm(), SpecialVersion\openExtType(), option(), DjVuImage\parseFormDjvu(), radio(), ApiFormatXml\recXmlPrint(), UserrightsPage\showEditUserGroupsForm(), ProtectionForm\showLogExtract(), UserrightsPage\showLogFragment(), MovePageForm\showLogFragment(), SpecialMergeHistory\showMergeForm(), SpecialProtectedtitles\showOptions(), SpecialProtectedpages\showOptions(), SpecialSearch\showResults(), ApiFormatWddx\slowWddxPrinter(), SpecialVersion\softwareInformation(), span(), submitButton(), XmlTest\testElementAttributes(), XmlTest\testElementEmpty(), XmlTest\testElementEscaping(), XmlTest\testElementOpen(), textarea(), and Preferences\validateSignature().
static Xml::elementClean | ( | $ | element, |
$ | attribs = array() , |
||
$ | contents = '' |
||
) | [static] |
Format an XML element as with self::element(), but run text through the $wgContLang->normalize() validator first to ensure that no invalid UTF-8 is passed.
$element | String: | |
array | $attribs | Name=>value pairs. Values will be escaped. |
string | $contents | NULL to make an open tag only; '' for a contentless closed tag (default) |
Definition at line 89 of file Xml.php.
References $attribs, $wgContLang, array(), element(), global, wfProfileIn(), and wfProfileOut().
static Xml::encodeJsCall | ( | $ | name, |
$ | args | ||
) | [static] |
Create a call to a JavaScript function.
The supplied arguments will be encoded using Xml::encodeJsVar().
string | $name | The name of the function to call, or a JavaScript expression which evaluates to a function object which is called. |
array | $args | of arguments to pass to the function. |
Definition at line 684 of file Xml.php.
References as, and encodeJsVar().
Referenced by ProtectionForm\buildCleanupScript(), ResourceLoaderUserTokensModule\getScript(), ResourceLoaderUserOptionsModule\getScript(), ResourceLoaderLanguageDataModule\getScript(), ResourceLoaderStartUpModule\getScript(), ResourceLoader\makeConfigSetScript(), ResourceLoader\makeCustomLoaderScript(), ResourceLoader\makeLoaderImplementScript(), ResourceLoader\makeLoaderRegisterScript(), ResourceLoader\makeLoaderSourcesScript(), ResourceLoader\makeLoaderStateScript(), and ResourceLoader\makeMessageSetScript().
static Xml::encodeJsVar | ( | $ | value | ) | [static] |
Encode a variable of unknown type to JavaScript.
Arrays are converted to JS arrays, objects are converted to JS associative arrays (objects). So cast your PHP associative arrays to objects before passing them to here.
$value |
Definition at line 633 of file Xml.php.
References $s, $value, and as.
Referenced by encodeJsCall(), WebInstaller_Complete\execute(), XmlTest\testEncodeJsVarArray(), XmlTest\testEncodeJsVarBoolean(), XmlTest\testEncodeJsVarFloat(), XmlTest\testEncodeJsVarFloatString(), XmlTest\testEncodeJsVarInt(), XmlTest\testEncodeJsVarIntString(), XmlTest\testEncodeJsVarNull(), XmlTest\testEncodeJsVarObject(), and ResourceLoaderModule\validateScriptFile().
static Xml::escapeJsString | ( | $ | string | ) | [static] |
Returns an escaped string suitable for inclusion in a string literal for JavaScript source code.
Illegal control characters are assumed not to be present.
string | $string | to escape |
Definition at line 596 of file Xml.php.
References any, array(), element(), of, and so.
Referenced by QuickTemplate\jstext(), and XmlTest\testEscapeJsStringSpecialChars().
static Xml::escapeTagsOnly | ( | $ | in | ) | [static] |
Replace " > and < with their respective HTML entities ( ", >, <)
string | $in | text that might contain HTML tags. |
Definition at line 746 of file Xml.php.
Referenced by CoreTagHooks\nowiki(), CoreTagHooks\pre(), and XmlTest\testEscapeTagsOnly().
static Xml::expandAttributes | ( | $ | attribs | ) | [static] |
Given an array of ('attributename' => 'value'), it generates the code to set the XML attributes : attributename="value".
The values are passed to Sanitizer::encodeAttribute. Return null if no attributes given.
array | $attribs | of attributes for an XML element |
MWException |
Definition at line 65 of file Xml.php.
References $attribs, $name, $out, as, and Sanitizer\encodeAttribute().
Referenced by element(), VectorTemplate\execute(), openElement(), XmlTest\testExpandAttributes(), XmlTest\testExpandAttributesException(), and Linker\tooltip().
static Xml::fieldset | ( | $ | legend = false , |
$ | content = false , |
||
$ | attribs = array() |
||
) | [static] |
Shortcut for creating fieldsets.
string | bool | $legend | Legend of the fieldset. If evaluates to false, legend is not added. |
string | $content | Pre-escaped content for the fieldset. If false, only open fieldset is returned. |
array | $attribs | Any attributes to fieldset-element. |
Definition at line 551 of file Xml.php.
References $attribs, $s, closeElement(), element(), and openElement().
Referenced by SpecialRecentChanges\doHeader(), SpecialWatchlist\execute(), SpecialNewpages\form(), ImageListPager\getForm(), SpecialContributions\getForm(), UsersPager\getPageHeader(), CategoryPager\getStartForm(), HistoryAction\onView(), SpecialChangePassword\showForm(), SpecialImport\showForm(), SpecialRevisionDelete\showForm(), and UserrightsPage\switchForm().
static Xml::input | ( | $ | name, |
$ | size = false , |
||
$ | value = false , |
||
$ | attribs = array() |
||
) | [static] |
Convenience function to build an HTML text input field.
string | $name | value of the name attribute |
int | $size | value of the size attribute |
$value | mixed value of the value attribute | |
array | $attribs | other attributes |
Definition at line 288 of file Xml.php.
References $attribs, $name, $size, $value, array(), and element().
Referenced by ProtectionForm\buildForm(), ChangeTags\buildTagFilterSelector(), dateMenu(), SpecialNewpages\form(), SpecialRecentchangeslinked\getExtraOptions(), SpecialProtectedpages\getSizeLimit(), SpecialPrefixindex\namespacePrefixForm(), password(), UserrightsPage\showEditUserGroupsForm(), SpecialImport\showForm(), SpecialRevisionDelete\showForm(), SpecialMergeHistory\showHistory(), SpecialMergeHistory\showMergeForm(), and XmlTest\testElementInputCanHaveAValueOfZero().
static Xml::inputLabel | ( | $ | label, |
$ | name, | ||
$ | id, | ||
$ | size = false , |
||
$ | value = false , |
||
$ | attribs = array() |
||
) | [static] |
Convenience function to build an HTML text input field with a label.
string | $label | text of the label |
string | $name | value of the name attribute |
string | $id | id of the input |
int | Bool | $size | value of the size attribute |
string | Bool | $value | value of the value attribute |
array | $attribs | other attributes |
Definition at line 392 of file Xml.php.
References $attribs, $input, $name, $size, $value, inputLabelSep(), and list.
Referenced by SpecialExport\execute(), LinkSearchPage\execute(), MIMEsearchPage\execute(), FileDuplicateSearchPage\execute(), WithoutInterwikiPage\getPageHeader(), CategoryPager\getStartForm(), SpecialBookSources\makeForm(), SpecialFilepath\showForm(), UserrightsPage\switchForm(), and SpecialEmailUser\userForm().
static Xml::inputLabelSep | ( | $ | label, |
$ | name, | ||
$ | id, | ||
$ | size = false , |
||
$ | value = false , |
||
$ | attribs = array() |
||
) | [static] |
Same as Xml::inputLabel() but return input and label in an array.
$label | String |
$name | String |
$id | String |
$size | Int|Bool |
$value | String|Bool |
$attribs | array |
Definition at line 409 of file Xml.php.
References $attribs, $name, $size, $value, array(), and label().
Referenced by SpecialRecentChanges\categoryFilterForm(), and inputLabel().
static Xml::isWellFormed | ( | $ | text | ) | [static] |
Check if a string is well-formed XML.
Must include the surrounding tag.
string | $text | string to test. |
Definition at line 701 of file Xml.php.
References $parser.
Referenced by isWellFormedXmlFragment().
static Xml::isWellFormedXmlFragment | ( | $ | text | ) | [static] |
Check if a string is a well-formed XML fragment.
Wraps fragment in an <html> bit and doctype, so it can be a fragment and can use HTML named entities.
$text | String: |
Definition at line 729 of file Xml.php.
References $html, Sanitizer\hackDocType(), and isWellFormed().
static Xml::label | ( | $ | label, |
$ | id, | ||
$ | attribs = array() |
||
) | [static] |
Convenience function to build an HTML form label.
string | $label | text of the label |
$id | ||
array | $attribs | an attribute array. This will usually be the same array as is passed to the corresponding input element, so this function will cherry-pick appropriate attributes to apply to the label as well; only class and title are applied. |
Definition at line 368 of file Xml.php.
References $attribs, array(), and element().
Referenced by ProtectionForm\buildForm(), checkLabel(), dateMenu(), SpecialNewpages\form(), SpecialRecentchangeslinked\getExtraOptions(), SpecialContributions\getForm(), SpecialProtectedtitles\getLevelMenu(), SpecialProtectedpages\getLevelMenu(), UsersPager\getPageHeader(), SpecialProtectedpages\getSizeLimit(), SpecialProtectedpages\getTypeMenu(), inputLabelSep(), languageSelector(), SpecialRecentChanges\namespaceFilterForm(), SpecialPrefixindex\namespacePrefixForm(), SpecialChangePassword\pretty(), radioLabel(), UserrightsPage\showEditUserGroupsForm(), SpecialImport\showForm(), SpecialRevisionDelete\showForm(), SpecialMergeHistory\showHistory(), SpecialMergeHistory\showMergeForm(), XmlTest\testLabelAttributeCanOnlyBeClassOrTitle(), and XmlTest\testLabelCreation().
static Xml::languageSelector | ( | $ | selected, |
$ | customisedOnly = true , |
||
$ | inLanguage = null , |
||
$ | overrideAttrs = array() , |
||
Message $ | msg = null |
||
) | [static] |
Construct a language selector appropriate for use in a form or preferences.
string | $selected | The language code of the selected language |
boolean | $customisedOnly | If true only languages which have some content are listed |
string | $inLanguage | The ISO code of the language to display the select list in (optional) |
array | $overrideAttrs | Override the attributes of the select tag (since 1.20) |
Message | null | $msg | Label message key (since 1.20) |
Definition at line 219 of file Xml.php.
References $languages, $name, $options, array(), as, Language\fetchLanguageNames(), global, label(), option(), tags(), and wfMessage().
Referenced by XmlTest\testLanguageSelector().
static Xml::listDropDown | ( | $ | name = '' , |
$ | list = '' , |
||
$ | other = '' , |
||
$ | selected = '' , |
||
$ | class = '' , |
||
$ | tabindex = null |
||
) | [static] |
Build a drop-down box from a textual list.
$name | Mixed: Name and id for the drop-down |
$list | Mixed: Correctly formatted text (newline delimited) to be used to generate the options |
$other | Mixed: Text for the "Other reasons" option |
$selected | Mixed: Option which should be pre-selected |
$class | Mixed: CSS classes for the drop-down |
$tabindex | Mixed: Value of the tabindex attribute |
Definition at line 491 of file Xml.php.
References $attribs, $name, $options, $tabindex, $value, array(), as, closeElement(), openElement(), and option().
Referenced by ProtectionForm\buildForm(), and SpecialRevisionDelete\showForm().
static Xml::monthSelector | ( | $ | selected = '' , |
$ | allmonths = null , |
||
$ | id = 'month' |
||
) | [static] |
Create a date selector.
$selected | Mixed: the month which should be selected, default '' | |
string | $allmonths | value of a special item denoting all month. Null to not include (default) |
string | $id | Element identifier |
Definition at line 164 of file Xml.php.
References $options, $wgLang, array(), closeElement(), global, openElement(), option(), text, and wfMessage().
Referenced by dateMenu().
static Xml::namespaceSelector | ( | $ | selected = '' , |
$ | all = null , |
||
$ | element_name = 'namespace' , |
||
$ | label = null |
||
) | [static] |
Build a drop-down box for selecting a namespace.
$selected | Mixed: Namespace which should be pre-selected | |
$all | Mixed: Value of an item denoting all namespaces, or null to omit | |
$element_name | String: value of the "name" attribute of the select tag | |
string | $label | optional label to add to the field |
Definition at line 143 of file Xml.php.
References array(), and wfDeprecated().
static Xml::openElement | ( | $ | element, |
$ | attribs = null |
||
) | [static] |
This opens an XML element.
string | $element | name of the element |
array | $attribs | of attributes, see Xml::expandAttributes() |
Definition at line 109 of file Xml.php.
References $attribs, and expandAttributes().
Referenced by ProtectionForm\buildForm(), buildForm(), ProtectionForm\buildSelector(), buildTable(), buildTableRow(), SpecialRecentChanges\doHeader(), SpecialWatchlist\execute(), SpecialStatistics\execute(), SpecialExport\execute(), SpecialListGroupRights\execute(), MIMEsearchPage\execute(), FileDuplicateSearchPage\execute(), fieldset(), SpecialNewpages\form(), SpecialStatistics\formatRowHeader(), SpecialStatistics\getEditStats(), SpecialVersion\getExtensionCredits(), DeletedContributionsPage\getForm(), SpecialStatistics\getMostViewedPages(), WithoutInterwikiPage\getPageHeader(), UsersPager\getPageHeader(), SpecialStatistics\getPageStats(), MysqlInstaller\getSettingsForm(), SpecialStatistics\getUserStats(), SpecialStatistics\getViewsStats(), SpecialVersion\getWgHooks(), UserrightsPage\groupCheckboxes(), listDropDown(), SpecialBookSources\makeForm(), monthSelector(), SpecialPrefixindex\namespacePrefixForm(), CoreTagHooks\pre(), UserrightsPage\showEditUserGroupsForm(), SpecialUndelete\showFileConfirmationForm(), SpecialChangePassword\showForm(), SpecialImport\showForm(), SpecialRevisionDelete\showForm(), SpecialMergeHistory\showHistory(), SpecialMergeHistory\showMergeForm(), SpecialProtectedpages\showOptions(), SpecialPrefixindex\showPrefixChunk(), EmailConfirmation\showRequestForm(), SpecialSearch\showResults(), SpecialVersion\softwareInformation(), tags(), XmlTest\testOpenElement(), SpecialRevisionDelete\tryShowFile(), and SpecialEmailUser\userForm().
static Xml::option | ( | $ | text, |
$ | value = null , |
||
$ | selected = false , |
||
$ | attribs = array() |
||
) | [static] |
Convenience function to build an HTML drop-down list item.
string | $text | text for this item |
string | $value | form submission value; if empty, use text |
$selected | boolean: if true, will be the default selected item | |
array | $attribs | optional additional HTML attributes |
Definition at line 469 of file Xml.php.
References $attribs, $value, and element().
Referenced by ProtectionForm\buildForm(), ProtectionForm\buildSelector(), XmlSelect\formatOptions(), SpecialProtectedtitles\getLevelMenu(), SpecialProtectedpages\getLevelMenu(), UsersPager\getPageHeader(), SpecialProtectedpages\getTypeMenu(), languageSelector(), listDropDown(), monthSelector(), and SpecialImport\showForm().
static Xml::password | ( | $ | name, |
$ | size = false , |
||
$ | value = false , |
||
$ | attribs = array() |
||
) | [static] |
Convenience function to build an HTML password input field.
string | $name | value of the name attribute |
int | $size | value of the size attribute |
$value | mixed value of the value attribute | |
array | $attribs | other attributes |
Definition at line 310 of file Xml.php.
References $attribs, $name, $size, $value, array(), and input().
static Xml::radio | ( | $ | name, |
$ | value, | ||
$ | checked = false , |
||
$ | attribs = array() |
||
) | [static] |
Convenience function to build an HTML radio button.
string | $name | value of the name attribute |
string | $value | value of the value attribute |
bool | $checked | Whether the checkbox is checked or not |
array | $attribs | other attributes |
Definition at line 351 of file Xml.php.
References $attribs, $name, $value, array(), and element().
Referenced by SpecialRevisionDelete\buildCheckBoxes(), SpecialMergeHistory\formatRevisionRow(), and radioLabel().
static Xml::radioLabel | ( | $ | label, |
$ | name, | ||
$ | value, | ||
$ | id, | ||
$ | checked = false , |
||
$ | attribs = array() |
||
) | [static] |
Convenience function to build an HTML radio button with a label.
$label | |
$name | |
$value | |
$id | |
$checked | bool |
$attribs | array |
Definition at line 445 of file Xml.php.
References $attribs, $name, $value, array(), label(), and radio().
Referenced by WebInstaller_DBConnect\execute(), SpecialContributions\getForm(), and SpecialProtectedpages\getSizeLimit().
Shortcut to make a span element.
string | $text | content of the element, will be escaped |
string | $class | class name of the span element |
array | $attribs | other attributes |
Definition at line 264 of file Xml.php.
References $attribs, array(), and element().
Referenced by SpecialPagesWithProp\formatResult().
static Xml::submitButton | ( | $ | value, |
$ | attribs = array() |
||
) | [static] |
Convenience function to build an HTML submit button.
string | $value | label text for the button |
array | $attribs | optional custom attributes |
Definition at line 457 of file Xml.php.
References $attribs, $value, array(), and element().
Referenced by ProtectionForm\buildForm(), buildForm(), WebInstallerPage\endForm(), SpecialWatchlist\execute(), SpecialExport\execute(), LinkSearchPage\execute(), MIMEsearchPage\execute(), FileDuplicateSearchPage\execute(), SpecialNewpages\form(), SpecialContributions\getForm(), DeletedContributionsPage\getForm(), WithoutInterwikiPage\getPageHeader(), UsersPager\getPageHeader(), CategoryPager\getStartForm(), SpecialBookSources\makeForm(), SpecialPrefixindex\namespacePrefixForm(), HistoryAction\onView(), UserrightsPage\showEditUserGroupsForm(), SpecialUndelete\showFileConfirmationForm(), SpecialFilepath\showForm(), SpecialChangePassword\showForm(), SpecialImport\showForm(), SpecialRevisionDelete\showForm(), SpecialMergeHistory\showHistory(), SpecialMergeHistory\showMergeForm(), SpecialProtectedtitles\showOptions(), SpecialProtectedpages\showOptions(), EmailConfirmation\showRequestForm(), LegacyTemplate\specialPagesList(), UserrightsPage\switchForm(), SpecialRevisionDelete\tryShowFile(), and SpecialEmailUser\userForm().
static Xml::tags | ( | $ | element, |
$ | attribs = null , |
||
$ | contents | ||
) | [static] |
Same as Xml::element(), but does not escape contents.
Handy when the content you have is already valid xml.
string | $element | element name |
array | $attribs | of attributes |
string | $contents | content of the element |
Definition at line 129 of file Xml.php.
References $attribs, and openElement().
Referenced by SpecialRevisionDelete\buildCheckBoxes(), ProtectionForm\buildForm(), buildForm(), ChangeTags\buildTagFilterSelector(), ImportReporter\close(), SpecialRecentChanges\doHeader(), SpecialTags\doTagRow(), SpecialTags\execute(), CategoryPager\formatRow(), SpecialStatistics\formatRowHeader(), ChangeTags\formatSummaryRow(), PreferencesForm\getButtons(), SpecialStatistics\getEditStats(), SpecialContributions\getForm(), DeletedContributionsPage\getForm(), SpecialProtectedtitles\getLevelMenu(), SpecialProtectedpages\getLevelMenu(), SpecialStatistics\getMostViewedPages(), SpecialStatistics\getPageStats(), CategoryPager\getStartForm(), SpecialProtectedpages\getTypeMenu(), SpecialStatistics\getUserStats(), SpecialStatistics\getViewsStats(), UserrightsPage\groupCheckboxes(), WebInstaller\label(), languageSelector(), DjVuImage\parseFormDjvu(), Linker\revDeleteLink(), Linker\revDeleteLinkDisabled(), UserrightsPage\showEditUserGroupsForm(), SpecialRevisionDelete\showForm(), wrapClass(), PreferencesForm\wrapForm(), and TableDiffFormatter\wrapLine().
static Xml::textarea | ( | $ | name, |
$ | content, | ||
$ | cols = 40 , |
||
$ | rows = 5 , |
||
$ | attribs = array() |
||
) | [static] |
Shortcut for creating textareas.
string | $name | The 'name' for the textarea |
string | $content | Content for the textarea |
int | $cols | The number of columns for the textarea |
int | $rows | The number of rows for the textarea |
array | $attribs | Any other attributes for the textarea |
Definition at line 577 of file Xml.php.
References $attribs, $name, array(), and element().
Referenced by XmlTest\testTextareaAttribs(), and XmlTest\testTextareaNoContent().
static Xml::wrapClass | ( | $ | text, |
$ | class, | ||
$ | tag = 'span' , |
||
$ | attribs = array() |
||
) | [static] |