/ */ class EasyCron_Module extends P4Cms_Module_Integration { /** * Load the easy cron scripts into the head section of the page. */ public static function load() { // add the script to send a cron run request. $view = Zend_Layout::getMvcInstance()->getView(); $view->headScript()->appendScript( " // we want this to happen last, so we wait until the page // is otherwise loaded, then add 100ms for good measure. dojo.connect(dojo.body(), 'onload', function() { window.setTimeout( function() { dojo.xhrGet({ url: p4cms.url({ module: 'cron', background: true, format: 'json' }) }); }, 100 ); }); " ); } }