a non-existent article or re-creating a previously-deleted article
* Added variables 'wgRestrictionEdit' and 'wgRestrictionMove' for JS to header
* (bug 9898) Allow viewing all namespaces in Special:Newpages
+* (bug 10139) Introduce 'EditSectionLink' and 'EditSectionLinkForOther' hooks;
+ see docs/hooks.txt for details
== Bugfixes since 1.10 ==
to be echoed at the top of the edit form as wikitext. Return true without altering
$error to allow the edit to proceed.
+'EditSectionLink': Override the return value of Linker::editSectionLink()
+$skin: Skin rendering the UI
+$title: Title being linked to
+$section: Section to link to
+$link: Default link
+$result: Result (alter this to override the generated links)
+
+'EditSectionLinkForOther': Override the return value of Linker::editSectionLinkForOther()
+$skin: Skin rendering the UI
+$title: Title being linked to
+$section: Section to link to
+$link: Default link
+$result: Result (alter this to override the generated links)
+
'EmailConfirmed': When checking that the user's email address is "confirmed"
$user: User being checked
$confirmed: Whether or not the email address is confirmed
/** @todo document */
public function editSectionLinkForOther( $title, $section ) {
global $wgContLang;
-
$title = Title::newFromText( $title );
$editurl = '§ion='.$section;
$url = $this->makeKnownLinkObj( $title, wfMsg('editsection'), 'action=edit'.$editurl );
-
- return "<span class=\"editsection\">[".$url."]</span>";
-
+ $result = null;
+ wfRunHooks( 'EditSectionLinkForOther', array( &$this, $title, $section, $url, &$result ) );
+ return is_null( $result )
+ ? "<span class=\"editsection\"[{$url}]</span>"
+ : "<span class=\"editsection\">[{$result}]</span>";
}
/**
*/
public function editSectionLink( $nt, $section, $hint='' ) {
global $wgContLang;
-
$editurl = '§ion='.$section;
$hint = ( $hint=='' ) ? '' : ' title="' . wfMsgHtml( 'editsectionhint', htmlspecialchars( $hint ) ) . '"';
$url = $this->makeKnownLinkObj( $nt, wfMsg('editsection'), 'action=edit'.$editurl, '', '', '', $hint );
-
- return "<span class=\"editsection\">[".$url."]</span>";
+ $result = null;
+ wfRunHooks( 'EditSectionLink', array( &$this, $nt, $section, $url, &$result ) );
+ return is_null( $result )
+ ? "<span class=\"editsection\">[{$url}]</span>"
+ : "<span class=\"editsection\">[{$result}]</span>";
}
/**