MediaWiki  1.28.1
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  if ( $toolbox['permalink']['href'] === '' ) {
102  unset( $toolbox['permalink']['href'] );
103  $toolbox['ispermalink']['tooltiponly'] = true;
104  $toolbox['ispermalink']['id'] = 't-ispermalink';
105  $toolbox['ispermalink']['msg'] = 'permalink';
106  } else {
107  $toolbox['permalink']['id'] = 't-permalink';
108  }
109  }
110  if ( isset( $this->data['nav_urls']['info'] ) && $this->data['nav_urls']['info'] ) {
111  $toolbox['info'] = $this->data['nav_urls']['info'];
112  $toolbox['info']['id'] = 't-info';
113  }
114 
115  Hooks::run( 'BaseTemplateToolbox', [ &$this, &$toolbox ] );
116  return $toolbox;
117  }
118 
129  function getPersonalTools() {
130  $personal_tools = [];
131  foreach ( $this->get( 'personal_urls' ) as $key => $plink ) {
132  # The class on a personal_urls item is meant to go on the <a> instead
133  # of the <li> so we have to use a single item "links" array instead
134  # of using most of the personal_url's keys directly.
135  $ptool = [
136  'links' => [
137  [ 'single-id' => "pt-$key" ],
138  ],
139  'id' => "pt-$key",
140  ];
141  if ( isset( $plink['active'] ) ) {
142  $ptool['active'] = $plink['active'];
143  }
144  foreach ( [ 'href', 'class', 'text', 'dir', 'data' ] as $k ) {
145  if ( isset( $plink[$k] ) ) {
146  $ptool['links'][0][$k] = $plink[$k];
147  }
148  }
149  $personal_tools[$key] = $ptool;
150  }
151  return $personal_tools;
152  }
153 
154  function getSidebar( $options = [] ) {
155  // Force the rendering of the following portals
156  $sidebar = $this->data['sidebar'];
157  if ( !isset( $sidebar['SEARCH'] ) ) {
158  $sidebar['SEARCH'] = true;
159  }
160  if ( !isset( $sidebar['TOOLBOX'] ) ) {
161  $sidebar['TOOLBOX'] = true;
162  }
163  if ( !isset( $sidebar['LANGUAGES'] ) ) {
164  $sidebar['LANGUAGES'] = true;
165  }
166 
167  if ( !isset( $options['search'] ) || $options['search'] !== true ) {
168  unset( $sidebar['SEARCH'] );
169  }
170  if ( isset( $options['toolbox'] ) && $options['toolbox'] === false ) {
171  unset( $sidebar['TOOLBOX'] );
172  }
173  if ( isset( $options['languages'] ) && $options['languages'] === false ) {
174  unset( $sidebar['LANGUAGES'] );
175  }
176 
177  $boxes = [];
178  foreach ( $sidebar as $boxName => $content ) {
179  if ( $content === false ) {
180  continue;
181  }
182  switch ( $boxName ) {
183  case 'SEARCH':
184  // Search is a special case, skins should custom implement this
185  $boxes[$boxName] = [
186  'id' => 'p-search',
187  'header' => $this->getMsg( 'search' )->text(),
188  'generated' => false,
189  'content' => true,
190  ];
191  break;
192  case 'TOOLBOX':
193  $msgObj = $this->getMsg( 'toolbox' );
194  $boxes[$boxName] = [
195  'id' => 'p-tb',
196  'header' => $msgObj->exists() ? $msgObj->text() : 'toolbox',
197  'generated' => false,
198  'content' => $this->getToolbox(),
199  ];
200  break;
201  case 'LANGUAGES':
202  if ( $this->data['language_urls'] ) {
203  $msgObj = $this->getMsg( 'otherlanguages' );
204  $boxes[$boxName] = [
205  'id' => 'p-lang',
206  'header' => $msgObj->exists() ? $msgObj->text() : 'otherlanguages',
207  'generated' => false,
208  'content' => $this->data['language_urls'],
209  ];
210  }
211  break;
212  default:
213  $msgObj = $this->getMsg( $boxName );
214  $boxes[$boxName] = [
215  'id' => "p-$boxName",
216  'header' => $msgObj->exists() ? $msgObj->text() : $boxName,
217  'generated' => true,
218  'content' => $content,
219  ];
220  break;
221  }
222  }
223 
224  // HACK: Compatibility with extensions still using SkinTemplateToolboxEnd
225  $hookContents = null;
226  if ( isset( $boxes['TOOLBOX'] ) ) {
227  ob_start();
228  // We pass an extra 'true' at the end so extensions using BaseTemplateToolbox
229  // can abort and avoid outputting double toolbox links
230  Hooks::run( 'SkinTemplateToolboxEnd', [ &$this, true ] );
231  $hookContents = ob_get_contents();
232  ob_end_clean();
233  if ( !trim( $hookContents ) ) {
234  $hookContents = null;
235  }
236  }
237  // END hack
238 
239  if ( isset( $options['htmlOnly'] ) && $options['htmlOnly'] === true ) {
240  foreach ( $boxes as $boxName => $box ) {
241  if ( is_array( $box['content'] ) ) {
242  $content = '<ul>';
243  foreach ( $box['content'] as $key => $val ) {
244  $content .= "\n " . $this->makeListItem( $key, $val );
245  }
246  // HACK, shove the toolbox end onto the toolbox if we're rendering itself
247  if ( $hookContents ) {
248  $content .= "\n $hookContents";
249  }
250  // END hack
251  $content .= "\n</ul>\n";
252  $boxes[$boxName]['content'] = $content;
253  }
254  }
255  } else {
256  if ( $hookContents ) {
257  $boxes['TOOLBOXEND'] = [
258  'id' => 'p-toolboxend',
259  'header' => $boxes['TOOLBOX']['header'],
260  'generated' => false,
261  'content' => "<ul>{$hookContents}</ul>",
262  ];
263  // HACK: Make sure that TOOLBOXEND is sorted next to TOOLBOX
264  $boxes2 = [];
265  foreach ( $boxes as $key => $box ) {
266  if ( $key === 'TOOLBOXEND' ) {
267  continue;
268  }
269  $boxes2[$key] = $box;
270  if ( $key === 'TOOLBOX' ) {
271  $boxes2['TOOLBOXEND'] = $boxes['TOOLBOXEND'];
272  }
273  }
274  $boxes = $boxes2;
275  // END hack
276  }
277  }
278 
279  return $boxes;
280  }
281 
285  protected function renderAfterPortlet( $name ) {
286  $content = '';
287  Hooks::run( 'BaseTemplateAfterPortlet', [ $this, $name, &$content ] );
288 
289  if ( $content !== '' ) {
290  echo "<div class='after-portlet after-portlet-$name'>$content</div>";
291  }
292 
293  }
294 
347  function makeLink( $key, $item, $options = [] ) {
348  if ( isset( $item['text'] ) ) {
349  $text = $item['text'];
350  } else {
351  $text = $this->translator->translate( isset( $item['msg'] ) ? $item['msg'] : $key );
352  }
353 
354  $html = htmlspecialchars( $text );
355 
356  if ( isset( $options['text-wrapper'] ) ) {
357  $wrapper = $options['text-wrapper'];
358  if ( isset( $wrapper['tag'] ) ) {
359  $wrapper = [ $wrapper ];
360  }
361  while ( count( $wrapper ) > 0 ) {
362  $element = array_pop( $wrapper );
363  $html = Html::rawElement( $element['tag'], isset( $element['attributes'] )
364  ? $element['attributes']
365  : null, $html );
366  }
367  }
368 
369  if ( isset( $item['href'] ) || isset( $options['link-fallback'] ) ) {
370  $attrs = $item;
371  foreach ( [ 'single-id', 'text', 'msg', 'tooltiponly', 'context', 'primary',
372  'tooltip-params' ] as $k ) {
373  unset( $attrs[$k] );
374  }
375 
376  if ( isset( $attrs['data'] ) ) {
377  foreach ( $attrs['data'] as $key => $value ) {
378  $attrs[ 'data-' . $key ] = $value;
379  }
380  unset( $attrs[ 'data' ] );
381  }
382 
383  if ( isset( $item['id'] ) && !isset( $item['single-id'] ) ) {
384  $item['single-id'] = $item['id'];
385  }
386 
387  $tooltipParams = [];
388  if ( isset( $item['tooltip-params'] ) ) {
389  $tooltipParams = $item['tooltip-params'];
390  }
391 
392  if ( isset( $item['single-id'] ) ) {
393  if ( isset( $item['tooltiponly'] ) && $item['tooltiponly'] ) {
394  $title = Linker::titleAttrib( $item['single-id'], null, $tooltipParams );
395  if ( $title !== false ) {
396  $attrs['title'] = $title;
397  }
398  } else {
399  $tip = Linker::tooltipAndAccesskeyAttribs( $item['single-id'], $tooltipParams );
400  if ( isset( $tip['title'] ) && $tip['title'] !== false ) {
401  $attrs['title'] = $tip['title'];
402  }
403  if ( isset( $tip['accesskey'] ) && $tip['accesskey'] !== false ) {
404  $attrs['accesskey'] = $tip['accesskey'];
405  }
406  }
407  }
408  if ( isset( $options['link-class'] ) ) {
409  if ( isset( $attrs['class'] ) ) {
410  $attrs['class'] .= " {$options['link-class']}";
411  } else {
412  $attrs['class'] = $options['link-class'];
413  }
414  }
415  $html = Html::rawElement( isset( $attrs['href'] )
416  ? 'a'
417  : $options['link-fallback'], $attrs, $html );
418  }
419 
420  return $html;
421  }
422 
452  function makeListItem( $key, $item, $options = [] ) {
453  if ( isset( $item['links'] ) ) {
454  $links = [];
455  foreach ( $item['links'] as $linkKey => $link ) {
456  $links[] = $this->makeLink( $linkKey, $link, $options );
457  }
458  $html = implode( ' ', $links );
459  } else {
460  $link = $item;
461  // These keys are used by makeListItem and shouldn't be passed on to the link
462  foreach ( [ 'id', 'class', 'active', 'tag', 'itemtitle' ] as $k ) {
463  unset( $link[$k] );
464  }
465  if ( isset( $item['id'] ) && !isset( $item['single-id'] ) ) {
466  // The id goes on the <li> not on the <a> for single links
467  // but makeSidebarLink still needs to know what id to use when
468  // generating tooltips and accesskeys.
469  $link['single-id'] = $item['id'];
470  }
471  if ( isset( $link['link-class'] ) ) {
472  // link-class should be set on the <a> itself,
473  // so pass it in as 'class'
474  $link['class'] = $link['link-class'];
475  unset( $link['link-class'] );
476  }
477  $html = $this->makeLink( $key, $link, $options );
478  }
479 
480  $attrs = [];
481  foreach ( [ 'id', 'class' ] as $attr ) {
482  if ( isset( $item[$attr] ) ) {
483  $attrs[$attr] = $item[$attr];
484  }
485  }
486  if ( isset( $item['active'] ) && $item['active'] ) {
487  if ( !isset( $attrs['class'] ) ) {
488  $attrs['class'] = '';
489  }
490  $attrs['class'] .= ' active';
491  $attrs['class'] = trim( $attrs['class'] );
492  }
493  if ( isset( $item['itemtitle'] ) ) {
494  $attrs['title'] = $item['itemtitle'];
495  }
496  return Html::rawElement( isset( $options['tag'] ) ? $options['tag'] : 'li', $attrs, $html );
497  }
498 
499  function makeSearchInput( $attrs = [] ) {
500  $realAttrs = [
501  'type' => 'search',
502  'name' => 'search',
503  'placeholder' => wfMessage( 'searchsuggest-search' )->text(),
504  'value' => $this->get( 'search', '' ),
505  ];
506  $realAttrs = array_merge( $realAttrs, Linker::tooltipAndAccesskeyAttribs( 'search' ), $attrs );
507  return Html::element( 'input', $realAttrs );
508  }
509 
510  function makeSearchButton( $mode, $attrs = [] ) {
511  switch ( $mode ) {
512  case 'go':
513  case 'fulltext':
514  $realAttrs = [
515  'type' => 'submit',
516  'name' => $mode,
517  'value' => $this->translator->translate(
518  $mode == 'go' ? 'searcharticle' : 'searchbutton' ),
519  ];
520  $realAttrs = array_merge(
521  $realAttrs,
522  Linker::tooltipAndAccesskeyAttribs( "search-$mode" ),
523  $attrs
524  );
525  return Html::element( 'input', $realAttrs );
526  case 'image':
527  $buttonAttrs = [
528  'type' => 'submit',
529  'name' => 'button',
530  ];
531  $buttonAttrs = array_merge(
532  $buttonAttrs,
533  Linker::tooltipAndAccesskeyAttribs( 'search-fulltext' ),
534  $attrs
535  );
536  unset( $buttonAttrs['src'] );
537  unset( $buttonAttrs['alt'] );
538  unset( $buttonAttrs['width'] );
539  unset( $buttonAttrs['height'] );
540  $imgAttrs = [
541  'src' => $attrs['src'],
542  'alt' => isset( $attrs['alt'] )
543  ? $attrs['alt']
544  : $this->translator->translate( 'searchbutton' ),
545  'width' => isset( $attrs['width'] ) ? $attrs['width'] : null,
546  'height' => isset( $attrs['height'] ) ? $attrs['height'] : null,
547  ];
548  return Html::rawElement( 'button', $buttonAttrs, Html::element( 'img', $imgAttrs ) );
549  default:
550  throw new MWException( 'Unknown mode passed to BaseTemplate::makeSearchButton' );
551  }
552  }
553 
563  function getFooterLinks( $option = null ) {
564  $footerlinks = $this->get( 'footerlinks' );
565 
566  // Reduce footer links down to only those which are being used
567  $validFooterLinks = [];
568  foreach ( $footerlinks as $category => $links ) {
569  $validFooterLinks[$category] = [];
570  foreach ( $links as $link ) {
571  if ( isset( $this->data[$link] ) && $this->data[$link] ) {
572  $validFooterLinks[$category][] = $link;
573  }
574  }
575  if ( count( $validFooterLinks[$category] ) <= 0 ) {
576  unset( $validFooterLinks[$category] );
577  }
578  }
579 
580  if ( $option == 'flat' ) {
581  // fold footerlinks into a single array using a bit of trickery
582  $validFooterLinks = call_user_func_array(
583  'array_merge',
584  array_values( $validFooterLinks )
585  );
586  }
587 
588  return $validFooterLinks;
589  }
590 
603  function getFooterIcons( $option = null ) {
604  // Generate additional footer icons
605  $footericons = $this->get( 'footericons' );
606 
607  if ( $option == 'icononly' ) {
608  // Unset any icons which don't have an image
609  foreach ( $footericons as &$footerIconsBlock ) {
610  foreach ( $footerIconsBlock as $footerIconKey => $footerIcon ) {
611  if ( !is_string( $footerIcon ) && !isset( $footerIcon['src'] ) ) {
612  unset( $footerIconsBlock[$footerIconKey] );
613  }
614  }
615  }
616  // Redo removal of any empty blocks
617  foreach ( $footericons as $footerIconsKey => &$footerIconsBlock ) {
618  if ( count( $footerIconsBlock ) <= 0 ) {
619  unset( $footericons[$footerIconsKey] );
620  }
621  }
622  } elseif ( $option == 'nocopyright' ) {
623  unset( $footericons['copyright']['copyright'] );
624  if ( count( $footericons['copyright'] ) <= 0 ) {
625  unset( $footericons['copyright'] );
626  }
627  }
628 
629  return $footericons;
630  }
631 
647  public function getIndicators() {
648  $out = "<div class=\"mw-indicators\">\n";
649  foreach ( $this->data['indicators'] as $id => $content ) {
651  'div',
652  [
653  'id' => Sanitizer::escapeId( "mw-indicator-$id" ),
654  'class' => 'mw-indicator',
655  ],
656  $content
657  ) . "\n";
658  }
659  $out .= "</div>\n";
660  return $out;
661  }
662 
668  function printTrail() {
669 ?>
670 <?php echo MWDebug::getDebugHTML( $this->getSkin()->getContext() ); ?>
671 <?php $this->html( 'bottomscripts' ); /* JS call to runBodyOnloadHook */ ?>
672 <?php $this->html( 'reporttime' ) ?>
673 <?php
674  }
675 }
this hook is for auditing only RecentChangesLinked and Watchlist $special
Definition: hooks.txt:1007
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:6
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:1936
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:802
makeListItem($key, $item, $options=[])
Generates a list item for a navigation, portlet, portal, sidebar...
getPersonalTools()
Create an array of personal tools items from the data in the quicktemplate stored by SkinTemplate...
Generic wrapper for template functions, with interface compatible with what we use of PHPTAL 0...
static rawElement($element, $attribs=[], $contents= '')
Returns an HTML element in a string.
Definition: Html.php:209
makeLink($key, $item, $options=[])
Makes a link, usually used by makeListItem to generate a link for an item in a list used in navigatio...
New base template for a skin's template extended from QuickTemplate this class features helper method...
$value
makeSearchButton($mode, $attrs=[])
getToolbox()
Create an array of common toolbox items from the data in the quicktemplate stored by SkinTemplate...
static tooltipAndAccesskeyAttribs($name, array $msgParams=[])
Returns the attributes for the tooltip and access key.
Definition: Linker.php:2182
getFooterIcons($option=null)
Returns an array of footer icons filtered down by options relevant to how the skin wishes to display ...
usually copyright or history_copyright This message must be in HTML not wikitext & $link
Definition: hooks.txt:2889
getMsg($name)
Get a Message object with its context set.
getSkin()
Get the Skin object related to this object.
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:2022
getIndicators()
Get the suggested HTML for page status indicators: icons (or short text snippets) usually displayed i...
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 unsetoffset-wrap String Wrap the message in html(usually something like"&lt
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set and then return false from the hook function Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions as context called by AbstractContent::getParserOutput May be used to override the normal model specific rendering of page content as context as context $options
Definition: hooks.txt:1046
getContext()
getSidebar($options=[])
namespace and then decline to actually register it file or subcat img or subcat $title
Definition: hooks.txt:953
static run($event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
Definition: Hooks.php:131
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:9
static escapeId($id, $options=[])
Given a value, escape it so that it can be used in an id attribute and return it. ...
Definition: Sanitizer.php:1170
getFooterLinks($option=null)
Returns an array of footerlinks trimmed down to only those footer links that are valid.
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:35
makeSearchInput($attrs=[])
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set and then return false from the hook function Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions as context called by AbstractContent::getParserOutput May be used to override the normal model specific rendering of page content $content
Definition: hooks.txt:1046
renderAfterPortlet($name)
static element($element, $attribs=[], $contents= '')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
Definition: Html.php:229
static getDebugHTML(IContextSource $context)
Returns the HTML to add to the page for the toolbar.
Definition: MWDebug.php:424
printTrail()
Output the basic end-page trail including bottomscripts, reporttime, and debug stuff.
Allows to change the fields on the form that will be generated $name
Definition: hooks.txt:300