Locations : www/include/Layout.class.php
www/include/LayoutSF.class.php
Description: Provides a place to add inline Javascript into the page.
- The output of the hook should be pure Javascript, as it will
+ The output (in $params['return']) of the hook should be pure Javascript, as it will
be placed within an existing <script> block.
[TODO: The output of the hook appears after the closing SGML comment marker
and before the closing </script> element. Is this what is really indended?]
}
elseif ($hookname == "javascript") {
// make sure jquery won't conflict with prototype
- echo 'jQuery.noConflict();';
+ $params['return'] = 'jQuery.noConflict();';
}
elseif ($hookname == "cssfile") {
use_stylesheet('/plugins/oslc/css/oslcTooltipStyle.css');
<script type="text/javascript" src="'. util_make_uri('/js/common.js') .'"></script>';
plugin_hook ("javascript_file",false);
echo $this->getJavascripts();
- echo '<script type="text/javascript">';
- plugin_hook ("javascript",false);
- echo '
+
+ // invoke the 'javascript' hook for custom javascript addition
+ $params = array('return' => false);
+ plugin_hook("javascript",$params);
+ $javascript = $params['return'];
+ if($javascript) {
+ echo '<script type="text/javascript">';
+ echo $javascript;
+ echo '
</script>';
+ }
}
function headerForgepluckerMeta() {
echo '<script type="text/javascript" src="/scripts/codendi/validate.js"></script>';
echo '<script type="text/javascript" src="/scripts/codendi/Tooltip.js"></script>';
- echo '<script type="text/javascript">';
- plugin_hook("javascript",false);
- echo '</script>'."\n";
-
plugin_hook("javascript_file",false);
echo $this->getJavascripts();
+
+ // invoke the 'javascript' hook for custom javascript addition
+ $params = array('return' => false);
+ plugin_hook("javascript",$params);
+ $javascript = $params['return'];
+ if($javascript) {
+ echo '<script type="text/javascript">';
+ echo $javascript;
+ echo '</script>'."\n";
+ }
?>
<script type="text/javascript">
jQuery.noConflict();