32 parent::__construct( $descriptor,
$context, $messagePrefix );
34 $this->
getOutput()->addModuleStyles(
'mediawiki.htmlform.ooui.styles' );
46 $field = parent::loadInputFromParameters( $fieldname, $descriptor,
$parent );
47 $field->setShowEmptyLabel(
false );
57 if ( $this->mShowSubmit ) {
60 if (
isset( $this->mSubmitID ) ) {
64 if (
isset( $this->mSubmitName ) ) {
68 if (
isset( $this->mSubmitTooltip ) ) {
75 $attribs[
'classes'] = [
'mw-htmlform-submit' ];
85 if ( $this->mShowReset ) {
88 'label' => $this->
msg(
'htmlform-reset' )->
text(),
89 'useInputTag' => $isBadIE,
93 if ( $this->mShowCancel ) {
94 $target = $this->mCancelTarget ?: Title::newMainPage();
95 if ( $target instanceof
Title ) {
96 $target = $target->getLocalURL();
99 'label' => $this->
msg(
'cancel' )->
text(),
104 foreach ( $this->mButtons as $button ) {
107 if ( $button[
'attribs'] ) {
108 $attrs += $button[
'attribs'];
111 if (
isset( $button[
'id'] ) ) {
112 $attrs[
'id'] = $button[
'id'];
116 $label = $button[
'value'];
120 $label = $button[
'label'];
124 $label = $button[
'value'];
127 $attrs[
'classes'] =
isset( $attrs[
'class'] ) ? (
array)$attrs[
'class'] : [];
131 'name' => $button[
'name'],
132 'value' => $button[
'value'],
134 'flags' => $button[
'flags'],
135 'framed' => $button[
'framed'],
136 'useInputTag' => $isBadIE,
144 return Html::rawElement(
'div',
145 [
'class' =>
'mw-htmlform-submit-buttons' ],
"\n$buttons" ) .
"\n";
160 $layout->appendContent(
181 if ( !$fieldsHtml ) {
187 $html = implode(
'', $fieldsHtml );
189 if ( $sectionName ) {
190 $html = Html::rawElement(
192 [
'id' => Sanitizer::escapeIdForAttribute( $sectionName ) ],
205 if ( $elements ===
'' ) {
209 if ( !
in_array( $elementsType, [
'error',
'warning' ],
true ) ) {
210 throw new DomainException( $elementsType .
' is not a valid type.' );
213 if ( $elements instanceof
Status ) {
214 if ( !$elements->isGood() ) {
215 $errors = $elements->getErrorsByType( $elementsType );
216 foreach ( $errors as &$error ) {
219 $error =
array_merge( [ $error[
'message'] ], $error[
'params'] );
222 }
elseif ( $elementsType ===
'error' ) {
230 foreach ( $errors as &$error ) {
231 $error = $this->
getMessage( $error )->parse();
236 if ( $elementsType ===
'error' ) {
237 $this->oouiErrors = $errors;
239 $this->oouiWarnings = $errors;
249 return parent::getHeaderText(
$section );
254 $html = parent::getBody();
255 if ( $this->mHeader || $this->oouiErrors || $this->oouiWarnings ) {
256 $classes = [
'mw-htmlform-ooui-header' ];
257 if ( $this->oouiErrors ) {
258 $classes[] =
'mw-htmlform-ooui-header-errors';
260 if ( $this->oouiWarnings ) {
261 $classes[] =
'mw-htmlform-ooui-header-warnings';
264 if ( $this->mHeader ) {
267 $element =
new OOUI\Widget( [] );
269 $html =
new OOUI\FieldLayout(
273 'errors' => $this->oouiErrors,
274 'notices' => $this->oouiWarnings,
275 'classes' => $classes,
283 if (
is_string( $this->mWrapperLegend ) ) {
285 'label' => $this->mWrapperLegend,
297 'classes' => [
'mw-htmlform',
'mw-htmlform-ooui' ],
303 'classes' => [
'mw-htmlform-ooui-wrapper' ],
305 'padded' => $this->mWrapperLegend !==
false,
306 'framed' => $this->mWrapperLegend !==
false,
This list may contain false positives That usually means there is additional text with links below the first Each row contains links to the first and second as well as the first line of the second redirect text
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
msg( $key)
Get a Message object with context set Parameters are the same as wfMessage()
static titleAttrib( $name, $options=null, array $msgParams=[])
Given the id of an interface element, constructs the appropriate title attribute from the system mess...
static accesskey( $name)
Given the id of an interface element, constructs the appropriate accesskey attribute from the system ...
Generic operation result class Has warning/error list, boolean status and arbitrary value.
Represents a title within MediaWiki.
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 true
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
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
usually copyright or history_copyright This message must be in HTML not wikitext if the section is included from a template $section
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))