Exemple #1
0
 /**
  * Constructor
  * @return void
  */
 function Gantry()
 {
     global $mainframe;
     // load the base gantry path
     $this->gantryPath = realpath(dirname(__FILE__) . DS . "..");
     // set the base class vars
     $doc =& JFactory::getDocument();
     $this->document =& $doc;
     gantry_import('core.gantrybrowser');
     $this->browser = new GantryBrowser();
     gantry_import('core.gantryplatform');
     $this->platform = new GantryPlatform();
     $this->basePath = JPATH_ROOT;
     $this->templateName = $this->_getCurrentTemplate();
     $this->templatePath = JPATH_ROOT . DS . 'templates' . DS . $this->templateName;
     $this->layoutPath = $this->templatePath . DS . 'html' . DS . 'layouts.php';
     $this->custom_dir = $this->templatePath . DS . 'custom';
     $this->custom_menuitemparams_dir = $this->custom_dir . DS . 'menuitemparams';
     $this->custom_presets_file = $this->custom_dir . DS . 'presets.ini';
     $this->baseUrl = JURI::root(true) . "/";
     $this->templateUrl = $this->baseUrl . 'templates' . "/" . $this->templateName;
     if (version_compare(JVERSION, '1.5', '>=') && version_compare(JVERSION, '1.6', '<')) {
         $this->gantryUrl = $this->baseUrl . 'components/com_gantry';
     } else {
         if (version_compare(JVERSION, '1.6', '>=')) {
             $this->gantryUrl = $this->baseUrl . 'libraries/gantry';
         }
     }
     $this->defaultMenuItem = $this->_getDefaultMenuItem();
     $this->currentMenuItem = $this->defaultMenuItem;
     $this->_loadConfig();
     // Load up the template details
     $this->_templateDetails = GantrySingleton::getInstance('GantryTemplateDetails');
     $this->_templateDetails->init($this);
     $this->_base_params_checksum = $this->_templateDetails->getParamsHash();
     // Put a base copy of the saved params in the working params
     $this->_working_params = $this->_templateDetails->params;
     $this->_param_names = array_keys($this->_templateDetails->params);
     $this->template_prefix = $this->_working_params['template_prefix']['value'];
     // set the GRID_SYSTEM define;
     if (!defined('GRID_SYSTEM')) {
         define('GRID_SYSTEM', $this->get('grid_system', $this->default_grid));
     }
     // process the presets
     if (!empty($this->presets)) {
         // check for custom presets
         $this->_customPresets();
         $this->_preset_names = array_keys($this->presets);
         //$wp_keys = array_keys($this->_templateDetails->params);
         //$this->_param_names = array_diff($wp_keys, $this->_preset_names);
     }
     $this->_loadLayouts();
     $this->_loadFeatures();
     $this->_loadAjaxModels();
     $this->_loadAdminAjaxModels();
     $this->_checkAjaxTool();
     $this->_checkLanguageFiles();
     $this->positions = GantrySingleton::getInstance('GantryPositions');
     // add GRID_SYSTEM class to body
     $this->addBodyClass("col" . GRID_SYSTEM);
 }
     */
    function gantry_import($path)
    {
        require_once realpath(dirname(__FILE__)) . '/core/gantryloader.class.php';
        return GantryLoader::import($path);
    }
    gantry_import('core.gantrysingleton');
    gantry_import('core.gantry');
    $site = JFactory::getApplication();
    $template = $site->getTemplate();
    $template_params = null;
    if (!$mainframe->isAdmin()) {
        if (is_readable(JPATH_SITE . DS . "templates" . DS . $template . DS . 'params.ini')) {
            $content = file_get_contents(JPATH_SITE . DS . "templates" . DS . $template . DS . 'params.ini');
            $template_params = new JParameter($content);
        }
        $conf =& JFactory::getConfig();
    }
    if (!$mainframe->isAdmin() && !empty($template_params) && $template_params->get("cache-enabled", 0) == 1) {
        $user =& JFactory::getUser();
        $cache =& JFactory::getCache('Gantry');
        $cache->setCaching(true);
        $cache->setLifeTime($template_params->get("cache-time", $conf->getValue('config.cachetime') * 60));
        $gantry = $cache->get(array('GantrySingleton', 'getInstance'), array('Gantry'), 'Gantry-' . $template . "-" . $user->get('aid', 0));
    } else {
        $gantry = GantrySingleton::getInstance('Gantry');
    }
    if (!$gantry->isAdmin()) {
        $gantry->init();
    }
}
 public static function getInstance()
 {
     return parent::getInstance('GantryTemplateInfo');
 }
Exemple #4
0
 /**
  * Constructor
  * @return void
  */
 function Gantry()
 {
     global $mainframe;
     if (array_key_exists('gantry_profile', $_GET)) {
         $profile = JProfiler::getInstance('Gantry()');
         $profile->mark('Start');
     }
     // load the base gantry path
     $this->gantryPath = realpath(dirname(__FILE__) . DS . "..");
     // set the base class vars
     $doc =& JFactory::getDocument();
     $this->document =& $doc;
     $this->basePath = JPATH_ROOT;
     $this->templatePath = JPATH_ROOT . DS . 'templates' . DS . $this->_getCurrentTemplate();
     $this->layoutPath = $this->templatePath . DS . 'html' . DS . 'layouts.php';
     $this->custom_dir = $this->templatePath . DS . 'custom';
     $this->custom_menuitemparams_dir = $this->custom_dir . DS . 'menuitemparams';
     $this->custom_presets_file = $this->custom_dir . DS . 'presets.ini';
     $this->defaultMenuItem = $this->_getDefaultMenuItem();
     $this->currentMenuItem = $this->defaultMenuItem;
     $this->_loadConfig();
     // Load up the template details
     $this->_templateDetails = GantrySingleton::getInstance('GantryTemplateDetails');
     $this->_templateDetails->init($this);
     // Put a base copy of the saved params in the working params
     $this->_working_params = $this->_templateDetails->params;
     $this->_param_names = array_keys($this->_templateDetails->params);
     $this->template_prefix = $this->_working_params['template_prefix']['value'];
     // set the GRID_SYSTEM define;
     if (!defined('GRID_SYSTEM')) {
         define('GRID_SYSTEM', $this->get('grid_system', $this->default_grid));
     }
     // process the presets
     if (!empty($this->presets)) {
         // check for custom presets
         $this->_customPresets();
         $this->_preset_names = array_keys($this->presets);
         //$wp_keys = array_keys($this->_templateDetails->params);
         //$this->_param_names = array_diff($wp_keys, $this->_preset_names);
     }
     $this->_loadLayouts();
     $this->_loadFeatures();
     $this->_checkAjaxTool();
     $this->_checkLanguageFiles();
     if (array_key_exists('gantry_profile', $_GET)) {
         $profile->mark('Stop');
         var_dump($profile->getBuffer());
     }
     $this->positions = GantrySingleton::getInstance('GantryPositions');
     // add GRID_SYSTEM class to body
     $this->addBodyClass("col" . GRID_SYSTEM);
 }
 public static function getInstance()
 {
     return parent::getInstance('GantryCache');
 }
Exemple #6
0
 /**
  * Constructor
  * @return void
  */
 function Gantry()
 {
     //global $mainframe;
     global $gantry_path;
     // load the base gantry path
     $this->gantryPath = $gantry_path;
     $this->gantryUrl = WP_PLUGIN_URL . '/' . basename($this->gantryPath);
     // set the base class vars
     //$doc =& JFactory::getDocument();
     //$this->document =& $doc;
     $this->basePath = ABSPATH;
     $this->templateName = $this->_getCurrentTemplate();
     $this->templatePath = get_template_directory();
     $this->custom_dir = $this->templatePath . DS . 'custom';
     $this->custom_menuitemparams_dir = $this->custom_dir . DS . 'menuitemparams';
     $this->custom_presets_file = $this->custom_dir . DS . 'presets.ini';
     $urlinfo = parse_url(get_option('siteurl'));
     $this->baseUrl = $urlinfo["path"] . "/";
     $urlinfo = parse_url(get_bloginfo('template_url'));
     $this->templateUrl = $urlinfo["path"];
     $this->_loadConfig();
     // Load up the template details
     $this->_templateDetails = GantrySingleton::getInstance('GantryTemplateDetails');
     $this->_templateDetails->init($this);
     $this->templateInfo =& GantryTemplateInfo::getInstance();
     $this->_base_params_checksum = $this->_templateDetails->getParamsHash();
     gantry_import('core.gantryplatform');
     $this->platform = new GantryPlatform();
     // set base ignored query string params    dont pass these back
     $this->_ignoreQueryParams[] = 'reset-settings';
     //TODO  Add Filter
     // Put a base copy of the saved params in the working params
     $this->_working_params = $this->_templateDetails->params;
     $this->_param_names = array_keys($this->_templateDetails->params);
     $this->template_prefix = $this->_working_params['template_prefix']['value'];
     // set the GRID_SYSTEM define;
     if (!defined('GRID_SYSTEM')) {
         define('GRID_SYSTEM', $this->get('grid_system', $this->default_grid));
     }
     // process the presets
     if (!empty($this->presets)) {
         // check for custom presets
         $this->_customPresets();
         $this->_preset_names = array_keys($this->presets);
         //$wp_keys = array_keys($this->_templateDetails->params);
         //$this->_param_names = array_diff($wp_keys, $this->_preset_names);
     }
     $this->_loadLayouts();
     $this->_loadGizmos();
     $this->_loadAjaxModels();
     $this->_loadAdminAjaxModels();
     // set up the positions object for all gird systems defined
     foreach (array_keys($this->mainbodySchemasCombos) as $grid) {
         $this->positions[$grid] = GantryPositions::getInstance($grid);
     }
     $this->_override_engine = $this->_loadOverrideEngine();
     //		// add GRID_SYSTEM class to body
     $this->addBodyClass("col" . GRID_SYSTEM);
 }