function _getTemplateInfo()
 {
     $this->template_info = GantryTemplateInfo::getInstance();
     $tdata = $this->xml->xpath('//name');
     $this->template_info->setName($tdata[0]->data());
     $tdata = $this->xml->xpath('//version');
     $this->template_info->setVersion($tdata[0]->data());
     $tdata = $this->xml->xpath('//creationDate');
     $this->template_info->setCreationDate($tdata[0]->data());
     $tdata = $this->xml->xpath('//author');
     $this->template_info->setAuthor($tdata[0]->data());
     $tdata = $this->xml->xpath('//authorUrl');
     $this->template_info->setAuthorUrl($tdata[0]->data());
     $tdata = $this->xml->xpath('//authorEmail');
     $this->template_info->setAuthorEmail($tdata[0]->data());
     $tdata = $this->xml->xpath('//copyright');
     $this->template_info->setCopyright($tdata[0]->data());
     $tdata = $this->xml->xpath('//license');
     $this->template_info->setLicense($tdata[0]->data());
     $tdata = $this->xml->xpath('//description');
     $this->template_info->setDescription($tdata[0]->data());
 }
예제 #2
0
파일: index.php 프로젝트: rotoballer/emily
$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 
$fields = $form->getFullFieldset('toolbar-panel');
foreach ($fields as $name => $field) {
    $gantry->addDomReadyScript("Gantry.ToolBar.add('" . $field->type . "');");
    echo "<div id=\"contextual-" . $field->type . "-wrap\" class=\"hidden contextual-custom-wrap\">\n";
    echo "\t\t<div class=\"metabox-prefs\">\n";
    echo $field->input;
    echo "\t\t</div>\n";
    echo "</div>\n";
}
예제 #3
0
<?php

/**
 * @version		1.26 September 14, 2012
 * @author		RocketTheme http://www.rockettheme.com
 * @copyright 	Copyright (C) 2007 - 2012 RocketTheme, LLC
 * @license		http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
 */
defined('GANTRY_VERSION') or die;
gantry_import('core.gantryjson');
gantry_import('core.utilities.gantrytemplateinfo');
global $gantry;
$action = $_POST['gantry_action'];
if (!current_user_can('edit_theme_options')) {
    die('-1');
}
if ($action == 'get_base_values') {
    $passed_array = array();
    foreach ($gantry->_working_params as $param) {
        $param_name = GantryTemplateInfo::get_field_id($param['name'], 'template-options');
        $passed_array[$param_name] = $param['value'];
    }
    $outdata = GantryJSON::encode($passed_array);
    //$outdata = str_replace('\\\\\\' , '\\', $outdata);
    echo $outdata;
} else {
    return "error";
}
예제 #4
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);
 }