1
Ajax is becoming more and more in demand. So I want to do some addons to header.php
It seems that certain functions should be integrated into the XOOPS core. For now, lets just make it easier for those of us too impatient to wait for this to occur.
With this simple hack I want to call these scripts with a smarty tag.
Here's what I did
in header.phpFind:
le="color: #000000"><?php $xoopsTpl->assign('xoops_js', '<script type="text/javascript" src="'.XOOPS_URL.'/include/xoops.js"></script>');
Add After
le="color: #000000"><?php $xoopsTpl->assign('xoops_prototype', '<script type="text/javascript" src="'.XOOPS_URL.'/include/prototype.js"></script>'); $xoopsTpl->assign('xoops_scriptaculous', '<script type="text/javascript" src="'.XOOPS_URL.'/include/scriptaculous.js?load=effects"></script>');
By default scriptaculous.js loads the other .js files "dragdrop, effects, etc" as long as they are in the same directory.
Be sure to upload all of the .js files to your XOOPS_root/includes directory.
Now, instead of using this in my theme.html
le="color: #000000"><?php <script type="text/javascript" src="<{$xoops_imageurl}>scripts/scriptaculous.js"></script>
I use
le="color: #000000"><?php <{$xoops_scriptaculous}> <{$xoops_prototype}>
If I view the page source the scripts are being called properly... but the functionality is not there.
Any ideas?