MediaWiki REL1_30
InputBox.classes.php
Go to the documentation of this file.
1<?php
9// InputBox class
10class InputBox {
11
12 /* Fields */
13
14 private $mParser;
15 private $mType = '';
16 private $mWidth = 50;
17 private $mPreload = null;
18 private $mPreloadparams = null;
19 private $mEditIntro = null;
20 private $mUseVE = null;
21 private $mSummary = null;
22 private $mNosummary = null;
23 private $mMinor = null;
24 private $mPage = '';
25 private $mBR = 'yes';
26 private $mDefaultText = '';
27 private $mPlaceholderText = '';
28 private $mBGColor = 'transparent';
29 private $mButtonLabel = '';
30 private $mSearchButtonLabel = '';
31 private $mFullTextButton = '';
32 private $mLabelText = '';
33 private $mHidden = '';
34 private $mNamespaces = '';
35 private $mID = '';
36 private $mInline = false;
37 private $mPrefix = '';
38 private $mDir = '';
39 private $mSearchFilter = '';
40 private $mTour = '';
41
42 /* Functions */
43
44 public function __construct( $parser ) {
45 $this->mParser = $parser;
46 // Default value for dir taken from the page language (bug 37018)
47 $this->mDir = $this->mParser->getTargetLanguage()->getDir();
48 // Split caches by language, to make sure visitors do not see a cached
49 // version in a random language (since labels are in the user language)
50 $this->mParser->getOptions()->getUserLangObj();
51 $this->mParser->getOutput()->addModuleStyles( [
52 'ext.inputBox.styles',
53 'mediawiki.ui.input',
54 'mediawiki.ui.checkbox',
55 ] );
56 }
57
58 public function render() {
59 // Handle various types
60 switch ( $this->mType ) {
61 case 'create':
62 case 'comment':
63 $this->mParser->getOutput()->addModules( 'ext.inputBox' );
64 return $this->getCreateForm();
65 case 'move':
66 return $this->getMoveForm();
67 case 'commenttitle':
68 return $this->getCommentForm();
69 case 'search':
70 return $this->getSearchForm( 'search' );
71 case 'fulltext':
72 return $this->getSearchForm( 'fulltext' );
73 case 'search2':
74 return $this->getSearchForm2();
75 default:
76 return Xml::tags( 'div', null,
77 Xml::element( 'strong',
78 [ 'class' => 'error' ],
79 strlen( $this->mType ) > 0
80 ? wfMessage( 'inputbox-error-bad-type', $this->mType )->text()
81 : wfMessage( 'inputbox-error-no-type' )->text()
82 )
83 );
84 }
85 }
86
87 /*
88 * Returns the action name and value to use in inputboxes which redirects to edit pages.
89 * Decides, if the link should redirect to VE edit page (veaction=edit) or to wikitext editor
90 * (action=edit).
91 *
92 * @return Array Array with name and value data
93 */
94 private function getEditActionArgs() {
95 // default is wikitext editor
96 $args = [
97 'name' => 'action',
98 'value' => 'edit',
99 ];
100 // check, if VE is installed and VE editor is requested
101 if ( $this->shouldUseVE() ) {
102 $args = [
103 'name' => 'veaction',
104 'value' => 'edit',
105 ];
106 }
107 return $args;
108 }
109
116 private function getLinebreakClasses() {
117 return strtolower( $this->mBR ) === '<br />' ? 'mw-inputbox-input ' : '';
118 }
119
125 public function getSearchForm( $type ) {
127
128 // Use button label fallbacks
129 if ( !$this->mButtonLabel ) {
130 $this->mButtonLabel = wfMessage( 'inputbox-tryexact' )->text();
131 }
132 if ( !$this->mSearchButtonLabel ) {
133 $this->mSearchButtonLabel = wfMessage( 'inputbox-searchfulltext' )->text();
134 }
135 if ( $this->mID !== '' ) {
136 $idArray = [ 'id' => Sanitizer::escapeId( $this->mID ) ];
137 } else {
138 $idArray = [];
139 }
140 // We need a unqiue id to link <label> to checkboxes, but also
141 // want multiple <inputbox>'s to not be invalid html
142 $idRandStr = Sanitizer::escapeId( '-' . $this->mID . wfRandom(), 'noninitial' );
143
144 // Build HTML
145 $htmlOut = Xml::openElement( 'div',
146 [
147 'class' => 'mw-inputbox-centered',
148 'style' => $this->bgColorStyle(),
149 ]
150 );
151 $htmlOut .= Xml::openElement( 'form',
152 [
153 'name' => 'searchbox',
154 'class' => 'searchbox',
155 'action' => SpecialPage::getTitleFor( 'Search' )->getLocalUrl(),
156 ] + $idArray
157 );
158 $htmlOut .= Xml::element( 'input',
159 [
160 'class' => $this->getLinebreakClasses() . 'searchboxInput mw-ui-input mw-ui-input-inline',
161 'name' => 'search',
162 'type' => $this->mHidden ? 'hidden' : 'text',
163 'value' => $this->mDefaultText,
164 'placeholder' => $this->mPlaceholderText,
165 'size' => $this->mWidth,
166 'dir' => $this->mDir,
167 ]
168 );
169
170 if ( $this->mPrefix != '' ) {
171 $htmlOut .= Html::hidden( 'prefix', $this->mPrefix );
172 }
173
174 if ( $this->mSearchFilter != '' ) {
175 $htmlOut .= Html::hidden( 'searchfilter', $this->mSearchFilter );
176 }
177
178 if ( $this->mTour != '' ) {
179 $htmlOut .= Html::hidden( 'tour', $this->mTour );
180 }
181
182 $htmlOut .= $this->mBR;
183
184 // Determine namespace checkboxes
185 $namespacesArray = explode( ',', $this->mNamespaces );
186 if ( $this->mNamespaces ) {
187 $namespaces = $wgContLang->getNamespaces();
188 $nsAliases = array_merge( $wgContLang->getNamespaceAliases(), $wgNamespaceAliases );
189 $showNamespaces = [];
190 $checkedNS = [];
191 // Check for valid namespaces
192 foreach ( $namespacesArray as $userNS ) {
193 $userNS = trim( $userNS ); // no whitespace
194
195 // Namespace needs to be checked if flagged with "**"
196 if ( strpos( $userNS, '**' ) ) {
197 $userNS = str_replace( '**', '', $userNS );
198 $checkedNS[$userNS] = true;
199 }
200
201 $mainMsg = wfMessage( 'inputbox-ns-main' )->inContentLanguage()->text();
202 if ( $userNS == 'Main' || $userNS == $mainMsg ) {
203 $i = 0;
204 } elseif ( array_search( $userNS, $namespaces ) ) {
205 $i = array_search( $userNS, $namespaces );
206 } elseif ( isset( $nsAliases[$userNS] ) ) {
207 $i = $nsAliases[$userNS];
208 } else {
209 continue; // Namespace not recognized, skip
210 }
211 $showNamespaces[$i] = $userNS;
212 if ( isset( $checkedNS[$userNS] ) && $checkedNS[$userNS] ) {
213 $checkedNS[$i] = true;
214 }
215 }
216
217 // Show valid namespaces
218 foreach ( $showNamespaces as $i => $name ) {
219 $checked = [];
220 // Namespace flagged with "**" or if it's the only one
221 if ( ( isset( $checkedNS[$i] ) && $checkedNS[$i] ) || count( $showNamespaces ) == 1 ) {
222 $checked = [ 'checked' => 'checked' ];
223 }
224
225 if ( count( $showNamespaces ) == 1 ) {
226 // Checkbox
227 $htmlOut .= Xml::element( 'input',
228 [
229 'type' => 'hidden',
230 'name' => 'ns' . $i,
231 'value' => 1,
232 'id' => 'mw-inputbox-ns' . $i . $idRandStr
233 ] + $checked
234 );
235 } else {
236 // Checkbox
237 $htmlOut .= ' <div class="mw-inputbox-element mw-ui-checkbox">';
238 $htmlOut .= Xml::element( 'input',
239 [
240 'type' => 'checkbox',
241 'name' => 'ns' . $i,
242 'value' => 1,
243 'id' => 'mw-inputbox-ns' . $i . $idRandStr
244 ] + $checked
245 );
246 // Label
247 $htmlOut .= Xml::label( $name, 'mw-inputbox-ns' . $i . $idRandStr );
248 $htmlOut .= '</div> ';
249 }
250 }
251
252 // Line break
253 $htmlOut .= $this->mBR;
254 } elseif ( $type == 'search' ) {
255 // Go button
256 $htmlOut .= Xml::element( 'input',
257 [
258 'type' => 'submit',
259 'name' => 'go',
260 'class' => 'mw-ui-button',
261 'value' => $this->mButtonLabel
262 ]
263 );
264 $htmlOut .= '&#160;';
265 }
266
267 // Search button
268 $htmlOut .= Xml::element( 'input',
269 [
270 'type' => 'submit',
271 'name' => 'fulltext',
272 'class' => 'mw-ui-button',
273 'value' => $this->mSearchButtonLabel
274 ]
275 );
276
277 // Hidden fulltext param for IE (bug 17161)
278 if ( $type == 'fulltext' ) {
279 $htmlOut .= Html::hidden( 'fulltext', 'Search' );
280 }
281
282 $htmlOut .= Xml::closeElement( 'form' );
283 $htmlOut .= Xml::closeElement( 'div' );
284
285 // Return HTML
286 return $htmlOut;
287 }
288
292 public function getSearchForm2() {
293 // Use button label fallbacks
294 if ( !$this->mButtonLabel ) {
295 $this->mButtonLabel = wfMessage( 'inputbox-tryexact' )->text();
296 }
297
298 if ( $this->mID !== '' ) {
299 $unescapedID = $this->mID;
300 } else {
301 // The label element needs a unique id, use
302 // random number to avoid multiple input boxes
303 // having conflicts.
304 $unescapedID = wfRandom();
305 }
306 $id = Sanitizer::escapeId( $unescapedID, 'noninitial' );
307 $htmlLabel = '';
308 if ( isset( $this->mLabelText ) && strlen( trim( $this->mLabelText ) ) ) {
309 $this->mLabelText = $this->mParser->recursiveTagParse( $this->mLabelText );
310 $htmlLabel = Xml::openElement( 'label', [ 'for' => 'bodySearchInput' . $id ] );
311 $htmlLabel .= $this->mLabelText;
312 $htmlLabel .= Xml::closeElement( 'label' );
313 }
314 $htmlOut = Xml::openElement( 'form',
315 [
316 'name' => 'bodySearch' . $id,
317 'id' => 'bodySearch' . $id,
318 'class' => 'bodySearch' . ( $this->mInline ? ' mw-inputbox-inline' : '' ),
319 'action' => SpecialPage::getTitleFor( 'Search' )->getLocalUrl(),
320 ]
321 );
322 $htmlOut .= Xml::openElement( 'div',
323 [
324 'class' => 'bodySearchWrap' . ( $this->mInline ? ' mw-inputbox-inline' : '' ),
325 'style' => $this->bgColorStyle(),
326 ]
327 );
328 $htmlOut .= $htmlLabel;
329 $htmlOut .= Xml::element( 'input',
330 [
331 'type' => $this->mHidden ? 'hidden' : 'text',
332 'name' => 'search',
333 'class' => 'mw-ui-input mw-ui-input-inline',
334 'size' => $this->mWidth,
335 'id' => 'bodySearchInput' . $id,
336 'dir' => $this->mDir,
337 ]
338 );
339 $htmlOut .= '&#160;' . Xml::element( 'input',
340 [
341 'type' => 'submit',
342 'name' => 'go',
343 'value' => $this->mButtonLabel,
344 'class' => 'mw-ui-button',
345 ]
346 );
347
348 // Better testing needed here!
349 if ( !empty( $this->mFullTextButton ) ) {
350 $htmlOut .= Xml::element( 'input',
351 [
352 'type' => 'submit',
353 'name' => 'fulltext',
354 'class' => 'mw-ui-button',
355 'value' => $this->mSearchButtonLabel
356 ]
357 );
358 }
359
360 $htmlOut .= Xml::closeElement( 'div' );
361 $htmlOut .= Xml::closeElement( 'form' );
362
363 // Return HTML
364 return $htmlOut;
365 }
366
370 public function getCreateForm() {
371 global $wgScript;
372
373 if ( $this->mType == "comment" ) {
374 if ( !$this->mButtonLabel ) {
375 $this->mButtonLabel = wfMessage( 'inputbox-postcomment' )->text();
376 }
377 } else {
378 if ( !$this->mButtonLabel ) {
379 $this->mButtonLabel = wfMessage( 'inputbox-createarticle' )->text();
380 }
381 }
382
383 $htmlOut = Xml::openElement( 'div',
384 [
385 'class' => 'mw-inputbox-centered',
386 'style' => $this->bgColorStyle(),
387 ]
388 );
389 $createBoxParams = [
390 'name' => 'createbox',
391 'class' => 'createbox',
392 'action' => $wgScript,
393 'method' => 'get'
394 ];
395 if ( $this->mID !== '' ) {
396 $createBoxParams['id'] = Sanitizer::escapeId( $this->mID );
397 }
398 $htmlOut .= Xml::openElement( 'form', $createBoxParams );
399 $editArgs = $this->getEditActionArgs();
400 $htmlOut .= Html::hidden( $editArgs['name'], $editArgs['value'] );
401 if ( $this->mPreload !== null ) {
402 $htmlOut .= Html::hidden( 'preload', $this->mPreload );
403 }
404 if ( is_array( $this->mPreloadparams ) ) {
405 foreach ( $this->mPreloadparams as $preloadparams ) {
406 $htmlOut .= Html::hidden( 'preloadparams[]', $preloadparams );
407 }
408 }
409 if ( $this->mEditIntro !== null ) {
410 $htmlOut .= Html::hidden( 'editintro', $this->mEditIntro );
411 }
412 if ( $this->mSummary !== null ) {
413 $htmlOut .= Html::hidden( 'summary', $this->mSummary );
414 }
415 if ( $this->mNosummary !== null ) {
416 $htmlOut .= Html::hidden( 'nosummary', $this->mNosummary );
417 }
418 if ( $this->mPrefix !== '' ) {
419 $htmlOut .= Html::hidden( 'prefix', $this->mPrefix );
420 }
421 if ( $this->mMinor !== null ) {
422 $htmlOut .= Html::hidden( 'minor', $this->mMinor );
423 }
424 if ( $this->mType == 'comment' ) {
425 $htmlOut .= Html::hidden( 'section', 'new' );
426 }
427 $htmlOut .= Xml::openElement( 'input',
428 [
429 'type' => $this->mHidden ? 'hidden' : 'text',
430 'name' => 'title',
431 'class' => $this->getLinebreakClasses() .
432 'mw-ui-input mw-ui-input-inline createboxInput',
433 'value' => $this->mDefaultText,
434 'placeholder' => $this->mPlaceholderText,
435 'size' => $this->mWidth,
436 'dir' => $this->mDir,
437 ]
438 );
439 $htmlOut .= $this->mBR;
440 $htmlOut .= Xml::openElement( 'input',
441 [
442 'type' => 'submit',
443 'name' => 'create',
444 'class' => 'mw-ui-button mw-ui-progressive createboxButton',
445 'value' => $this->mButtonLabel
446 ]
447 );
448 $htmlOut .= Xml::closeElement( 'form' );
449 $htmlOut .= Xml::closeElement( 'div' );
450
451 // Return HTML
452 return $htmlOut;
453 }
454
458 public function getMoveForm() {
459 global $wgScript;
460
461 if ( !$this->mButtonLabel ) {
462 $this->mButtonLabel = wfMessage( 'inputbox-movearticle' )->text();
463 }
464
465 $htmlOut = Xml::openElement( 'div',
466 [
467 'class' => 'mw-inputbox-centered',
468 'style' => $this->bgColorStyle(),
469 ]
470 );
471 $moveBoxParams = [
472 'name' => 'movebox',
473 'class' => 'mw-movebox',
474 'action' => $wgScript,
475 'method' => 'get'
476 ];
477 if ( $this->mID !== '' ) {
478 $moveBoxParams['id'] = Sanitizer::escapeId( $this->mID );
479 }
480 $htmlOut .= Xml::openElement( 'form', $moveBoxParams );
481 $htmlOut .= Html::hidden( 'title',
482 SpecialPage::getTitleFor( 'Movepage', $this->mPage )->getPrefixedText() );
483 $htmlOut .= Html::hidden( 'wpReason', $this->mSummary );
484 $htmlOut .= Html::hidden( 'prefix', $this->mPrefix );
485 $htmlOut .= Xml::openElement( 'input',
486 [
487 'type' => $this->mHidden ? 'hidden' : 'text',
488 'name' => 'wpNewTitle',
489 'class' => $this->getLinebreakClasses() . 'mw-moveboxInput mw-ui-input mw-ui-input-inline',
490 'value' => $this->mDefaultText,
491 'placeholder' => $this->mPlaceholderText,
492 'size' => $this->mWidth,
493 'dir' => $this->mDir,
494 ]
495 );
496 $htmlOut .= $this->mBR;
497 $htmlOut .= Xml::openElement( 'input',
498 [
499 'type' => 'submit',
500 'class' => 'mw-ui-button mw-ui-progressive',
501 'value' => $this->mButtonLabel
502 ]
503 );
504 $htmlOut .= Xml::closeElement( 'form' );
505 $htmlOut .= Xml::closeElement( 'div' );
506
507 // Return HTML
508 return $htmlOut;
509 }
510
514 public function getCommentForm() {
515 global $wgScript;
516
517 if ( !$this->mButtonLabel ) {
518 $this->mButtonLabel = wfMessage( 'inputbox-postcommenttitle' )->text();
519 }
520
521 $htmlOut = Xml::openElement( 'div',
522 [
523 'class' => 'mw-inputbox-centered',
524 'style' => $this->bgColorStyle(),
525 ]
526 );
527 $commentFormParams = [
528 'name' => 'commentbox',
529 'class' => 'commentbox',
530 'action' => $wgScript,
531 'method' => 'get'
532 ];
533 if ( $this->mID !== '' ) {
534 $commentFormParams['id'] = Sanitizer::escapeId( $this->mID );
535 }
536 $htmlOut .= Xml::openElement( 'form', $commentFormParams );
537 $editArgs = $this->getEditActionArgs();
538 $htmlOut .= Html::hidden( $editArgs['name'], $editArgs['value'] );
539 if ( $this->mPreload !== null ) {
540 $htmlOut .= Html::hidden( 'preload', $this->mPreload );
541 }
542 if ( is_array( $this->mPreloadparams ) ) {
543 foreach ( $this->mPreloadparams as $preloadparams ) {
544 $htmlOut .= Html::hidden( 'preloadparams[]', $preloadparams );
545 }
546 }
547 if ( $this->mEditIntro !== null ) {
548 $htmlOut .= Html::hidden( 'editintro', $this->mEditIntro );
549 }
550 $htmlOut .= Xml::openElement( 'input',
551 [
552 'type' => $this->mHidden ? 'hidden' : 'text',
553 'name' => 'preloadtitle',
554 'class' => $this->getLinebreakClasses() . 'commentboxInput mw-ui-input mw-ui-input-inline',
555 'value' => $this->mDefaultText,
556 'placeholder' => $this->mPlaceholderText,
557 'size' => $this->mWidth,
558 'dir' => $this->mDir,
559 ]
560 );
561 $htmlOut .= Html::hidden( 'section', 'new' );
562 $htmlOut .= Html::hidden( 'title', $this->mPage );
563 $htmlOut .= $this->mBR;
564 $htmlOut .= Xml::openElement( 'input',
565 [
566 'type' => 'submit',
567 'name' => 'create',
568 'class' => 'mw-ui-button mw-ui-progressive',
569 'value' => $this->mButtonLabel
570 ]
571 );
572 $htmlOut .= Xml::closeElement( 'form' );
573 $htmlOut .= Xml::closeElement( 'div' );
574
575 // Return HTML
576 return $htmlOut;
577 }
578
584 public function extractOptions( $text ) {
585 // Parse all possible options
586 $values = [];
587 foreach ( explode( "\n", $text ) as $line ) {
588 if ( strpos( $line, '=' ) === false ) {
589 continue;
590 }
591 list( $name, $value ) = explode( '=', $line, 2 );
592 $name = strtolower( trim( $name ) );
593 $value = Sanitizer::decodeCharReferences( trim( $value ) );
594 if ( $name == 'preloadparams[]' ) {
595 // We have to special-case this one because it's valid for it to appear more than once.
596 $this->mPreloadparams[] = $value;
597 } else {
598 $values[ $name ] = $value;
599 }
600 }
601
602 // Validate the dir value.
603 if ( isset( $values['dir'] ) && !in_array( $values['dir'], [ 'ltr', 'rtl' ] ) ) {
604 unset( $values['dir'] );
605 }
606
607 // Build list of options, with local member names
608 $options = [
609 'type' => 'mType',
610 'width' => 'mWidth',
611 'preload' => 'mPreload',
612 'page' => 'mPage',
613 'editintro' => 'mEditIntro',
614 'useve' => 'mUseVE',
615 'summary' => 'mSummary',
616 'nosummary' => 'mNosummary',
617 'minor' => 'mMinor',
618 'break' => 'mBR',
619 'default' => 'mDefaultText',
620 'placeholder' => 'mPlaceholderText',
621 'bgcolor' => 'mBGColor',
622 'buttonlabel' => 'mButtonLabel',
623 'searchbuttonlabel' => 'mSearchButtonLabel',
624 'fulltextbutton' => 'mFullTextButton',
625 'namespaces' => 'mNamespaces',
626 'labeltext' => 'mLabelText',
627 'hidden' => 'mHidden',
628 'id' => 'mID',
629 'inline' => 'mInline',
630 'prefix' => 'mPrefix',
631 'dir' => 'mDir',
632 'searchfilter' => 'mSearchFilter',
633 'tour' => 'mTour'
634 ];
635 // Options we should maybe run through lang converter.
636 $convertOptions = [
637 'default' => true,
638 'buttonlabel' => true,
639 'searchbuttonlabel' => true,
640 'placeholder' => true
641 ];
642 foreach ( $options as $name => $var ) {
643 if ( isset( $values[$name] ) ) {
644 $this->$var = $values[$name];
645 if ( isset( $convertOptions[$name] ) ) {
646 $this->$var = $this->languageConvert( $this->$var );
647 }
648 }
649 }
650
651 // Insert a line break if configured to do so
652 $this->mBR = ( strtolower( $this->mBR ) == "no" ) ? ' ' : '<br />';
653
654 // Validate the width; make sure it's a valid, positive integer
655 $this->mWidth = intval( $this->mWidth <= 0 ? 50 : $this->mWidth );
656
657 // Validate background color
658 if ( !$this->isValidColor( $this->mBGColor ) ) {
659 $this->mBGColor = 'transparent';
660 }
661 }
662
666 public function isValidColor( $color ) {
667 $regex = <<<REGEX
668 /^ (
669 [a-zA-Z]* | # color names
670 \# [0-9a-f]{3} | # short hexadecimal
671 \# [0-9a-f]{6} | # long hexadecimal
672 rgb \s* \‍( \s* (
673 \d+ \s* , \s* \d+ \s* , \s* \d+ | # rgb integer
674 [0-9.]+% \s* , \s* [0-9.]+% \s* , \s* [0-9.]+% # rgb percent
675 ) \s* \)
676 ) $ /xi
677REGEX;
678 return (bool)preg_match( $regex, $color );
679 }
680
681 private function bgColorStyle() {
682 if ( $this->mBGColor != 'transparent' ) {
683 return 'background-color: ' . $this->mBGColor . ';';
684 }
685 return '';
686 }
687
694 private function shouldUseVE() {
695 return ExtensionRegistry::getInstance()->isLoaded( 'VisualEditor' ) && $this->mUseVE !== null;
696 }
697
712 private function languageConvert( $text ) {
713 $lang = $this->mParser->getConverterLanguage();
714 if ( $lang->hasVariants() && strpos( $text, '-{' ) !== false ) {
715 $text = $lang->convert( $text );
716 }
717 return $text;
718 }
719}
in the sidebar</td >< td > font color
$wgScript
The URL path to index.php.
$wgNamespaceAliases
Namespace aliases.
wfRandom()
Get a random decimal value between 0 and 1, in a way not likely to give duplicate values for any real...
$line
Definition cdb.php:58
if( $line===false) $args
Definition cdb.php:63
isValidColor( $color)
Do a security check on the bgcolor parameter.
languageConvert( $text)
For compatability with pre T119158 behaviour.
__construct( $parser)
getSearchForm2()
Generate search form version 2.
getLinebreakClasses()
Get common classes, that could be added and depend on, if a line break between a button and an input ...
getSearchForm( $type)
Generate search form.
getMoveForm()
Generate move page form.
getCreateForm()
Generate create page form.
getCommentForm()
Generate new section form.
extractOptions( $text)
Extract options from a blob of text.
shouldUseVE()
Returns true, if the VisualEditor is requested from the inputbox wikitext definition and if the Visua...
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name If you don't need a full Title object,...
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
Definition deferred.txt:11
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 local content language as $wgContLang
Definition design.txt:57
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add text
Definition design.txt:18
do that in ParserLimitReportFormat instead $parser
Definition hooks.txt:2572
namespace and then decline to actually register it & $namespaces
Definition hooks.txt:932
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:1971
either a unescaped string or a HtmlArmor object after in associative array form externallinks including delete and has completed for all link tables whether this was an auto creation 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;div ...>$1&lt;/div>"). - flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException':Called before an exception(or PHP error) is logged. This is meant for integration with external error aggregation services
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return true
Definition hooks.txt:1976
Allows to change the fields on the form that will be generated $name
Definition hooks.txt:302
if(!isset( $args[0])) $lang