MediaWiki  REL1_31
BaseTemplate.php
Go to the documentation of this file.
1 <?php
26 abstract class BaseTemplate extends QuickTemplate {
27 
35  public function getMsg( $name /* ... */ ) {
36  return call_user_func_array( [ $this->getSkin(), 'msg' ], func_get_args() );
37  }
38 
39  function msg( $str ) {
40  echo $this->getMsg( $str )->escaped();
41  }
42 
43  function msgHtml( $str ) {
44  echo $this->getMsg( $str )->text();
45  }
46 
47  function msgWiki( $str ) {
48  echo $this->getMsg( $str )->parseAsBlock();
49  }
50 
58  function getToolbox() {
59  $toolbox = [];
60  if ( isset( $this->data['nav_urls']['whatlinkshere'] )
61  && $this->data['nav_urls']['whatlinkshere']
62  ) {
63  $toolbox['whatlinkshere'] = $this->data['nav_urls']['whatlinkshere'];
64  $toolbox['whatlinkshere']['id'] = 't-whatlinkshere';
65  }
66  if ( isset( $this->data['nav_urls']['recentchangeslinked'] )
67  && $this->data['nav_urls']['recentchangeslinked']
68  ) {
69  $toolbox['recentchangeslinked'] = $this->data['nav_urls']['recentchangeslinked'];
70  $toolbox['recentchangeslinked']['msg'] = 'recentchangeslinked-toolbox';
71  $toolbox['recentchangeslinked']['id'] = 't-recentchangeslinked';
72  $toolbox['recentchangeslinked']['rel'] = 'nofollow';
73  }
74  if ( isset( $this->data['feeds'] ) && $this->data['feeds'] ) {
75  $toolbox['feeds']['id'] = 'feedlinks';
76  $toolbox['feeds']['links'] = [];
77  foreach ( $this->data['feeds'] as $key => $feed ) {
78  $toolbox['feeds']['links'][$key] = $feed;
79  $toolbox['feeds']['links'][$key]['id'] = "feed-$key";
80  $toolbox['feeds']['links'][$key]['rel'] = 'alternate';
81  $toolbox['feeds']['links'][$key]['type'] = "application/{$key}+xml";
82  $toolbox['feeds']['links'][$key]['class'] = 'feedlink';
83  }
84  }
85  foreach ( [ 'contributions', 'log', 'blockip', 'emailuser',
86  'userrights', 'upload', 'specialpages' ] as $special
87  ) {
88  if ( isset( $this->data['nav_urls'][$special] ) && $this->data['nav_urls'][$special] ) {
89  $toolbox[$special] = $this->data['nav_urls'][$special];
90  $toolbox[$special]['id'] = "t-$special";
91  }
92  }
93  if ( isset( $this->data['nav_urls']['print'] ) && $this->data['nav_urls']['print'] ) {
94  $toolbox['print'] = $this->data['nav_urls']['print'];
95  $toolbox['print']['id'] = 't-print';
96  $toolbox['print']['rel'] = 'alternate';
97  $toolbox['print']['msg'] = 'printableversion';
98  }
99  if ( isset( $this->data['nav_urls']['permalink'] ) && $this->data['nav_urls']['permalink'] ) {
100  $toolbox['permalink'] = $this->data['nav_urls']['permalink'];
101  $toolbox['permalink']['id'] = 't-permalink';
102  }
103  if ( isset( $this->data['nav_urls']['info'] ) && $this->data['nav_urls']['info'] ) {
104  $toolbox['info'] = $this->data['nav_urls']['info'];
105  $toolbox['info']['id'] = 't-info';
106  }
107 
108  // Avoid PHP 7.1 warning from passing $this by reference
109  $template = $this;
110  Hooks::run( 'BaseTemplateToolbox', [ &$template, &$toolbox ] );
111  return $toolbox;
112  }
113 
124  function getPersonalTools() {
125  $personal_tools = [];
126  foreach ( $this->get( 'personal_urls' ) as $key => $plink ) {
127  # The class on a personal_urls item is meant to go on the <a> instead
128  # of the <li> so we have to use a single item "links" array instead
129  # of using most of the personal_url's keys directly.
130  $ptool = [
131  'links' => [
132  [ 'single-id' => "pt-$key" ],
133  ],
134  'id' => "pt-$key",
135  ];
136  if ( isset( $plink['active'] ) ) {
137  $ptool['active'] = $plink['active'];
138  }
139  foreach ( [ 'href', 'class', 'text', 'dir', 'data', 'exists' ] as $k ) {
140  if ( isset( $plink[$k] ) ) {
141  $ptool['links'][0][$k] = $plink[$k];
142  }
143  }
144  $personal_tools[$key] = $ptool;
145  }
146  return $personal_tools;
147  }
148 
149  function getSidebar( $options = [] ) {
150  // Force the rendering of the following portals
151  $sidebar = $this->data['sidebar'];
152  if ( !isset( $sidebar['SEARCH'] ) ) {
153  $sidebar['SEARCH'] = true;
154  }
155  if ( !isset( $sidebar['TOOLBOX'] ) ) {
156  $sidebar['TOOLBOX'] = true;
157  }
158  if ( !isset( $sidebar['LANGUAGES'] ) ) {
159  $sidebar['LANGUAGES'] = true;
160  }
161 
162  if ( !isset( $options['search'] ) || $options['search'] !== true ) {
163  unset( $sidebar['SEARCH'] );
164  }
165  if ( isset( $options['toolbox'] ) && $options['toolbox'] === false ) {
166  unset( $sidebar['TOOLBOX'] );
167  }
168  if ( isset( $options['languages'] ) && $options['languages'] === false ) {
169  unset( $sidebar['LANGUAGES'] );
170  }
171 
172  $boxes = [];
173  foreach ( $sidebar as $boxName => $content ) {
174  if ( $content === false ) {
175  continue;
176  }
177  switch ( $boxName ) {
178  case 'SEARCH':
179  // Search is a special case, skins should custom implement this
180  $boxes[$boxName] = [
181  'id' => 'p-search',
182  'header' => $this->getMsg( 'search' )->text(),
183  'generated' => false,
184  'content' => true,
185  ];
186  break;
187  case 'TOOLBOX':
188  $msgObj = $this->getMsg( 'toolbox' );
189  $boxes[$boxName] = [
190  'id' => 'p-tb',
191  'header' => $msgObj->exists() ? $msgObj->text() : 'toolbox',
192  'generated' => false,
193  'content' => $this->getToolbox(),
194  ];
195  break;
196  case 'LANGUAGES':
197  if ( $this->data['language_urls'] !== false ) {
198  $msgObj = $this->getMsg( 'otherlanguages' );
199  $boxes[$boxName] = [
200  'id' => 'p-lang',
201  'header' => $msgObj->exists() ? $msgObj->text() : 'otherlanguages',
202  'generated' => false,
203  'content' => $this->data['language_urls'] ?: [],
204  ];
205  }
206  break;
207  default:
208  $msgObj = $this->getMsg( $boxName );
209  $boxes[$boxName] = [
210  'id' => "p-$boxName",
211  'header' => $msgObj->exists() ? $msgObj->text() : $boxName,
212  'generated' => true,
213  'content' => $content,
214  ];
215  break;
216  }
217  }
218 
219  // HACK: Compatibility with extensions still using SkinTemplateToolboxEnd
220  $hookContents = null;
221  if ( isset( $boxes['TOOLBOX'] ) ) {
222  ob_start();
223  // We pass an extra 'true' at the end so extensions using BaseTemplateToolbox
224  // can abort and avoid outputting double toolbox links
225  // Avoid PHP 7.1 warning from passing $this by reference
226  $template = $this;
227  Hooks::run( 'SkinTemplateToolboxEnd', [ &$template, true ] );
228  $hookContents = ob_get_contents();
229  ob_end_clean();
230  if ( !trim( $hookContents ) ) {
231  $hookContents = null;
232  }
233  }
234  // END hack
235 
236  if ( isset( $options['htmlOnly'] ) && $options['htmlOnly'] === true ) {
237  foreach ( $boxes as $boxName => $box ) {
238  if ( is_array( $box['content'] ) ) {
239  $content = '<ul>';
240  foreach ( $box['content'] as $key => $val ) {
241  $content .= "\n " . $this->makeListItem( $key, $val );
242  }
243  // HACK, shove the toolbox end onto the toolbox if we're rendering itself
244  if ( $hookContents ) {
245  $content .= "\n $hookContents";
246  }
247  // END hack
248  $content .= "\n</ul>\n";
249  $boxes[$boxName]['content'] = $content;
250  }
251  }
252  } else {
253  if ( $hookContents ) {
254  $boxes['TOOLBOXEND'] = [
255  'id' => 'p-toolboxend',
256  'header' => $boxes['TOOLBOX']['header'],
257  'generated' => false,
258  'content' => "<ul>{$hookContents}</ul>",
259  ];
260  // HACK: Make sure that TOOLBOXEND is sorted next to TOOLBOX
261  $boxes2 = [];
262  foreach ( $boxes as $key => $box ) {
263  if ( $key === 'TOOLBOXEND' ) {
264  continue;
265  }
266  $boxes2[$key] = $box;
267  if ( $key === 'TOOLBOX' ) {
268  $boxes2['TOOLBOXEND'] = $boxes['TOOLBOXEND'];
269  }
270  }
271  $boxes = $boxes2;
272  // END hack
273  }
274  }
275 
276  return $boxes;
277  }
278 
282  protected function renderAfterPortlet( $name ) {
283  echo $this->getAfterPortlet( $name );
284  }
285 
294  protected function getAfterPortlet( $name ) {
295  $html = '';
296  $content = '';
297  Hooks::run( 'BaseTemplateAfterPortlet', [ $this, $name, &$content ] );
298 
299  if ( $content !== '' ) {
301  'div',
302  [ 'class' => [ 'after-portlet', 'after-portlet-' . $name ] ],
303  $content
304  );
305  }
306 
307  return $html;
308  }
309 
362  function makeLink( $key, $item, $options = [] ) {
363  if ( isset( $item['text'] ) ) {
364  $text = $item['text'];
365  } else {
366  $text = wfMessage( isset( $item['msg'] ) ? $item['msg'] : $key )->text();
367  }
368 
369  $html = htmlspecialchars( $text );
370 
371  if ( isset( $options['text-wrapper'] ) ) {
372  $wrapper = $options['text-wrapper'];
373  if ( isset( $wrapper['tag'] ) ) {
374  $wrapper = [ $wrapper ];
375  }
376  while ( count( $wrapper ) > 0 ) {
377  $element = array_pop( $wrapper );
378  $html = Html::rawElement( $element['tag'], isset( $element['attributes'] )
379  ? $element['attributes']
380  : null, $html );
381  }
382  }
383 
384  if ( isset( $item['href'] ) || isset( $options['link-fallback'] ) ) {
385  $attrs = $item;
386  foreach ( [ 'single-id', 'text', 'msg', 'tooltiponly', 'context', 'primary',
387  'tooltip-params', 'exists' ] as $k ) {
388  unset( $attrs[$k] );
389  }
390 
391  if ( isset( $attrs['data'] ) ) {
392  foreach ( $attrs['data'] as $key => $value ) {
393  $attrs[ 'data-' . $key ] = $value;
394  }
395  unset( $attrs[ 'data' ] );
396  }
397 
398  if ( isset( $item['id'] ) && !isset( $item['single-id'] ) ) {
399  $item['single-id'] = $item['id'];
400  }
401 
402  $tooltipParams = [];
403  if ( isset( $item['tooltip-params'] ) ) {
404  $tooltipParams = $item['tooltip-params'];
405  }
406 
407  if ( isset( $item['single-id'] ) ) {
408  $tooltipOption = isset( $item['exists'] ) && $item['exists'] === false ? 'nonexisting' : null;
409 
410  if ( isset( $item['tooltiponly'] ) && $item['tooltiponly'] ) {
411  $title = Linker::titleAttrib( $item['single-id'], $tooltipOption, $tooltipParams );
412  if ( $title !== false ) {
413  $attrs['title'] = $title;
414  }
415  } else {
417  $item['single-id'],
418  $tooltipParams,
419  $tooltipOption
420  );
421  if ( isset( $tip['title'] ) && $tip['title'] !== false ) {
422  $attrs['title'] = $tip['title'];
423  }
424  if ( isset( $tip['accesskey'] ) && $tip['accesskey'] !== false ) {
425  $attrs['accesskey'] = $tip['accesskey'];
426  }
427  }
428  }
429  if ( isset( $options['link-class'] ) ) {
430  if ( isset( $attrs['class'] ) ) {
431  $attrs['class'] .= " {$options['link-class']}";
432  } else {
433  $attrs['class'] = $options['link-class'];
434  }
435  }
436  $html = Html::rawElement( isset( $attrs['href'] )
437  ? 'a'
438  : $options['link-fallback'], $attrs, $html );
439  }
440 
441  return $html;
442  }
443 
473  function makeListItem( $key, $item, $options = [] ) {
474  if ( isset( $item['links'] ) ) {
475  $links = [];
476  foreach ( $item['links'] as $linkKey => $link ) {
477  $links[] = $this->makeLink( $linkKey, $link, $options );
478  }
479  $html = implode( ' ', $links );
480  } else {
481  $link = $item;
482  // These keys are used by makeListItem and shouldn't be passed on to the link
483  foreach ( [ 'id', 'class', 'active', 'tag', 'itemtitle' ] as $k ) {
484  unset( $link[$k] );
485  }
486  if ( isset( $item['id'] ) && !isset( $item['single-id'] ) ) {
487  // The id goes on the <li> not on the <a> for single links
488  // but makeSidebarLink still needs to know what id to use when
489  // generating tooltips and accesskeys.
490  $link['single-id'] = $item['id'];
491  }
492  if ( isset( $link['link-class'] ) ) {
493  // link-class should be set on the <a> itself,
494  // so pass it in as 'class'
495  $link['class'] = $link['link-class'];
496  unset( $link['link-class'] );
497  }
498  $html = $this->makeLink( $key, $link, $options );
499  }
500 
501  $attrs = [];
502  foreach ( [ 'id', 'class' ] as $attr ) {
503  if ( isset( $item[$attr] ) ) {
504  $attrs[$attr] = $item[$attr];
505  }
506  }
507  if ( isset( $item['active'] ) && $item['active'] ) {
508  if ( !isset( $attrs['class'] ) ) {
509  $attrs['class'] = '';
510  }
511  $attrs['class'] .= ' active';
512  $attrs['class'] = trim( $attrs['class'] );
513  }
514  if ( isset( $item['itemtitle'] ) ) {
515  $attrs['title'] = $item['itemtitle'];
516  }
517  return Html::rawElement( isset( $options['tag'] ) ? $options['tag'] : 'li', $attrs, $html );
518  }
519 
520  function makeSearchInput( $attrs = [] ) {
521  $realAttrs = [
522  'type' => 'search',
523  'name' => 'search',
524  'placeholder' => wfMessage( 'searchsuggest-search' )->text(),
525  ];
526  $realAttrs = array_merge( $realAttrs, Linker::tooltipAndAccesskeyAttribs( 'search' ), $attrs );
527  return Html::element( 'input', $realAttrs );
528  }
529 
530  function makeSearchButton( $mode, $attrs = [] ) {
531  switch ( $mode ) {
532  case 'go':
533  case 'fulltext':
534  $realAttrs = [
535  'type' => 'submit',
536  'name' => $mode,
537  'value' => wfMessage( $mode == 'go' ? 'searcharticle' : 'searchbutton' )->text(),
538  ];
539  $realAttrs = array_merge(
540  $realAttrs,
541  Linker::tooltipAndAccesskeyAttribs( "search-$mode" ),
542  $attrs
543  );
544  return Html::element( 'input', $realAttrs );
545  case 'image':
546  $buttonAttrs = [
547  'type' => 'submit',
548  'name' => 'button',
549  ];
550  $buttonAttrs = array_merge(
551  $buttonAttrs,
552  Linker::tooltipAndAccesskeyAttribs( 'search-fulltext' ),
553  $attrs
554  );
555  unset( $buttonAttrs['src'] );
556  unset( $buttonAttrs['alt'] );
557  unset( $buttonAttrs['width'] );
558  unset( $buttonAttrs['height'] );
559  $imgAttrs = [
560  'src' => $attrs['src'],
561  'alt' => isset( $attrs['alt'] )
562  ? $attrs['alt']
563  : wfMessage( 'searchbutton' )->text(),
564  'width' => isset( $attrs['width'] ) ? $attrs['width'] : null,
565  'height' => isset( $attrs['height'] ) ? $attrs['height'] : null,
566  ];
567  return Html::rawElement( 'button', $buttonAttrs, Html::element( 'img', $imgAttrs ) );
568  default:
569  throw new MWException( 'Unknown mode passed to BaseTemplate::makeSearchButton' );
570  }
571  }
572 
582  function getFooterLinks( $option = null ) {
583  $footerlinks = $this->get( 'footerlinks' );
584 
585  // Reduce footer links down to only those which are being used
586  $validFooterLinks = [];
587  foreach ( $footerlinks as $category => $links ) {
588  $validFooterLinks[$category] = [];
589  foreach ( $links as $link ) {
590  if ( isset( $this->data[$link] ) && $this->data[$link] ) {
591  $validFooterLinks[$category][] = $link;
592  }
593  }
594  if ( count( $validFooterLinks[$category] ) <= 0 ) {
595  unset( $validFooterLinks[$category] );
596  }
597  }
598 
599  if ( $option == 'flat' && count( $validFooterLinks ) ) {
600  // fold footerlinks into a single array using a bit of trickery
601  $validFooterLinks = call_user_func_array(
602  'array_merge',
603  array_values( $validFooterLinks )
604  );
605  }
606 
607  return $validFooterLinks;
608  }
609 
622  function getFooterIcons( $option = null ) {
623  // Generate additional footer icons
624  $footericons = $this->get( 'footericons' );
625 
626  if ( $option == 'icononly' ) {
627  // Unset any icons which don't have an image
628  foreach ( $footericons as &$footerIconsBlock ) {
629  foreach ( $footerIconsBlock as $footerIconKey => $footerIcon ) {
630  if ( !is_string( $footerIcon ) && !isset( $footerIcon['src'] ) ) {
631  unset( $footerIconsBlock[$footerIconKey] );
632  }
633  }
634  }
635  // Redo removal of any empty blocks
636  foreach ( $footericons as $footerIconsKey => &$footerIconsBlock ) {
637  if ( count( $footerIconsBlock ) <= 0 ) {
638  unset( $footericons[$footerIconsKey] );
639  }
640  }
641  } elseif ( $option == 'nocopyright' ) {
642  unset( $footericons['copyright']['copyright'] );
643  if ( count( $footericons['copyright'] ) <= 0 ) {
644  unset( $footericons['copyright'] );
645  }
646  }
647 
648  return $footericons;
649  }
650 
660  protected function getFooter( $iconStyle = 'icononly', $linkStyle = 'flat' ) {
661  $validFooterIcons = $this->getFooterIcons( $iconStyle );
662  $validFooterLinks = $this->getFooterLinks( $linkStyle );
663 
664  $html = '';
665 
666  if ( count( $validFooterIcons ) + count( $validFooterLinks ) > 0 ) {
667  $html .= Html::openElement( 'div', [
668  'id' => 'footer-bottom',
669  'role' => 'contentinfo',
670  'lang' => $this->get( 'userlang' ),
671  'dir' => $this->get( 'dir' )
672  ] );
673  $footerEnd = Html::closeElement( 'div' );
674  } else {
675  $footerEnd = '';
676  }
677  foreach ( $validFooterIcons as $blockName => $footerIcons ) {
678  $html .= Html::openElement( 'div', [
679  'id' => Sanitizer::escapeIdForAttribute( "f-{$blockName}ico" ),
680  'class' => 'footer-icons'
681  ] );
682  foreach ( $footerIcons as $icon ) {
683  $html .= $this->getSkin()->makeFooterIcon( $icon );
684  }
685  $html .= Html::closeElement( 'div' );
686  }
687  if ( count( $validFooterLinks ) > 0 ) {
688  $html .= Html::openElement( 'ul', [ 'id' => 'f-list', 'class' => 'footer-places' ] );
689  foreach ( $validFooterLinks as $aLink ) {
691  'li',
692  [ 'id' => Sanitizer::escapeIdForAttribute( $aLink ) ],
693  $this->get( $aLink )
694  );
695  }
696  $html .= Html::closeElement( 'ul' );
697  }
698 
699  $html .= $this->getClear() . $footerEnd;
700 
701  return $html;
702  }
703 
710  protected function getClear() {
711  return Html::element( 'div', [ 'class' => 'visualClear' ] );
712  }
713 
729  public function getIndicators() {
730  $out = "<div class=\"mw-indicators mw-body-content\">\n";
731  foreach ( $this->data['indicators'] as $id => $content ) {
733  'div',
734  [
735  'id' => Sanitizer::escapeIdForAttribute( "mw-indicator-$id" ),
736  'class' => 'mw-indicator',
737  ],
738  $content
739  ) . "\n";
740  }
741  $out .= "</div>\n";
742  return $out;
743  }
744 
748  function printTrail() {
749  echo $this->getTrail();
750  }
751 
760  function getTrail() {
762  $html .= $this->get( 'bottomscripts' );
763  $html .= $this->get( 'reporttime' );
764 
765  return $html;
766  }
767 }
BaseTemplate\getPersonalTools
getPersonalTools()
Create an array of personal tools items from the data in the quicktemplate stored by SkinTemplate.
Definition: BaseTemplate.php:124
BaseTemplate\getFooterLinks
getFooterLinks( $option=null)
Returns an array of footerlinks trimmed down to only those footer links that are valid.
Definition: BaseTemplate.php:582
BaseTemplate\msg
msg( $str)
Definition: BaseTemplate.php:39
BaseTemplate\msgWiki
msgWiki( $str)
An ugly, ugly hack.
Definition: BaseTemplate.php:47
MWDebug\getDebugHTML
static getDebugHTML(IContextSource $context)
Returns the HTML to add to the page for the toolbar.
Definition: MWDebug.php:422
$html
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses & $html
Definition: hooks.txt:2013
wfMessage
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
BaseTemplate\makeSearchButton
makeSearchButton( $mode, $attrs=[])
Definition: BaseTemplate.php:530
Sanitizer\escapeIdForAttribute
static escapeIdForAttribute( $id, $mode=self::ID_PRIMARY)
Given a section name or other user-generated or otherwise unsafe string, escapes it to be a valid HTM...
Definition: Sanitizer.php:1261
$template
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that probably a stub it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping $template
Definition: hooks.txt:831
$out
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that probably a stub it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output $out
Definition: hooks.txt:864
BaseTemplate\getClear
getClear()
Get a div with the core visualClear class, for clearing floats.
Definition: BaseTemplate.php:710
getContext
getContext()
QuickTemplate\getSkin
getSkin()
Get the Skin object related to this object.
Definition: QuickTemplate.php:190
php
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Definition: injection.txt:37
Linker\tooltipAndAccesskeyAttribs
static tooltipAndAccesskeyAttribs( $name, array $msgParams=[], $options=null)
Returns the attributes for the tooltip and access key.
Definition: Linker.php:2135
Html\closeElement
static closeElement( $element)
Returns "</$element>".
Definition: Html.php:309
MWException
MediaWiki exception.
Definition: MWException.php:26
BaseTemplate\getAfterPortlet
getAfterPortlet( $name)
Allows extensions to hook into known portlets and add stuff to them.
Definition: BaseTemplate.php:294
BaseTemplate\printTrail
printTrail()
Output getTrail.
Definition: BaseTemplate.php:748
BaseTemplate\makeListItem
makeListItem( $key, $item, $options=[])
Generates a list item for a navigation, portlet, portal, sidebar...
Definition: BaseTemplate.php:473
$link
usually copyright or history_copyright This message must be in HTML not wikitext & $link
Definition: hooks.txt:3021
$title
namespace and then decline to actually register it file or subcat img or subcat $title
Definition: hooks.txt:964
BaseTemplate\getIndicators
getIndicators()
Get the suggested HTML for page status indicators: icons (or short text snippets) usually displayed i...
Definition: BaseTemplate.php:729
BaseTemplate\msgHtml
msgHtml( $str)
Definition: BaseTemplate.php:43
$options
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped & $options
Definition: hooks.txt:2001
BaseTemplate\getFooter
getFooter( $iconStyle='icononly', $linkStyle='flat')
Renderer for getFooterIcons and getFooterLinks.
Definition: BaseTemplate.php:660
BaseTemplate\renderAfterPortlet
renderAfterPortlet( $name)
Definition: BaseTemplate.php:282
BaseTemplate\getMsg
getMsg( $name)
Get a Message object with its context set.
Definition: BaseTemplate.php:35
$value
$value
Definition: styleTest.css.php:45
BaseTemplate\makeSearchInput
makeSearchInput( $attrs=[])
Definition: BaseTemplate.php:520
Linker\titleAttrib
static titleAttrib( $name, $options=null, array $msgParams=[])
Given the id of an interface element, constructs the appropriate title attribute from the system mess...
Definition: Linker.php:1969
QuickTemplate
Generic wrapper for template functions, with interface compatible with what we use of PHPTAL 0....
Definition: QuickTemplate.php:27
$name
Allows to change the fields on the form that will be generated $name
Definition: hooks.txt:302
BaseTemplate\getToolbox
getToolbox()
Create an array of common toolbox items from the data in the quicktemplate stored by SkinTemplate.
Definition: BaseTemplate.php:58
as
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
Definition: distributors.txt:22
BaseTemplate\getTrail
getTrail()
Get the basic end-page trail including bottomscripts, reporttime, and debug stuff.
Definition: BaseTemplate.php:760
Html\openElement
static openElement( $element, $attribs=[])
Identical to rawElement(), but has no third parameter and omits the end tag (and the self-closing '/'...
Definition: Html.php:251
Html\rawElement
static rawElement( $element, $attribs=[], $contents='')
Returns an HTML element in a string.
Definition: Html.php:209
BaseTemplate\makeLink
makeLink( $key, $item, $options=[])
Makes a link, usually used by makeListItem to generate a link for an item in a list used in navigatio...
Definition: BaseTemplate.php:362
$special
this hook is for auditing only RecentChangesLinked and Watchlist $special
Definition: hooks.txt:998
Html\element
static element( $element, $attribs=[], $contents='')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
Definition: Html.php:231
BaseTemplate\getFooterIcons
getFooterIcons( $option=null)
Returns an array of footer icons filtered down by options relevant to how the skin wishes to display ...
Definition: BaseTemplate.php:622
Hooks\run
static run( $event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
Definition: Hooks.php:203
BaseTemplate
New base template for a skin's template extended from QuickTemplate this class features helper method...
Definition: BaseTemplate.php:26
data
and how to run hooks for an and one after Each event has a preferably in CamelCase For ArticleDelete hook A clump of code and data that should be run when an event happens This can be either a function and a chunk of data
Definition: hooks.txt:18
BaseTemplate\getSidebar
getSidebar( $options=[])
Definition: BaseTemplate.php:149