MediaWiki
REL1_19
|
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, $language=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.
$fields | Array Associative array, key is message corresponding to a description for the field (colon is in the message), value is appropriate input. |
$submitLabel | String A message containing a label for the submit button. |
Definition at line 757 of file Xml.php.
References $input, closeElement(), openElement(), submitButton(), tags(), wfMsg(), and wfMsgExt().
Referenced by ImageListPager\getForm().
static Xml::buildTable | ( | $ | rows, |
$ | attribs = array() , |
||
$ | headers = null |
||
) | [static] |
Build a table of data.
$rows | array An array of arrays of strings, each to be a row in a table |
$attribs | array An array of attributes to apply to the table tag [optional] |
$headers | array An array of strings to use as table headers [optional] |
Definition at line 788 of file Xml.php.
References $rows, buildTableRow(), closeElement(), element(), and openElement().
static Xml::buildTableRow | ( | $ | attribs, |
$ | cells | ||
) | [static] |
Build a row for a table.
$attribs | array An array of attributes to apply to the tr tag |
$cells | array An array of strings to put in |
Definition at line 827 of file Xml.php.
References closeElement(), element(), and openElement().
Referenced by buildTable().
static Xml::check | ( | $ | name, |
$ | checked = false , |
||
$ | attribs = array() |
||
) | [static] |
Convenience function to build an HTML checkbox.
$name | String value of the name attribute |
$checked | Bool Whether the checkbox is checked or not |
$attribs | Array other attributes |
Definition at line 320 of file Xml.php.
References element().
Referenced by checkLabel(), SpecialUndelete\formatFileRow(), HTMLMultiSelectField\formatOptions(), SpecialUndelete\formatRevisionRow(), WebInstaller\getCheckBox(), EditPage\getCheckboxes(), SpecialRecentchangeslinked\getExtraOptions(), HTMLCheckField\getInputHTML(), HistoryPager\historyLine(), and MovePageForm\showForm().
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 414 of file Xml.php.
References check(), and label().
Referenced by SpecialRevisionDelete\buildCheckBoxes(), ProtectionForm\buildForm(), SpecialRecentChanges\categoryFilterForm(), Article\confirmDelete(), UsercreateTemplate\execute(), SpecialWatchlist\execute(), SpecialExport\execute(), SpecialProtectedpages\getCascadeCheck(), SpecialProtectedpages\getExpiryCheck(), SpecialContributions\getForm(), ActiveUsersPager\getPageHeader(), UsersPager\getPageHeader(), LogEventsList\getTitlePattern(), UserrightsPage\groupCheckboxes(), SpecialRecentChanges\namespaceFilterForm(), HistoryAction\onView(), SpecialSearch\powerSearchBox(), EditPage\showEditForm(), MovePageForm\showForm(), SpecialChangePassword\showForm(), SpecialImport\showForm(), FileDeleteForm\showForm(), and SpecialUndelete\showHistory().
static Xml::closeElement | ( | $ | element | ) | [static] |
Shortcut to close an XML element.
$element | String element name |
Definition at line 97 of file Xml.php.
Referenced by AllmessagesTablePager\buildForm(), ProtectionForm\buildForm(), buildForm(), ProtectionForm\buildSelector(), buildTable(), buildTableRow(), Article\confirmDelete(), SpecialRecentChanges\doHeader(), SpecialWatchlist\execute(), SpecialStatistics\execute(), SpecialExport\execute(), SpecialListGroupRights\execute(), LinkSearchPage\execute(), MIMEsearchPage\execute(), FileDuplicateSearchPage\execute(), QueryPage\execute(), fieldset(), SpecialNewpages\form(), SpecialSearch\formHeader(), SpecialStatistics\getEditStats(), SpecialVersion\getExtensionCredits(), SpecialContributions\getForm(), DeletedContributionsPage\getForm(), SpecialStatistics\getMostViewedPages(), SpecialStatistics\getOtherStats(), WithoutInterwikiPage\getPageHeader(), ActiveUsersPager\getPageHeader(), UsersPager\getPageHeader(), SpecialStatistics\getPageStats(), MysqlInstaller\getSettingsForm(), SpecialStatistics\getUserStats(), SpecialStatistics\getViewsStats(), SpecialVersion\getWgHooks(), UserrightsPage\groupCheckboxes(), listDropDown(), SpecialWhatLinksHere\listEnd(), SpecialBookSources\makeForm(), monthSelector(), SpecialAllpages\namespaceForm(), SpecialPrefixindex\namespacePrefixForm(), ImagePage\openShowImage(), SpecialSearch\powerSearchBox(), ApiFormatXml\recXmlPrint(), SpecialAllpages\showChunk(), UserrightsPage\showEditUserGroupsForm(), SpecialChangeEmail\showForm(), MovePageForm\showForm(), SpecialChangePassword\showForm(), SpecialImport\showForm(), FileDeleteForm\showForm(), SpecialRevisionDelete\showForm(), SpecialMergeHistory\showHistory(), SpecialUndelete\showHistory(), SpecialWhatLinksHere\showIndirectLinks(), SpecialMergeHistory\showMergeForm(), SpecialProtectedpages\showOptions(), SpecialPrefixindex\showPrefixChunk(), EmailConfirmation\showRequestForm(), SpecialSearch\showResults(), SpecialUndelete\showRevision(), SpecialUndelete\showSearchForm(), SpecialAllpages\showToplevel(), SpecialVersion\softwareInformation(), XmlTest\testCloseElement(), SpecialEmailUser\userForm(), ImagePage\view(), and SpecialWhatLinksHere\whatlinkshereForm().
static Xml::dateMenu | ( | $ | year, |
$ | month | ||
) | [static] |
$year | Integer |
$month | Integer |
Definition at line 162 of file Xml.php.
References input(), label(), monthSelector(), and wfMsg().
Referenced by SpecialContributions\getForm(), HistoryAction\onView(), LogEventsList\showOptions(), 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.
$element | String: element name |
$attribs | Array: Name=>value pairs. Values will be escaped. |
$contents | String: NULL to make an open tag only; '' for a contentless closed tag (default) |
$allowShortTag | Bool: whether '' in $contents will result in a contentless closed tag |
Definition at line 20 of file Xml.php.
References $out, and expandAttributes().
Referenced by ImageHistoryList\beginImageHistoryList(), ProtectionForm\buildForm(), buildTable(), buildTableRow(), ChangeTags\buildTagFilterSelector(), XmlDumpWriter\caseSetting(), check(), TextPassDumper\clearOpenElement(), Article\confirmDelete(), Preferences\datetimePreferences(), Article\delete(), HistoryPager\diffButtons(), Article\doDelete(), SpecialTags\doTagRow(), elementClean(), SpecialChangePassword\error(), escapeJsString(), SpecialExport\execute(), SpecialListGroupRights\execute(), LinkSearchPage\execute(), MIMEsearchPage\execute(), FileDuplicateSearchPage\execute(), LegacyTemplate\extensionTabLinks(), fieldset(), SpecialStatistics\formatRow(), ImageListPager\formatValue(), SpecialSearch\formHeader(), XmlDumpWriter\generator(), EditPage\getEditButtons(), SpecialVersion\getExtensionCredits(), DeletedContributionsPage\getForm(), Status\getItemXML(), RevDel_FileItem\getLink(), SpecialVersion\getMediaWikiCredits(), Skin\getNewtalks(), WithoutInterwikiPage\getPageHeader(), SpecialVersion\getWgHooks(), UserrightsPage\groupCheckboxes(), XmlDumpWriter\homelink(), ImageHistoryList\imageHistoryLine(), input(), ChangesList\insertDateHeader(), label(), EditPage\livePreview(), OutputPage\makeResourceLoaderLink(), SpecialSearch\makeSearchLink(), SpecialAllpages\namespaceForm(), SpecialPrefixindex\namespacePrefixForm(), XmlDumpWriter\namespaces(), SpecialVersion\openExtType(), XmlDumpWriter\openPage(), XmlDumpWriter\openStream(), option(), Licenses\outputOption(), DjVuImage\parseFormDjvu(), SpecialSearch\powerSearchBox(), radio(), EnhancedChangesList\recentChangesLine(), ApiFormatXml\recXmlPrint(), LoginForm\resetLoginForm(), UserrightsPage\showEditUserGroupsForm(), MovePageForm\showForm(), FileDeleteForm\showForm(), SpecialUndelete\showHistory(), ProtectionForm\showLogExtract(), UserrightsPage\showLogFragment(), MovePageForm\showLogFragment(), SpecialMergeHistory\showMergeForm(), SpecialProtectedtitles\showOptions(), SpecialProtectedpages\showOptions(), SpecialSearch\showResults(), SpecialUndelete\showRevision(), XmlDumpWriter\sitename(), ApiFormatWddx\slowWddxPrinter(), SpecialVersion\softwareInformation(), span(), submitButton(), XmlTest\testElementAttributes(), XmlTest\testElementEmpty(), XmlTest\testElementEscaping(), XmlTest\testElementOpen(), textarea(), ThumbnailImage\toHtml(), Preferences\validateSignature(), ImagePage\view(), XmlDumpWriter\writeContributor(), XmlDumpWriter\writeLogItem(), XmlDumpWriter\writeRevision(), XmlDumpWriter\writeTimestamp(), and XmlDumpWriter\writeUpload().
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: |
$attribs | Array: Name=>value pairs. Values will be escaped. |
$contents | String: NULL to make an open tag only; '' for a contentless closed tag (default) |
Definition at line 68 of file Xml.php.
References $wgContLang, element(), wfProfileIn(), and wfProfileOut().
Referenced by XmlDumpWriter\openPage(), XmlDumpWriter\writeContributor(), XmlDumpWriter\writeLogItem(), XmlDumpWriter\writeRevision(), and XmlDumpWriter\writeUpload().
static Xml::encodeJsCall | ( | $ | name, |
$ | args | ||
) | [static] |
Create a call to a JavaScript function.
The supplied arguments will be encoded using Xml::encodeJsVar().
$name | String The name of the function to call, or a JavaScript expression which evaluates to a function object which is called. |
$args | Array of arguments to pass to the function. |
Definition at line 670 of file Xml.php.
References encodeJsVar().
Referenced by ProtectionForm\buildCleanupScript(), EditPage\getEditToolbar(), OutputPage\getHeadScripts(), ResourceLoaderUserTokensModule\getScript(), ResourceLoaderUserOptionsModule\getScript(), ResourceLoaderStartUpModule\getScript(), OutputPage\getScriptsForBottomQueue(), ResourceLoader\makeConfigSetScript(), ResourceLoader\makeCustomLoaderScript(), ResourceLoader\makeLoaderImplementScript(), ResourceLoader\makeLoaderRegisterScript(), ResourceLoader\makeLoaderSourcesScript(), ResourceLoader\makeLoaderStateScript(), ResourceLoader\makeMessageSetScript(), and OutputPage\makeResourceLoaderLink().
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 619 of file Xml.php.
Referenced by encodeJsCall(), WebInstaller_Complete\execute(), WebInstallerOutput\outputHeader(), 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 582 of file Xml.php.
References element().
Referenced by QuickTemplate\jstext(), Article\showRedirectedFromHeader(), and XmlTest\testEscapeJsStringSpecialChars().
static Xml::escapeTagsOnly | ( | $ | in | ) | [static] |
Replace " > and < with their respective HTML entities ( ", >, <)
$in | String: text that might contain HTML tags. |
Definition at line 743 of file Xml.php.
References $in.
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.
$attribs | Array of attributes for an XML element |
Definition at line 44 of file Xml.php.
References $out, and Sanitizer\encodeAttribute().
Referenced by element(), VectorTemplate\execute(), EditPage\getCheckboxes(), openElement(), XmlTest\testExpandAttributes(), XmlTest\testExpandAttributesException(), and Linker\tooltip().
static Xml::fieldset | ( | $ | legend = false , |
$ | content = false , |
||
$ | attribs = array() |
||
) | [static] |
Shortcut for creating fieldsets.
$legend | Legend of the fieldset. If evaluates to false, legend is not added. |
$content | Pre-escaped content for the fieldset. If false, only open fieldset is returned. |
$attribs | array Any attributes to fieldset-element. |
Definition at line 538 of file Xml.php.
References closeElement(), element(), and openElement().
Referenced by AllmessagesTablePager\buildForm(), HTMLForm\displaySection(), SpecialRecentChanges\doHeader(), SpecialWatchlist\execute(), SpecialNewpages\form(), SpecialWhatLinksHere\getFilterPanel(), ImageListPager\getForm(), SpecialContributions\getForm(), ActiveUsersPager\getPageHeader(), UsersPager\getPageHeader(), CategoryPager\getStartForm(), HistoryAction\onView(), SpecialChangeEmail\showForm(), SpecialChangePassword\showForm(), SpecialImport\showForm(), SpecialRevisionDelete\showForm(), SpecialUndelete\showHistory(), LogEventsList\showOptions(), SpecialUndelete\showSearchForm(), UserrightsPage\switchForm(), SpecialWhatLinksHere\whatlinkshereForm(), and HTMLForm\wrapForm().
static Xml::input | ( | $ | name, |
$ | size = false , |
||
$ | value = false , |
||
$ | attribs = array() |
||
) | [static] |
Convenience function to build an HTML text input field.
$name | String value of the name attribute |
$size | int value of the size attribute |
$value | mixed value of the value attribute |
$attribs | array other attributes |
Definition at line 275 of file Xml.php.
References $size, and element().
Referenced by AllmessagesTablePager\buildForm(), ProtectionForm\buildForm(), ChangeTags\buildTagFilterSelector(), dateMenu(), SpecialNewpages\form(), SpecialRecentchangeslinked\getExtraOptions(), UsersPager\getPageHeader(), SpecialProtectedpages\getSizeLimit(), WebInstaller\getTextBox(), SpecialAllpages\namespaceForm(), SpecialPrefixindex\namespacePrefixForm(), password(), UserrightsPage\showEditUserGroupsForm(), MovePageForm\showForm(), SpecialImport\showForm(), FileDeleteForm\showForm(), SpecialRevisionDelete\showForm(), SpecialMergeHistory\showHistory(), SpecialUndelete\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.
$label | String text of the label |
$name | String value of the name attribute |
$id | String id of the input |
$size | Int|Bool value of the size attribute |
$value | String|Bool value of the value attribute |
$attribs | array other attributes |
Definition at line 379 of file Xml.php.
References $input, $size, and inputLabelSep().
Referenced by SpecialExport\execute(), LinkSearchPage\execute(), MIMEsearchPage\execute(), FileDuplicateSearchPage\execute(), LogEventsList\getExtraInputs(), WithoutInterwikiPage\getPageHeader(), ActiveUsersPager\getPageHeader(), CategoryPager\getStartForm(), LogEventsList\getTitleInput(), LogEventsList\getUserInput(), SpecialBookSources\makeForm(), SpecialFilepath\showForm(), SpecialUndelete\showSearchForm(), UserrightsPage\switchForm(), SpecialEmailUser\userForm(), and SpecialWhatLinksHere\whatlinkshereForm().
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 396 of file Xml.php.
References $size, 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.
$text | String: string to test. |
Definition at line 698 of file Xml.php.
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 726 of file Xml.php.
References Sanitizer\hackDocType(), and isWellFormed().
Referenced by Parser\validateSig().
static Xml::label | ( | $ | label, |
$ | id, | ||
$ | attribs = array() |
||
) | [static] |
Convenience function to build an HTML form label.
$label | String text of the label |
$id | |
$attribs | Array an attribute array. This will usuall 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 355 of file Xml.php.
References element().
Referenced by AllmessagesTablePager\buildForm(), ProtectionForm\buildForm(), checkLabel(), Article\confirmDelete(), dateMenu(), SpecialWatchlist\execute(), LinkSearchPage\execute(), SpecialNewpages\form(), SpecialRecentchangeslinked\getExtraOptions(), SpecialContributions\getForm(), DeletedContributionsPage\getForm(), SpecialProtectedtitles\getLevelMenu(), SpecialProtectedpages\getLevelMenu(), SpecialProtectedtitles\getNamespaceMenu(), SpecialProtectedpages\getNamespaceMenu(), UsersPager\getPageHeader(), SpecialProtectedpages\getSizeLimit(), SpecialProtectedpages\getTypeMenu(), inputLabelSep(), languageSelector(), SpecialRecentChanges\namespaceFilterForm(), SpecialAllpages\namespaceForm(), SpecialPrefixindex\namespacePrefixForm(), Html\namespaceSelector(), SpecialSearch\powerSearchBox(), SpecialChangeEmail\pretty(), SpecialChangePassword\pretty(), radioLabel(), UserrightsPage\showEditUserGroupsForm(), MovePageForm\showForm(), SpecialImport\showForm(), FileDeleteForm\showForm(), SpecialRevisionDelete\showForm(), SpecialMergeHistory\showHistory(), SpecialUndelete\showHistory(), SpecialMergeHistory\showMergeForm(), XmlTest\testLabelAttributeCanOnlyBeClassOrTitle(), XmlTest\testLabelCreation(), and SpecialWhatLinksHere\whatlinkshereForm().
static Xml::languageSelector | ( | $ | selected, |
$ | customisedOnly = true , |
||
$ | language = 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 | $language | The ISO code of the language to display the select list in (optional) |
Definition at line 195 of file Xml.php.
References $language, $languages, $options, $wgLanguageCode, Language\getLanguageNames(), label(), option(), tags(), and wfMsg().
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 478 of file Xml.php.
References $options, closeElement(), openElement(), and option().
Referenced by ProtectionForm\buildForm(), Article\confirmDelete(), FileDeleteForm\showForm(), 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 '' |
$allmonths | String: value of a special item denoting all month. Null to not include (default) |
$id | String: Element identifier |
Definition at line 143 of file Xml.php.
References $options, $wgLang, closeElement(), openElement(), option(), and wfMsg().
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 |
$label | String: optional label to add to the field |
Definition at line 122 of file Xml.php.
References wfDeprecated().
Referenced by SpecialWatchlist\execute(), SpecialExport\execute(), LinkSearchPage\execute(), SpecialNewpages\form(), SpecialContributions\getForm(), DeletedContributionsPage\getForm(), SpecialProtectedtitles\getNamespaceMenu(), SpecialProtectedpages\getNamespaceMenu(), SpecialPrefixindex\namespacePrefixForm(), SpecialImport\showForm(), XmlTest\testNamespaceSelector(), and SpecialWhatLinksHere\whatlinkshereForm().
static Xml::openElement | ( | $ | element, |
$ | attribs = null |
||
) | [static] |
This opens an XML element.
$element | String name of the element |
$attribs | array of attributes, see Xml::expandAttributes() |
Definition at line 88 of file Xml.php.
References expandAttributes().
Referenced by ImageHistoryList\beginImageHistoryList(), AllmessagesTablePager\buildForm(), ProtectionForm\buildForm(), buildForm(), ProtectionForm\buildSelector(), buildTable(), buildTableRow(), Article\confirmDelete(), EditPage\displayPreviewArea(), SpecialRecentChanges\doHeader(), SpecialWatchlist\execute(), SpecialStatistics\execute(), SpecialExport\execute(), SpecialListGroupRights\execute(), LinkSearchPage\execute(), MIMEsearchPage\execute(), FileDuplicateSearchPage\execute(), QueryPage\execute(), fieldset(), SpecialNewpages\form(), AllmessagesTablePager\formatRow(), TablePager\formatRow(), SpecialSearch\formHeader(), SpecialStatistics\getEditStats(), SpecialVersion\getExtensionCredits(), SpecialContributions\getForm(), DeletedContributionsPage\getForm(), TablePager\getLimitForm(), SpecialStatistics\getMostViewedPages(), SpecialStatistics\getOtherStats(), WithoutInterwikiPage\getPageHeader(), ActiveUsersPager\getPageHeader(), UsersPager\getPageHeader(), SpecialStatistics\getPageStats(), MysqlInstaller\getSettingsForm(), AllmessagesTablePager\getStartBody(), SpecialStatistics\getUserStats(), SpecialStatistics\getViewsStats(), SpecialVersion\getWgHooks(), UserrightsPage\groupCheckboxes(), listDropDown(), SpecialWhatLinksHere\listItem(), SpecialWhatLinksHere\listStart(), SpecialBookSources\makeForm(), monthSelector(), SpecialAllpages\namespaceForm(), SpecialPrefixindex\namespacePrefixForm(), ImagePage\openShowImage(), SpecialSearch\powerSearchBox(), CoreTagHooks\pre(), SpecialAllpages\showChunk(), UserrightsPage\showEditUserGroupsForm(), SpecialUndelete\showFileConfirmationForm(), SpecialChangeEmail\showForm(), MovePageForm\showForm(), SpecialChangePassword\showForm(), SpecialImport\showForm(), FileDeleteForm\showForm(), SpecialRevisionDelete\showForm(), SpecialMergeHistory\showHistory(), SpecialUndelete\showHistory(), SpecialMergeHistory\showMergeForm(), SpecialProtectedpages\showOptions(), SpecialPrefixindex\showPrefixChunk(), EmailConfirmation\showRequestForm(), SpecialSearch\showResults(), SpecialUndelete\showRevision(), SpecialUndelete\showSearchForm(), SpecialAllpages\showToplevel(), SpecialVersion\softwareInformation(), tags(), XmlTest\testOpenElement(), ImageGallery\toHTML(), SpecialRevisionDelete\tryShowFile(), SpecialEmailUser\userForm(), ImagePage\view(), and SpecialWhatLinksHere\whatlinkshereForm().
static Xml::option | ( | $ | text, |
$ | value = null , |
||
$ | selected = false , |
||
$ | attribs = array() |
||
) | [static] |
Convenience function to build an HTML drop-down list item.
$text | String: text for this item |
$value | String: form submission value; if empty, use text |
$selected | boolean: if true, will be the default selected item |
$attribs | array: optional additional HTML attributes |
Definition at line 456 of file Xml.php.
References element().
Referenced by AllmessagesTablePager\buildForm(), ProtectionForm\buildForm(), ProtectionForm\buildSelector(), XmlSelect\formatOptions(), WebInstaller_Language\getLanguageSelector(), SpecialProtectedtitles\getLevelMenu(), SpecialProtectedpages\getLevelMenu(), TablePager\getLimitSelect(), UsersPager\getPageHeader(), SpecialProtectedpages\getTypeMenu(), languageSelector(), listDropDown(), monthSelector(), Html\namespaceSelector(), ImagePage\openShowImage(), and SpecialImport\showForm().
static Xml::password | ( | $ | name, |
$ | size = false , |
||
$ | value = false , |
||
$ | attribs = array() |
||
) | [static] |
Convenience function to build an HTML password input field.
$name | string value of the name attribute |
$size | int value of the size attribute |
$value | mixed value of the value attribute |
$attribs | array other attributes |
Definition at line 297 of file Xml.php.
References $size, and input().
static Xml::radio | ( | $ | name, |
$ | value, | ||
$ | checked = false , |
||
$ | attribs = array() |
||
) | [static] |
Convenience function to build an HTML radio button.
$name | String value of the name attribute |
$value | String value of the value attribute |
$checked | Bool Whether the checkbox is checked or not |
$attribs | Array other attributes |
Definition at line 338 of file Xml.php.
References element().
Referenced by SpecialRevisionDelete\buildCheckBoxes(), HTMLRadioField\formatOptions(), SpecialMergeHistory\formatRevisionRow(), WebInstaller\getRadioSet(), 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 432 of file Xml.php.
References label(), and radio().
Referenced by AllmessagesTablePager\buildForm(), WebInstaller_DBConnect\execute(), SpecialContributions\getForm(), and SpecialProtectedpages\getSizeLimit().
static Xml::span | ( | $ | text, |
$ | class, | ||
$ | attribs = array() |
||
) | [static] |
static Xml::submitButton | ( | $ | value, |
$ | attribs = array() |
||
) | [static] |
Convenience function to build an HTML submit button.
$value | String: label text for the button |
$attribs | Array: optional custom attributes |
Definition at line 444 of file Xml.php.
References element().
Referenced by AllmessagesTablePager\buildForm(), ProtectionForm\buildForm(), buildForm(), Article\confirmDelete(), WebInstallerPage\endForm(), SpecialWatchlist\execute(), SpecialExport\execute(), LinkSearchPage\execute(), MIMEsearchPage\execute(), FileDuplicateSearchPage\execute(), SpecialNewpages\form(), HTMLForm\getButtons(), SpecialContributions\getForm(), DeletedContributionsPage\getForm(), HTMLSubmitField\getInputHTML(), WithoutInterwikiPage\getPageHeader(), ActiveUsersPager\getPageHeader(), UsersPager\getPageHeader(), CategoryPager\getStartForm(), SpecialBookSources\makeForm(), SpecialAllpages\namespaceForm(), SpecialPrefixindex\namespacePrefixForm(), HistoryAction\onView(), ImagePage\openShowImage(), SpecialSearch\shortDialog(), UserrightsPage\showEditUserGroupsForm(), SpecialUndelete\showFileConfirmationForm(), SpecialFilepath\showForm(), SpecialChangeEmail\showForm(), MovePageForm\showForm(), SpecialChangePassword\showForm(), SpecialImport\showForm(), FileDeleteForm\showForm(), SpecialRevisionDelete\showForm(), SpecialMergeHistory\showHistory(), SpecialUndelete\showHistory(), SpecialMergeHistory\showMergeForm(), LogEventsList\showOptions(), SpecialProtectedtitles\showOptions(), SpecialProtectedpages\showOptions(), EmailConfirmation\showRequestForm(), SpecialUndelete\showSearchForm(), LegacyTemplate\specialPagesList(), UserrightsPage\switchForm(), SpecialRevisionDelete\tryShowFile(), SpecialEmailUser\userForm(), and SpecialWhatLinksHere\whatlinkshereForm().
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.
$element | String element name |
$attribs | array of attributes |
$contents | String content of the element |
Definition at line 108 of file Xml.php.
References openElement().
Referenced by SpecialRevisionDelete\buildCheckBoxes(), ProtectionForm\buildForm(), buildForm(), ChangeTags\buildTagFilterSelector(), ImportReporter\close(), Article\confirmDelete(), SpecialRecentChanges\doHeader(), SpecialTags\doTagRow(), SpecialTags\execute(), CategoryPager\formatRow(), AllmessagesTablePager\formatRow(), TablePager\formatRow(), ChangeTags\formatSummaryRow(), SpecialSearch\formHeader(), PreferencesForm\getButtons(), SpecialStatistics\getEditStats(), SpecialContributions\getForm(), DeletedContributionsPage\getForm(), SpecialProtectedtitles\getLevelMenu(), SpecialProtectedpages\getLevelMenu(), SpecialStatistics\getMostViewedPages(), SpecialStatistics\getOtherStats(), SpecialStatistics\getPageStats(), WebInstaller\getRadioSet(), CategoryPager\getStartForm(), EditPage\getSummaryInput(), EditPage\getSummaryPreview(), SpecialProtectedpages\getTypeMenu(), SpecialStatistics\getUserStats(), SpecialStatistics\getViewsStats(), UserrightsPage\groupCheckboxes(), HistoryPager\historyLine(), WebInstaller\label(), languageSelector(), MediaTransformOutput\linkWrap(), SpecialWhatLinksHere\listItem(), EditPage\livePreview(), LogEventsList\logLine(), ImagePage\openShowImage(), DjVuImage\parseFormDjvu(), SpecialSearch\powerSearchBox(), Linker\revDeleteLink(), Linker\revDeleteLinkDisabled(), UserrightsPage\showEditUserGroupsForm(), MovePageForm\showForm(), SpecialRevisionDelete\showForm(), LogEventsList\showOptions(), wrapClass(), PreferencesForm\wrapForm(), and TableDiffFormatter\wrapLine().
static Xml::textarea | ( | $ | name, |
$ | content, | ||
$ | cols = 40 , |
||
$ | rows = 5 , |
||
$ | attribs = array() |
||
) | [static] |
Shortcut for creating textareas.
$name | string The 'name' for the textarea |
$content | string Content for the textarea |
$cols | int The number of columns for the textarea |
$rows | int The number of rows for the textarea |
$attribs | array Any other attributes for the textarea |
Definition at line 564 of file Xml.php.
References $rows, and element().
Referenced by WebInstaller\getTextArea(), XmlTest\testTextareaAttribs(), and XmlTest\testTextareaNoContent().
static Xml::wrapClass | ( | $ | text, |
$ | class, | ||
$ | tag = 'span' , |
||
$ | attribs = array() |
||
) | [static] |
Shortcut to make a specific element with a class attribute.
$text | content of the element, will be escaped |
$class | class name of the span element |
$tag | string element name |
$attribs | array other attributes |
Definition at line 263 of file Xml.php.
References tags().
Referenced by SpecialWhatLinksHere\listItem().