Esempio n. 1
0
 /**
  * @global gantry used to access the core Gantry class
  * @param  $name
  * @param  $value
  * @param  $node
  * @param  $control_name
  * @return void
  */
 function fetchElement($name, $value, &$node, $control_name)
 {
     global $gantry;
     $output = "";
     $document =& JFactory::getDocument();
     $arrayList = "'" . implode("', '", explode(",", str_replace(" ", "", $node->attributes('default')))) . "'";
     if (!defined('GANTRY_ADMIN')) {
         include_once dirname(dirname(__FILE__)) . '/../gantry.php';
         gantry_import('core.gantrybrowser');
         $browser = new GantryBrowser();
         $gantry_created_dirs = array($gantry->custom_dir, $gantry->custom_menuitemparams_dir);
         $this->template = end(explode(DS, $gantry->templatePath));
         gantry_addStyle($gantry->gantryUrl . '/admin/widgets/gantry.css');
         if ($browser->name == 'ie' && $browser->version == '7' && file_exists($gantry->gantryPath . DS . 'admin' . DS . 'widgets' . DS . 'gantry-ie7.css')) {
             gantry_addStyle($gantry->gantryUrl . '/admin/widgets/gantry-ie7.css');
         }
         gantry_addScript($gantry->gantryUrl . '/admin/widgets/gantry.js');
         gantry_addInlineScript("var GantrySlideList = [" . $arrayList . "];var AdminURI = '" . JURI::base() . "';var UnallowedParams = ['" . implode("', '", $gantry->dontsetinmenuitem) . '\'];');
         gantry_addInlineScript($this->gantryLang());
         // fixes Firefox < 3.7 input line-height issue
         if ($browser->name == 'firefox' && $browser->version < '3.7' || $browser->name == 'ie' && $browser->version > '6') {
             $css = ".text-short, .text-medium, .text-long, .text-color {padding-top: 4px;height:19px;}";
             gantry_addInlineStyle($css);
         }
         if ($browser->name == 'ie' && $browser->shortversion == '7') {
             $css = "\n\t\t\t\t\t.g-surround, .g-inner, .g-surround > div {zoom: 1;position: relative;}\n\t\t\t\t\t.text-short, .text-medium, .text-long, .text-color {border:0 !important;}\n\t\t\t\t\t.selectbox {z-index:500;position:relative;}\n\t\t\t\t\t.group-fusionmenu, .group-splitmenu {position:relative;margin-top:0 !important;zoom:1;}\n\t\t\t\t\t.scroller .inner {position:relative;}\n\t\t\t\t\t.moor-hexLabel {display:inline-block;zoom:1;float:left;}\n\t\t\t\t\t.moor-hexLabel input {float:left;}\n\t\t\t\t";
             gantry_addInlineStyle($css);
         }
         //create dirs needed by gantry
         foreach ($gantry_created_dirs as $dir) {
             if (is_readable(dirname($dir)) && is_writeable(dirname($dir)) && !JFolder::exists($dir)) {
                 JFolder::create($dir);
             }
         }
         if (version_compare(JVERSION, '1.5.14', '<=')) {
             $tmpscripts = array();
             foreach ($document->_scripts as $script => $type) {
                 if ($script != $gantry->baseUrl . 'media/system/js/mootools.js') {
                     $tmpscripts[$script] = $type;
                 } else {
                     $tmpscripts[$gantry->gantryUrl . '/js/mootools-1.1.2.js'] = $type;
                 }
             }
             $document->_scripts = $tmpscripts;
         }
         $this->checkAjaxTool();
         define('GANTRY_ADMIN', 1);
     }
     if (file_exists($gantry->templatePath . "/gantry.scripts.php") && is_readable($gantry->templatePath . "/gantry.scripts.php")) {
         include_once $gantry->templatePath . "/gantry.scripts.php";
         if (function_exists('gantry_params_init')) {
             gantry_params_init();
         }
     }
     $this->_parent->addElementPath($gantry->templatePath . DS . 'elements');
     $this->_parent->addElementPath($gantry->templatePath . DS . 'admin/elements');
 }
Esempio n. 2
0
}
global $gantry;
if (!current_user_can('edit_theme_options')) {
    wp_die(_g($gantry->get('template_full_name', 'Gantry Template') . _g('Settings')));
}
gantry_import('core.gantrysingleton');
gantry_import('core.config.gantryform');
gantry_import('core.utilities.gantrytemplateinfo');
$gantry->addScript('mootools.js');
$gantry->addScript($gantry->gantryUrl . '/admin/widgets/gantry.js');
// Setup the JS for the admin
$gantry->addInlineScript(gantryLang());
if (file_exists($gantry->templatePath . "/gantry.scripts.php") && is_readable($gantry->templatePath . "/gantry.scripts.php")) {
    include_once $gantry->templatePath . "/gantry.scripts.php";
    if (function_exists('gantry_params_init')) {
        gantry_params_init();
    }
}
$override_catalog = gantry_get_override_catalog($gantry->templateName);
$data = array();
$data['template-options'] = get_option($gantry->templateName . '-template-options');
GantryForm::addFormPath($gantry->templatePath);
GantryForm::addFieldPath($gantry->templatePath . '/fields');
GantryForm::addFieldPath($gantry->templatePath . '/admin/forms/fields');
$form = GantryForm::getInstance(GantryTemplateInfo::getInstance(), 'template-options', 'templateDetails', array(), true, '//config');
$form->bind($data);
$fieldSets = $form->getFieldsets('template-options');
$form->initialize();
?>
<div id="hack-panel">
	<?php