I'm trying to solve some problem with a "session expired" system message, and i came upon the subject behavior.keepalive .
Joomla uses this by ..
Code:
echo JHTML::_('behavior.keepalive');
.. I think this inserts the following code lines into the <head> by MooTools:
(some info:
http://www.joomlatonight.com/joomla-tut ... -in-joomla )
Code:
function keepAlive() { new Ajax("index.php", {method: "get"}).request(); }
window.addEvent("domready", function() { keepAlive.periodical(2640000); });
Strange is this code piece, found in /components/com_jfuploader/jfuploader.html.php ..
Code:
$jConfig = new JConfig();
// we can only have a keepalive if Joomla and JFU use the same session!
if ($jConfig->session_handler != 'database') {
echo JHTML::_('behavior.keepalive');
}
// now I overwrite the existing function.
echo '
<script type="text/javascript">
function debugError(errorString) { }
function getIDN() {
return "'.$jfu_config['idn_url'].'/";
}
function uploadRunning(val) {
acivateKeep = (val == "true");
if (oldKeepAlive != null) {
oldKeepAlive();
}
}
var oldKeepAlive = window.keepAlive;
var acivateKeep = false;
window.keepAlive = function() {
if (acivateKeep && (oldKeepAlive != null)) {
oldKeepAlive();
}
}
</script>';
.. to me this overwrite method is a tricky way to hack / adjust some Joomla functionality.
Why isn't the MooTools way used?
And what happens if i just comment-out this code piece? (which i did in my override /templates/mytemplate/html/com_jfuploader/jfuploader.html.php)