Ejemplo n.º 1
0
 function loadCalendar()
 {
     static $calendarLoaded;
     // Only load once
     if ($calendarLoaded) {
         return;
     }
     $calendarLoaded = true;
     $document =& JFactory::getDocument();
     // $$$ hugh - if 'raw' and we output the JS stuff, it screws things up by echo'ing stuff ahead
     // of the raw view display() method's JSON echo
     if ($document->getType() == 'raw') {
         return;
     }
     $config =& JFactory::getConfig();
     $debug = $config->getValue('config.debug');
     FabrikHelperHTML::stylesheet('calendar-jos.css', 'media/system/css/', array(' title' => JText::_('green'), ' media' => 'all'));
     // $$$ hugh - need to just use JHTML::script() for these, to avoid recursion issues if anything else
     // includes these files, and Fabrik is using merged JS, which means page ends up with two copies,
     // causing a "too much recursion" error (calendar.js overrides some date object functions)
     //FabrikHelperHTML::script('calendar.js', 'media/system/js/');
     //FabrikHelperHTML::script('calendar-setup.js', 'media/system/js/');
     // $$$ rob as per what Hugh said above these should be JHTML, otherwise calendard viz popup form cant select date
     // gives too much recursion error. Any main view should therefore always call this method if there is a chance that
     // it will be loading a popup form.
     JHTML::script('calendar.js', 'media/system/js/');
     JHTML::script('calendar-setup.js', 'media/system/js/');
     $translation = FabrikHelperHTML::_calendartranslation();
     if ($translation) {
         FabrikHelperHTML::addScriptDeclaration($translation);
     }
 }