Wikia code/includes/ProtectionForm.php
Appearance
< Wikia code | includes
This page is obsolete. It is being retained for archival purposes. It may document extensions or features that are obsolete and/or no longer supported. Do not rely on the information here being up-to-date. The information shown below refers to the now unmaintained 1.16 MediaWiki release. The current stable release number is 1.43.0. |
--- D:\Programming\SVN\mediawiki\branches\REL1_16\phase3\includes\ProtectionForm.php 2011-07-18 22:31:27.980468800 +0100
+++ D:\Programming\SVN\wikia\trunk\includes\ProtectionForm.php 2011-08-17 15:28:46.342773400 +0100
@@ -487,8 +487,13 @@
}
if ( !$this->disabled ) {
- $out .= Xml::closeElement( 'form' ) .
- $this->buildCleanupScript();
+ $out .= Xml::closeElement( 'form' );
+
+ /* Wikia change begin - @author: Macbre */
+ /* Add a script to $wgOut instead of emiting it directly to HTML (BugId:7178) */
+ global $wgHooks;
+ $wgHooks['SkinAfterBottomScripts'][] = array($this, 'onSkinAfterBottomScripts');
+ /* Wikia change end */
}
return $out;
@@ -546,10 +551,13 @@
}
function buildScript() {
- global $wgStylePath, $wgStyleVersion;
- return Xml::tags( 'script', array(
- 'type' => 'text/javascript',
- 'src' => $wgStylePath . "/common/protect.js?$wgStyleVersion.1" ), '' );
+ /* Wikia change begin - @author: Macbre */
+ /* Add a script to $wgOut instead of emiting it directly to HTML (BugId:7178) */
+ global $wgOut;
+ $wgOut->addScriptFile('protect.js');
+
+ return '';
+ /* Wikia change end */
}
function buildCleanupScript() {
@@ -574,6 +582,14 @@
return Xml::tags( 'script', array( 'type' => 'text/javascript' ), $script );
}
+ /* Wikia change begin - @author: Macbre */
+ /* Add a script to $wgOut instead of emiting it directly to HTML (BugId:7178) */
+ function onSkinAfterBottomScripts($skin, &$bottomScriptText) {
+ $bottomScriptText .= $this->buildCleanupScript();
+ return true;
+ }
+ /* Wikia change end */
+
/**
* @param OutputPage $out
* @access private