$oldid: oldid (int) being viewed
'DoEditSectionLink': Override the HTML generated for section edit links
+* Deprecated in favour of SkinEditSectionLinks hook *
$skin: Skin object rendering the UI
$title: Title object for the title being linked to (may not be the same as
the page title, if the section is included from a template)
&$forContent: overridable flag if copyright footer is shown in content language.
This parameter is deprecated.
+'SkinEditSectionLinks': Modify the section edit links
+$skin: Skin object rendering the UI
+$title: Title object for the title being linked to (may not be the same as
+ the page title, if the section is included from a template)
+$section: The designation of the section being pointed to, to be included in
+ the link, like "§ion=$section"
+$tooltip: The default tooltip. Escape before using.
+ By default, this is wrapped in the 'editsectionhint' message.
+&$result: Array containing all link detail arrays. Each link detail array should contain
+ the following keys:
+ * targetTitle - Target Title object
+ * text - String for the text
+ * attribs - Array of attributes
+ * query - Array of query parameters to add to the URL
+ * options - Array of options for Linker::link
+$lang: The language code to use for the link in the wfMessage function
+
'SkinGetPoweredBy': TODO
&$text: additional 'powered by' icons in HTML. Note: Modern skin does not use
the MediaWiki icon but plain text instead.
$attribs['title'] = wfMessage( 'editsectionhint' )->rawParams( $tooltip )
->inLanguage( $lang )->text();
}
- $link = Linker::link( $nt, wfMessage( 'editsection' )->inLanguage( $lang )->text(),
- $attribs,
- array( 'action' => 'edit', 'section' => $section ),
- array( 'noclasses', 'known' )
+
+ $links = array(
+ 'editsection' => array(
+ 'text' => wfMessage( 'editsection' )->inLanguage( $lang )->text(),
+ 'targetTitle' => $nt,
+ 'attribs' => $attribs,
+ 'query' => array( 'action' => 'edit', 'section' => $section ),
+ 'options' => array( 'noclasses', 'known' )
+ )
+ );
+
+ Hooks::run( 'SkinEditSectionLinks', array( $this, $nt, $section, $tooltip, &$links, $lang ) );
+
+ $result = '<span class="mw-editsection"><span class="mw-editsection-bracket">[</span>';
+
+ $linksHtml = array();
+ foreach ( $links as $k => $linkDetails ) {
+ $linksHtml[] = Linker::link(
+ $linkDetails['targetTitle'],
+ $linkDetails['text'],
+ $linkDetails['attribs'],
+ $linkDetails['query'],
+ $linkDetails['options']
+ );
+ }
+
+ $result .= implode(
+ '<span class="mw-editsection-divider">'
+ . wfMessage( 'pipe-separator' )->inLanguage( $lang )->text()
+ . '</span>',
+ $linksHtml
);
- # Add the brackets and the span and run the hook.
- $result = '<span class="mw-editsection">'
- . '<span class="mw-editsection-bracket">[</span>'
- . $link
- . '<span class="mw-editsection-bracket">]</span>'
- . '</span>';
+ $result .= '<span class="mw-editsection-bracket">]</span></span>';
Hooks::run( 'DoEditSectionLink', array( $this, $nt, $section, $tooltip, &$result, $lang ) );
return $result;