MediaWiki  1.27.3
BaseTemplate.php
Go to the documentation of this file.
1 <?php
26 abstract class BaseTemplate extends QuickTemplate {
27 
34  public function getMsg( $name ) {
35  return $this->getSkin()->msg( $name );
36  }
37 
38  function msg( $str ) {
39  echo $this->getMsg( $str )->escaped();
40  }
41 
42  function msgHtml( $str ) {
43  echo $this->getMsg( $str )->text();
44  }
45 
46  function msgWiki( $str ) {
47  echo $this->getMsg( $str )->parseAsBlock();
48  }
49 
57  function getToolbox() {
58 
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  }
73  if ( isset( $this->data['feeds'] ) && $this->data['feeds'] ) {
74  $toolbox['feeds']['id'] = 'feedlinks';
75  $toolbox['feeds']['links'] = [];
76  foreach ( $this->data['feeds'] as $key => $feed ) {
77  $toolbox['feeds']['links'][$key] = $feed;
78  $toolbox['feeds']['links'][$key]['id'] = "feed-$key";
79  $toolbox['feeds']['links'][$key]['rel'] = 'alternate';
80  $toolbox['feeds']['links'][$key]['type'] = "application/{$key}+xml";
81  $toolbox['feeds']['links'][$key]['class'] = 'feedlink';
82  }
83  }
84  foreach ( [ 'contributions', 'log', 'blockip', 'emailuser',
85  'userrights', 'upload', 'specialpages' ] as $special
86  ) {
87  if ( isset( $this->data['nav_urls'][$special] ) && $this->data['nav_urls'][$special] ) {
88  $toolbox[$special] = $this->data['nav_urls'][$special];
89  $toolbox[$special]['id'] = "t-$special";
90  }
91  }
92  if ( isset( $this->data['nav_urls']['print'] ) && $this->data['nav_urls']['print'] ) {
93  $toolbox['print'] = $this->data['nav_urls']['print'];
94  $toolbox['print']['id'] = 't-print';
95  $toolbox['print']['rel'] = 'alternate';
96  $toolbox['print']['msg'] = 'printableversion';
97  }
98  if ( isset( $this->data['nav_urls']['permalink'] ) && $this->data['nav_urls']['permalink'] ) {
99  $toolbox['permalink'] = $this->data['nav_urls']['permalink'];
100  if ( $toolbox['permalink']['href'] === '' ) {
101  unset( $toolbox['permalink']['href'] );
102  $toolbox['ispermalink']['tooltiponly'] = true;
103  $toolbox['ispermalink']['id'] = 't-ispermalink';
104  $toolbox['ispermalink']['msg'] = 'permalink';
105  } else {
106  $toolbox['permalink']['id'] = 't-permalink';
107  }
108  }
109  if ( isset( $this->data['nav_urls']['info'] ) && $this->data['nav_urls']['info'] ) {
110  $toolbox['info'] = $this->data['nav_urls']['info'];
111  $toolbox['info']['id'] = 't-info';
112  }
113 
114  // Avoid PHP 7.1 warning from passing $this by reference
115  $template = $this;
116  Hooks::run( 'BaseTemplateToolbox', [ &$template, &$toolbox ] );
117  return $toolbox;
118  }
119 
130  function getPersonalTools() {
131  $personal_tools = [];
132  foreach ( $this->get( 'personal_urls' ) as $key => $plink ) {
133  # The class on a personal_urls item is meant to go on the <a> instead
134  # of the <li> so we have to use a single item "links" array instead
135  # of using most of the personal_url's keys directly.
136  $ptool = [
137  'links' => [
138  [ 'single-id' => "pt-$key" ],
139  ],
140  'id' => "pt-$key",
141  ];
142  if ( isset( $plink['active'] ) ) {
143  $ptool['active'] = $plink['active'];
144  }
145  foreach ( [ 'href', 'class', 'text', 'dir' ] as $k ) {
146  if ( isset( $plink[$k] ) ) {
147  $ptool['links'][0][$k] = $plink[$k];
148  }
149  }
150  $personal_tools[$key] = $ptool;
151  }
152  return $personal_tools;
153  }
154 
155  function getSidebar( $options = [] ) {
156  // Force the rendering of the following portals
157  $sidebar = $this->data['sidebar'];
158  if ( !isset( $sidebar['SEARCH'] ) ) {
159  $sidebar['SEARCH'] = true;
160  }
161  if ( !isset( $sidebar['TOOLBOX'] ) ) {
162  $sidebar['TOOLBOX'] = true;
163  }
164  if ( !isset( $sidebar['LANGUAGES'] ) ) {
165  $sidebar['LANGUAGES'] = true;
166  }
167 
168  if ( !isset( $options['search'] ) || $options['search'] !== true ) {
169  unset( $sidebar['SEARCH'] );
170  }
171  if ( isset( $options['toolbox'] ) && $options['toolbox'] === false ) {
172  unset( $sidebar['TOOLBOX'] );
173  }
174  if ( isset( $options['languages'] ) && $options['languages'] === false ) {
175  unset( $sidebar['LANGUAGES'] );
176  }
177 
178  $boxes = [];
179  foreach ( $sidebar as $boxName => $content ) {
180  if ( $content === false ) {
181  continue;
182  }
183  switch ( $boxName ) {
184  case 'SEARCH':
185  // Search is a special case, skins should custom implement this
186  $boxes[$boxName] = [
187  'id' => 'p-search',
188  'header' => $this->getMsg( 'search' )->text(),
189  'generated' => false,
190  'content' => true,
191  ];
192  break;
193  case 'TOOLBOX':
194  $msgObj = $this->getMsg( 'toolbox' );
195  $boxes[$boxName] = [
196  'id' => 'p-tb',
197  'header' => $msgObj->exists() ? $msgObj->text() : 'toolbox',
198  'generated' => false,
199  'content' => $this->getToolbox(),
200  ];
201  break;
202  case 'LANGUAGES':
203  if ( $this->data['language_urls'] ) {
204  $msgObj = $this->getMsg( 'otherlanguages' );
205  $boxes[$boxName] = [
206  'id' => 'p-lang',
207  'header' => $msgObj->exists() ? $msgObj->text() : 'otherlanguages',
208  'generated' => false,
209  'content' => $this->data['language_urls'],
210  ];
211  }
212  break;
213  default:
214  $msgObj = $this->getMsg( $boxName );
215  $boxes[$boxName] = [
216  'id' => "p-$boxName",
217  'header' => $msgObj->exists() ? $msgObj->text() : $boxName,
218  'generated' => true,
219  'content' => $content,
220  ];
221  break;
222  }
223  }
224 
225  // HACK: Compatibility with extensions still using SkinTemplateToolboxEnd
226  $hookContents = null;
227  if ( isset( $boxes['TOOLBOX'] ) ) {
228  ob_start();
229  // We pass an extra 'true' at the end so extensions using BaseTemplateToolbox
230  // can abort and avoid outputting double toolbox links
231  // Avoid PHP 7.1 warning from passing $this by reference
232  $template = $this;
233  Hooks::run( 'SkinTemplateToolboxEnd', [ &$template, true ] );
234  $hookContents = ob_get_contents();
235  ob_end_clean();
236  if ( !trim( $hookContents ) ) {
237  $hookContents = null;
238  }
239  }
240  // END hack
241 
242  if ( isset( $options['htmlOnly'] ) && $options['htmlOnly'] === true ) {
243  foreach ( $boxes as $boxName => $box ) {
244  if ( is_array( $box['content'] ) ) {
245  $content = '<ul>';
246  foreach ( $box['content'] as $key => $val ) {
247  $content .= "\n " . $this->makeListItem( $key, $val );
248  }
249  // HACK, shove the toolbox end onto the toolbox if we're rendering itself
250  if ( $hookContents ) {
251  $content .= "\n $hookContents";
252  }
253  // END hack
254  $content .= "\n</ul>\n";
255  $boxes[$boxName]['content'] = $content;
256  }
257  }
258  } else {
259  if ( $hookContents ) {
260  $boxes['TOOLBOXEND'] = [
261  'id' => 'p-toolboxend',
262  'header' => $boxes['TOOLBOX']['header'],
263  'generated' => false,
264  'content' => "<ul>{$hookContents}</ul>",
265  ];
266  // HACK: Make sure that TOOLBOXEND is sorted next to TOOLBOX
267  $boxes2 = [];
268  foreach ( $boxes as $key => $box ) {
269  if ( $key === 'TOOLBOXEND' ) {
270  continue;
271  }
272  $boxes2[$key] = $box;
273  if ( $key === 'TOOLBOX' ) {
274  $boxes2['TOOLBOXEND'] = $boxes['TOOLBOXEND'];
275  }
276  }
277  $boxes = $boxes2;
278  // END hack
279  }
280  }
281 
282  return $boxes;
283  }
284 
288  protected function renderAfterPortlet( $name ) {
289  $content = '';
290  Hooks::run( 'BaseTemplateAfterPortlet', [ $this, $name, &$content ] );
291 
292  if ( $content !== '' ) {
293  echo "<div class='after-portlet after-portlet-$name'>$content</div>";
294  }
295 
296  }
297 
341  function makeLink( $key, $item, $options = [] ) {
342  if ( isset( $item['text'] ) ) {
343  $text = $item['text'];
344  } else {
345  $text = $this->translator->translate( isset( $item['msg'] ) ? $item['msg'] : $key );
346  }
347 
348  $html = htmlspecialchars( $text );
349 
350  if ( isset( $options['text-wrapper'] ) ) {
351  $wrapper = $options['text-wrapper'];
352  if ( isset( $wrapper['tag'] ) ) {
353  $wrapper = [ $wrapper ];
354  }
355  while ( count( $wrapper ) > 0 ) {
356  $element = array_pop( $wrapper );
357  $html = Html::rawElement( $element['tag'], isset( $element['attributes'] )
358  ? $element['attributes']
359  : null, $html );
360  }
361  }
362 
363  if ( isset( $item['href'] ) || isset( $options['link-fallback'] ) ) {
364  $attrs = $item;
365  foreach ( [ 'single-id', 'text', 'msg', 'tooltiponly', 'context', 'primary',
366  'tooltip-params' ] as $k ) {
367  unset( $attrs[$k] );
368  }
369 
370  if ( isset( $item['id'] ) && !isset( $item['single-id'] ) ) {
371  $item['single-id'] = $item['id'];
372  }
373 
374  $tooltipParams = [];
375  if ( isset( $item['tooltip-params'] ) ) {
376  $tooltipParams = $item['tooltip-params'];
377  }
378 
379  if ( isset( $item['single-id'] ) ) {
380  if ( isset( $item['tooltiponly'] ) && $item['tooltiponly'] ) {
381  $title = Linker::titleAttrib( $item['single-id'], null, $tooltipParams );
382  if ( $title !== false ) {
383  $attrs['title'] = $title;
384  }
385  } else {
386  $tip = Linker::tooltipAndAccesskeyAttribs( $item['single-id'], $tooltipParams );
387  if ( isset( $tip['title'] ) && $tip['title'] !== false ) {
388  $attrs['title'] = $tip['title'];
389  }
390  if ( isset( $tip['accesskey'] ) && $tip['accesskey'] !== false ) {
391  $attrs['accesskey'] = $tip['accesskey'];
392  }
393  }
394  }
395  if ( isset( $options['link-class'] ) ) {
396  if ( isset( $attrs['class'] ) ) {
397  $attrs['class'] .= " {$options['link-class']}";
398  } else {
399  $attrs['class'] = $options['link-class'];
400  }
401  }
402  $html = Html::rawElement( isset( $attrs['href'] )
403  ? 'a'
404  : $options['link-fallback'], $attrs, $html );
405  }
406 
407  return $html;
408  }
409 
438  function makeListItem( $key, $item, $options = [] ) {
439  if ( isset( $item['links'] ) ) {
440  $links = [];
441  foreach ( $item['links'] as $linkKey => $link ) {
442  $links[] = $this->makeLink( $linkKey, $link, $options );
443  }
444  $html = implode( ' ', $links );
445  } else {
446  $link = $item;
447  // These keys are used by makeListItem and shouldn't be passed on to the link
448  foreach ( [ 'id', 'class', 'active', 'tag', 'itemtitle' ] as $k ) {
449  unset( $link[$k] );
450  }
451  if ( isset( $item['id'] ) && !isset( $item['single-id'] ) ) {
452  // The id goes on the <li> not on the <a> for single links
453  // but makeSidebarLink still needs to know what id to use when
454  // generating tooltips and accesskeys.
455  $link['single-id'] = $item['id'];
456  }
457  $html = $this->makeLink( $key, $link, $options );
458  }
459 
460  $attrs = [];
461  foreach ( [ 'id', 'class' ] as $attr ) {
462  if ( isset( $item[$attr] ) ) {
463  $attrs[$attr] = $item[$attr];
464  }
465  }
466  if ( isset( $item['active'] ) && $item['active'] ) {
467  if ( !isset( $attrs['class'] ) ) {
468  $attrs['class'] = '';
469  }
470  $attrs['class'] .= ' active';
471  $attrs['class'] = trim( $attrs['class'] );
472  }
473  if ( isset( $item['itemtitle'] ) ) {
474  $attrs['title'] = $item['itemtitle'];
475  }
476  return Html::rawElement( isset( $options['tag'] ) ? $options['tag'] : 'li', $attrs, $html );
477  }
478 
479  function makeSearchInput( $attrs = [] ) {
480  $realAttrs = [
481  'type' => 'search',
482  'name' => 'search',
483  'placeholder' => wfMessage( 'searchsuggest-search' )->text(),
484  'value' => $this->get( 'search', '' ),
485  ];
486  $realAttrs = array_merge( $realAttrs, Linker::tooltipAndAccesskeyAttribs( 'search' ), $attrs );
487  return Html::element( 'input', $realAttrs );
488  }
489 
490  function makeSearchButton( $mode, $attrs = [] ) {
491  switch ( $mode ) {
492  case 'go':
493  case 'fulltext':
494  $realAttrs = [
495  'type' => 'submit',
496  'name' => $mode,
497  'value' => $this->translator->translate(
498  $mode == 'go' ? 'searcharticle' : 'searchbutton' ),
499  ];
500  $realAttrs = array_merge(
501  $realAttrs,
502  Linker::tooltipAndAccesskeyAttribs( "search-$mode" ),
503  $attrs
504  );
505  return Html::element( 'input', $realAttrs );
506  case 'image':
507  $buttonAttrs = [
508  'type' => 'submit',
509  'name' => 'button',
510  ];
511  $buttonAttrs = array_merge(
512  $buttonAttrs,
513  Linker::tooltipAndAccesskeyAttribs( 'search-fulltext' ),
514  $attrs
515  );
516  unset( $buttonAttrs['src'] );
517  unset( $buttonAttrs['alt'] );
518  unset( $buttonAttrs['width'] );
519  unset( $buttonAttrs['height'] );
520  $imgAttrs = [
521  'src' => $attrs['src'],
522  'alt' => isset( $attrs['alt'] )
523  ? $attrs['alt']
524  : $this->translator->translate( 'searchbutton' ),
525  'width' => isset( $attrs['width'] ) ? $attrs['width'] : null,
526  'height' => isset( $attrs['height'] ) ? $attrs['height'] : null,
527  ];
528  return Html::rawElement( 'button', $buttonAttrs, Html::element( 'img', $imgAttrs ) );
529  default:
530  throw new MWException( 'Unknown mode passed to BaseTemplate::makeSearchButton' );
531  }
532  }
533 
543  function getFooterLinks( $option = null ) {
544  $footerlinks = $this->get( 'footerlinks' );
545 
546  // Reduce footer links down to only those which are being used
547  $validFooterLinks = [];
548  foreach ( $footerlinks as $category => $links ) {
549  $validFooterLinks[$category] = [];
550  foreach ( $links as $link ) {
551  if ( isset( $this->data[$link] ) && $this->data[$link] ) {
552  $validFooterLinks[$category][] = $link;
553  }
554  }
555  if ( count( $validFooterLinks[$category] ) <= 0 ) {
556  unset( $validFooterLinks[$category] );
557  }
558  }
559 
560  if ( $option == 'flat' ) {
561  // fold footerlinks into a single array using a bit of trickery
562  $validFooterLinks = call_user_func_array(
563  'array_merge',
564  array_values( $validFooterLinks )
565  );
566  }
567 
568  return $validFooterLinks;
569  }
570 
583  function getFooterIcons( $option = null ) {
584  // Generate additional footer icons
585  $footericons = $this->get( 'footericons' );
586 
587  if ( $option == 'icononly' ) {
588  // Unset any icons which don't have an image
589  foreach ( $footericons as &$footerIconsBlock ) {
590  foreach ( $footerIconsBlock as $footerIconKey => $footerIcon ) {
591  if ( !is_string( $footerIcon ) && !isset( $footerIcon['src'] ) ) {
592  unset( $footerIconsBlock[$footerIconKey] );
593  }
594  }
595  }
596  // Redo removal of any empty blocks
597  foreach ( $footericons as $footerIconsKey => &$footerIconsBlock ) {
598  if ( count( $footerIconsBlock ) <= 0 ) {
599  unset( $footericons[$footerIconsKey] );
600  }
601  }
602  } elseif ( $option == 'nocopyright' ) {
603  unset( $footericons['copyright']['copyright'] );
604  if ( count( $footericons['copyright'] ) <= 0 ) {
605  unset( $footericons['copyright'] );
606  }
607  }
608 
609  return $footericons;
610  }
611 
627  public function getIndicators() {
628  $out = "<div class=\"mw-indicators\">\n";
629  foreach ( $this->data['indicators'] as $id => $content ) {
631  'div',
632  [
633  'id' => Sanitizer::escapeId( "mw-indicator-$id" ),
634  'class' => 'mw-indicator',
635  ],
636  $content
637  ) . "\n";
638  }
639  $out .= "</div>\n";
640  return $out;
641  }
642 
648  function printTrail() {
649 ?>
650 <?php echo MWDebug::getDebugHTML( $this->getSkin()->getContext() ); ?>
651 <?php $this->html( 'bottomscripts' ); /* JS call to runBodyOnloadHook */ ?>
652 <?php $this->html( 'reporttime' ) ?>
653 <?php
654  }
655 }
this hook is for auditing only RecentChangesLinked and Watchlist $special
Definition: hooks.txt:969
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:1802
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:766
magic word the default is to use $key to get the and $key value or $key value text $key value html to format the value $key
Definition: hooks.txt:2325
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:210
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...
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:2335
getFooterIcons($option=null)
Returns an array of footer icons filtered down by options relevant to how the skin wishes to display ...
the value to return A Title object or null for latest to be modified or replaced by the hook handler or if authentication is not possible after cache objects are set for highlighting & $link
Definition: hooks.txt:2585
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:766
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:2178
getIndicators()
Get the suggested HTML for page status indicators: icons (or short text snippets) usually displayed i...
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:1008
getSidebar($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 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 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
namespace and then decline to actually register it file or subcat img or subcat $title
Definition: hooks.txt:916
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:1132
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:1008
renderAfterPortlet($name)
static element($element, $attribs=[], $contents= '')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
Definition: Html.php:230
static getDebugHTML(IContextSource $context)
Returns the HTML to add to the page for the toolbar.
Definition: MWDebug.php:427
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:314