Ejemplo n.º 1
0
 function gantry_setup()
 {
     gantry_import('core.gantry');
     gantry_import('core.utilities.gantrycache');
     jimport('joomla.html.parameter');
     global $gantry;
     $template = gantry_getTemplate();
     $template_name = $template->template;
     if ($template->params->get('master') != 'true') {
         $template->params = gantry_getTemplateParams($template->params->get('master'));
     }
     $conf =& JFactory::getConfig();
     if ($template->params->get("cache-enabled", 0) == 1) {
         $cache = GantryCache::getInstance($app->isAdmin());
         $cache->setLifetime($template->params->get('cache-time', $conf->getValue('config.cachetime') * 60));
         $cache->addWatchFile(JPATH_SITE . '/templates/' . $template_name . '/templateDetails.xml');
         $cache->addWatchFile(JPATH_SITE . '/templates/' . $template_name . '/template-options.xml');
         $gantry = $cache->call('Gantry-' . $template_name, array('Gantry', 'getInstance'), array($template_name));
     } else {
         $gantry = Gantry::getInstance($template_name);
     }
     $gantry->init();
 }
Ejemplo n.º 2
0
    function gantry_admin_setup(){
        gantry_import('core.gantry');
        gantry_import('core.utilities.gantrycache');

        global $gantry;

        $app = JFactory::getApplication();
        $template_name = gantry_getTemplate();
        $cache = GantryCache::getInstance($app->isAdmin());

        $cache->addWatchFile(JPATH_SITE.'/templates/'.$template_name.'/params.ini');
        $cache->addWatchFile(JPATH_SITE.'/templates/'.$template_name.'/templateDetails.xml');
        $gantry = $cache->call('Gantry-'.$template_name, array('Gantry','getInstance'));

        $gantry->adminInit();
    }
Ejemplo n.º 3
0
 /**
  *
  */
 function gantry_setup()
 {
     gantry_import('core.gantry');
     gantry_import('core.utilities.gantrycache');
     jimport('joomla.html.parameter');
     /** @var $gantry Gantry */
     global $gantry;
     $template = gantry_getTemplate();
     $template_name = $template->template;
     if ($template->params->get('master') != 'true') {
         $template->params = gantry_getTemplateParams($template->params->get('master'));
     }
     $conf = JFactory::getConfig();
     $app = JFactory::getApplication();
     if ($template->params->get("cache.enabled", 1) == 1) {
         $cache = GantryCache::getCache(GantryCache::GROUP_NAME);
         $cache->addWatchFile(JPATH_SITE . '/templates/' . $template_name . '/templateDetails.xml');
         $cache->addWatchFile(JPATH_SITE . '/templates/' . $template_name . '/template-options.xml');
         $gantry = $cache->call('Gantry-' . $template_name, array('Gantry', 'getInstance'), array($template_name));
     } else {
         $gantry = Gantry::getInstance($template_name);
     }
     $gantry->init();
 }