* (bug 14921) Special:Contributions/: add user name to <title>
Patch by Emufarmers
* Unescape more "safe" characters when producing URLs, for added prettiness
+* Introduced a new hook 'SkinAfterContent' that allows extensions to add text
+ after the page content and article metadata. Updated all skins and skin
+ templates to work with that hook.
=== Bug fixes in 1.14 ===
&$text: bottomScripts Text
Append to $text to add additional text/scripts after the stock bottom scripts.
+'SkinAfterContent': Allows extensions to add text after the page content and
+article metadata.
+&$data: (string) Text to be printed out directly (without parsing)
+This hook should work in all skins. Just set the &$data variable to the text
+you're going to add.
+
'SkinBuildSidebar': At the end of Skin::buildSidebar()
$skin: Skin object
&$bar: Sidebar contents
$out->out( $out->mBodytext . "\n" );
+ // See self::afterContentHook() for documentation
+ $out->out ($this->afterContentHook());
+
$out->out( $this->afterContent() );
$out->out( $this->bottomScripts() );
return "<td width='152' rowspan='{$rows}'> </td>";
}
+ /**
+ * This runs a hook to allow extensions placing their stuff after content
+ * and article metadata (e.g. categories).
+ * Note: This function has nothing to do with afterContent().
+ *
+ * This hook is placed here in order to allow using the same hook for all
+ * skins, both the SkinTemplate based ones and the older ones, which directly
+ * use this class to get their data.
+ *
+ * The output of this function gets processed in SkinTemplate::outputPage() for
+ * the SkinTemplate based skins, all other skins should directly echo it.
+ *
+ * Returns an empty string by default, if not changed by any hook function.
+ */
+ protected function afterContentHook () {
+ $data = "";
+
+ if (wfRunHooks ('SkinAfterContent', array (&$data))) {
+ // adding just some spaces shouldn't toggle the output
+ // of the whole <div/>, so we use trim() here
+ if (trim ($data) != "") {
+ // Doing this here instead of in the skins to
+ // ensure that the div has the same ID in all
+ // skins
+ $data = "<!-- begin SkinAfterContent hook -->\n" .
+ "<div id='mw-data-after-content'>\n" .
+ "\t$data\n" .
+ "</div>\n" .
+ "<!-- end SkinAfterContent hook -->\n";
+ }
+ } else {
+ wfDebug ('Hook SkinAfterContent changed output processing.');
+ }
+
+ return $data;
+ }
+
/**
* This gets called shortly before the \</body\> tag.
* @return String HTML to be put before \</body\>
wfDebug( __METHOD__ . ': Hook SkinTemplateOutputPageBeforeExec broke outputPage execution!' );
}
+ // allow extensions adding stuff after the page content.
+ // See Skin::afterContentHook() for further documentation.
+ $tpl->set ('dataAfterContent', $this->afterContentHook());
+
// execute template
wfProfileIn( __METHOD__."-execute" );
$res = $tpl->execute();
<?php $this->html('bodytext') ?>
<div class='mw_clear'></div>
<?php if($this->data['catlinks']) { $this->html('catlinks'); } ?>
+ <?php $this->html ('dataAfterContent') ?>
</div><!-- mw_contentholder -->
</div><!-- mw_content -->
</div><!-- mw_contentwrapper -->