Example #1
0
	function fetchElement($name, $value, &$node, $control_name)
	{
		global $gantry;
		
		gantry_import('core.gantrydiagnostic');
		$diagnose = new GantryDiagnostic();
		$errors = $diagnose->checks();
		
		$output = "";
		
		if (count($errors) > 0) {
			$klass = "errors";
			$output = implode("", $errors);
		} else {
			$klass = "success";
			$output = "Diagnostic checks successfully passed.";
		}
        $output .= '<br/><a href="'.JURI::base(true).'?option=com_admin&tmpl=gantry-ajax-admin&model=diagnostics&template='.$gantry->templateName.'">Download Diagnostic Info</a>';
		
		return "
		<div id='diagnostic' class='".$klass."'>
			<div id='diagnostic-bar' class='g-title'>".JText::_('DIAGNOSTICS')." - ". ucfirst($klass) ." <span class='arrow'></span></div>
			<div id='diagnostic-desc' class='g-inner'>
			".$output."
			</div>
		</div>";
		
	}
Example #2
0
 function display($tpl = null)
 {
     /** @var $gantry Gantry */
     global $gantry;
     $language = JFactory::getLanguage();
     $language->load('com_templates');
     $this->item = $this->get('Item');
     JHtml::_('behavior.framework', true);
     require_once JPATH_LIBRARIES . "/gantry/gantry.php";
     gantry_import('core.config.gantryform');
     GantryForm::addFormPath(JPATH_COMPONENT_ADMINISTRATOR);
     GantryForm::addFormPath($gantry->templatePath);
     GantryForm::addFieldPath($gantry->gantryPath . '/admin/forms/fields');
     GantryForm::addFieldPath($gantry->templatePath . '/fields');
     GantryForm::addFieldPath($gantry->templatePath . '/admin/forms/fields');
     GantryForm::addGroupPath($gantry->gantryPath . '/admin/forms/groups');
     GantryForm::addGroupPath($gantry->templatePath . '/admin/forms/groups');
     $this->state = $this->get('State');
     $this->form = $this->get('Form');
     $this->override = $this->get('Override');
     $this->gantryForm = $this->get('GantryForm');
     $this->activeTab = isset($_COOKIE['gantry-admin-tab']) ? $_COOKIE['gantry-admin-tab'] + 1 : 1;
     $this->tabs = $this->getTabs($this->gantryForm);
     $this->assignmentCount = $this->getAssignmentCount($this->item->id);
     $model = $this->getModel();
     $model->checkForGantryUpdate();
     //$this->addToolbar();
     JToolBarHelper::title('');
     ob_start();
     parent::display($tpl);
     $buffer = ob_get_clean();
     echo $buffer;
 }
 function init(&$gantry)
 {
     gantry_import("core.utilities.gantryxml");
     $this->xml = new GantryXML();
     $this->xml->loadFile($gantry->templatePath . '/templateDetails.xml');
     $this->positions =& $this->_getPositions();
     $this->params = $this->_getParams($gantry);
 }
Example #4
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');
 }
Example #5
0
 function _dateFormat($instance)
 {
     gantry_import('core.utilities.gantrydate');
     global $gantry;
     $now = new GantryDate();
     $formats = str_replace("%", "\$", $instance['format']);
     $gantry->addInlineScript("dateFormat.i18n = {" . $this->_dateLanguage() . "};var dateFeature = new Date().format('{$formats}');\n");
     $js = "\n\t\t\t\tvar dates = \$\$('.date-block .date');\n\t\t\t\tif (dates.length) {\n\t\t\t\t\tdates.each(function(date) {\n\t\t\t\t\t\tdate.set('text', dateFeature);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\n";
     return $js;
 }
Example #6
0
 public function getInput()
 {
     /** @var $gantry Gantry */
     global $gantry;
     $name = (string) $this->element['name'];
     $class = $this->element['class'] ? 'class="' . $this->element['class'] . '"' : 'class="inputbox"';
     $mode = $this->element['mode'];
     if (!isset($mode)) {
         $mode = 'dropdown';
     }
     $options = array();
     if (!array_key_exists($name, $gantry->presets)) {
         return 'Unable to find the preset information';
     }
     foreach ($gantry->presets[$name] as $preset_name => $preset_value) {
         $val = $preset_name;
         $text = $preset_value['name'];
         if (!array_key_exists('disabled', $preset_value)) {
             $preset_value['disabled'] = 'false';
         }
         $options[] = GantryHtmlSelect::option((string) $val, JText::_(trim((string) $text)), 'value', 'text', (string) $preset_value['disabled'] == 'true');
     }
     if (!defined('GANTRY_PRESET')) {
         gantry_import('core.gantryjson');
         $template_path_parts = explode('/', $gantry->templatePath);
         $this->template = end($template_path_parts);
         $gantry->addScript($gantry->gantryUrl . '/admin/widgets/preset/js/preset.js');
         $gantry->addScript($gantry->gantryUrl . '/admin/widgets/preset/js/preset-saver.js');
         $gantry->addInlineScript('var Presets = {};var PresetsKeys = {};');
         if (isset($gantry->customPresets[$name])) {
             $gantry->addInlineScript('var CustomPresets = ' . GantryJSON::encode($gantry->customPresets[$name]) . ';');
         } else {
             $gantry->addInlineScript('var CustomPresets = {};');
         }
         define('GANTRY_PRESET', 1);
     }
     $this->presets = $gantry->originalPresets[$name];
     $gantry->addInlineScript($this->populatePresets((string) $this->element['name']));
     if ($mode == 'dropdown') {
         include_once 'selectbox.php';
         $gantry->addDomReadyScript("PresetDropdown.init('" . $name . "');");
         $selectbox = new JElementSelectBox();
         $node->addAttribute('preset', true);
         return $selectbox->fetchElement($name, $value, $node, $control_name, $options);
     } else {
         $gantry->addDomReadyScript("Scroller.init('" . $name . "');");
         return $this->scrollerLayout($this->element);
     }
 }
Example #7
0
	function fetchElement($name, $value, &$node, $control_name)
	{

		global $gantry;
		
		$class = ( $node->attributes('class') ? 'class="'.$node->attributes('class').'"' : 'class="inputbox"' );
		$mode = $node->attributes('mode');
		if (!isset($mode)) $mode = 'dropdown';
		
		$options = array();
		if (!array_key_exists($name,$gantry->presets)) {
				return JText::_('Unable to find the preset information'); 
		}
		foreach ($gantry->presets[$name] as $preset_name => $preset_value)
		{
			$val	= $preset_name;
			$text	= $preset_value['name'];
			$options[] = JHTML::_('select.option', $val, JText::_($text));
		}
		
		if (!defined('GANTRY_PRESET')) {
			gantry_import('core.gantryjson');
			
			$this->template = end(explode(DS, $gantry->templatePath));
			gantry_addScript($gantry->gantryUrl.'/admin/widgets/preset/js/preset.js');
			gantry_addScript($gantry->gantryUrl.'/admin/widgets/preset/js/preset-saver.js');
			gantry_addInlineScript('var Presets = {};var PresetsKeys = {};');
			
			if (isset($gantry->customPresets[$name])) {
				gantry_addInlineScript('var CustomPresets = '.GantryJSON::encode($gantry->customPresets[$name]).';');
			}
			
			define('GANTRY_PRESET', 1);
		}

		$this->presets = $gantry->originalPresets[$name];
		gantry_addInlineScript($this->populatePresets($name));
		
		if ($mode == 'dropdown') {
			include_once('selectbox.php');
			gantry_addInlineScript("window.addEvent('domready', PresetDropdown.init.bind(PresetDropdown, '$name'));");
			$selectbox = new JElementSelectBox;
			$node->addAttribute('preset', true);
			return $selectbox->fetchElement($name, $value, $node, $control_name, $options);
		} else {
			gantry_addInlineScript("window.addEvent('domready', Scroller.init.bind(Scroller, '$name'));");
			return $this->scrollerLayout($name, $value, $node, $control_name);
		}
	}
Example #8
0
 function render($position = "")
 {
     global $gantry;
     if ($gantry->browser->platform != 'iphone' && $gantry->browser->platform != 'ipad' && $gantry->browser->platform != 'android') {
         return false;
     }
     gantry_import('facets.menu.gantrymenu');
     $params = $gantry->getParams($this->_feature_name, true);
     $module_params = '';
     foreach ($params as $param_name => $param_value) {
         $module_params .= $param_name . "=" . $param_value['value'] . "\n";
     }
     $passing_params = new JParameter($module_params);
     $gantrymenu = GantryMenu::getInstance($passing_params);
     return $gantrymenu->render($passing_params);
 }
Example #9
0
 function fetchElement($name, $value, &$node, $control_name)
 {
     global $gantry;
     gantry_import('core.gantrydiagnostic');
     $diagnose = new GantryDiagnostic();
     $errors = $diagnose->checks();
     $output = "";
     if (count($errors) > 0) {
         $klass = "errors";
         $output = implode("", $errors);
     } else {
         $klass = "success";
         $output = "Diagnostic checks successfully passed.";
     }
     return "\n\t\t<div id='diagnostic' class='" . $klass . "'>\n\t\t\t<div id='diagnostic-bar' class='g-title'>" . JText::_('DIAGNOSTICS') . " - " . ucfirst($klass) . " <span class='arrow'></span></div>\n\t\t\t<div id='diagnostic-desc' class='g-inner'>\n\t\t\t" . $output . "\n\t\t\t</div>\n\t\t</div>";
 }
Example #10
0
 function gantry_addStyle($file)
 {
     gantry_import('core.gantrybrowser');
     $browser = new GantryBrowser();
     $document =& JFactory::getDocument();
     $filename = basename($file);
     $relative_path = dirname($file);
     // For local url path get the local path based on checks
     $file_path = gantry_getFilePath($file);
     $url_file_checks = $browser->getChecks($file_path, true);
     foreach ($url_file_checks as $url_file) {
         $full_path = realpath($url_file);
         if ($full_path !== false && file_exists($full_path)) {
             $document->addStyleSheet($relative_path . '/' . basename($full_path));
         }
     }
 }
Example #11
0
 public function getInput()
 {
     global $gantry;
     gantry_import('core.gantrydiagnostic');
     $diagnose = new GantryDiagnostic();
     $errors = $diagnose->runChecks();
     $output = "";
     if (count($errors) > 0) {
         $klass = "errors";
         $title = "Something Wrong :(";
         $output = implode("", $errors);
     } else {
         $klass = "success";
         $title = "Good!";
         $output = "Congratulations! All the diagnostic test have passed successfully.  There are no show-stopper issues.  You can however still download the ";
     }
     //$output .= '<a href="'.$gantry->baseUrl.'?option=com_admin&amp;tmpl=gantry-ajax-admin&amp;model=diagnostics&amp;template='.$gantry->templateName.'">Diagnostic Status Information archive</a>.';
     return "\n\t\t<div id='diagnostic' class='" . $klass . "'>\n\t\t\t<div id='diagnostic-bar' class='h2bar'>Diagnostics: <span>" . $title . "</span></div>\n\t\t\t<div id='diagnostic-desc' class='g-inner'>\n\t\t\t" . $output . "\n\t\t\t</div>\n\t\t</div>";
 }
Example #12
0
 function render($position)
 {
     /** @var $gantry Gantry */
     global $gantry;
     JHTML::_('behavior.framework', true);
     if ($gantry->browser->platform != 'iphone' && $gantry->browser->platform != 'ipad' && $gantry->browser->platform != 'android') {
         return false;
     }
     gantry_import('facets.menu.gantrymenu');
     $params = $gantry->getParams($this->_feature_name, true);
     $module_params = '';
     foreach ($params as $param_name => $param_value) {
         $module_params .= $param_name . "=" . $param_value['value'] . "\n";
     }
     $passing_params = new GantryRegistry();
     $passing_params->loadString($module_params, 'INI');
     $gantrymenu = new GantryMenu($passing_params);
     return $gantrymenu->render($passing_params);
 }
 function init(&$gantry)
 {
     gantry_import("core.utilities.gantrysimplexmlelement");
     $this->xml = new GantrySimpleXMLElement($gantry->templatePath . '/templateDetails.xml', null, true);
     if ($this->xml === false) {
         // TODO: figure out way to return error properly
         echo "Unable to find templateDetails.xml file";
     }
     $this->positions =& $this->_getPositions();
     $tmp_options = get_option($gantry->templateName . '-template-options');
     if ($tmp_options !== false) {
         foreach ($tmp_options as $option_name => $option_value) {
             $this->_addTemplateSettings($option_name, $option_value);
         }
     }
     $this->params = $this->_getParams($gantry);
     $this->template_info = $this->_getTemplateInfo();
     $this->widget_styles = $this->_getWidgetStyles();
 }
Example #14
0
function get_version_update_info()
{
    $buffer = '';
    gantry_import('core.gantryupdates');
    $gantry_updates = GantryUpdates::getInstance();
    $currentVersion = $gantry_updates->getCurrentVersion();
    $latest_version = $gantry_updates->getLatestVersion();
    if (version_compare($latest_version, $currentVersion, '>')) {
        $klass = "update";
        $upd = JText::sprintf('COM_GANTRY_VERSION_UPDATE_OUTOFDATE', $latest_version, 'index.php?option=com_installer&view=update');
    } else {
        $klass = "noupdate";
        jimport('joomla.utilities.date');
        $nextupdate = new JDate($gantry_updates->getLastUpdated() + 24 * 60 * 60);
        $upd = JText::sprintf('COM_GANTRY_VERSION_UPDATE_CURRENT', JHTML::_('date', $gantry_updates->getLastUpdated() + 24 * 60 * 60, JText::_('DATE_FORMAT_LC2'), true));
    }
    $buffer .= "\n    <div id='updater' class='" . $klass . "'>\n        <div id='updater-bar' class='h2bar'>Gantry <span>v" . $currentVersion . "</span></div>\n        <div id='updater-desc'>" . $upd . "</div>\n    </div>";
    return $buffer;
}
Example #15
0
 function form($instance)
 {
     gantry_import('core.config.gantryform');
     global $gantry;
     $defaults = $this->_defaults;
     $gantry->addScript('mootools.js');
     $instance = wp_parse_args((array) $instance, $defaults);
     foreach ($instance as $variable => $value) {
         ${$variable} = GantryWidget::_cleanOutputVariable($variable, $value);
         $instance[$variable] = ${$variable};
     }
     $this->_values = $instance;
     $form = GantryForm::getInstance($this, $this->short_name, $this->short_name);
     $form->bind($this->_values);
     ob_start();
     $fieldSets = $form->getFieldsets();
     foreach ($fieldSets as $name => $fieldSet) {
         ?>
         <fieldset class="panelform">
         <?php 
         foreach ($form->getFieldset($name) as $field) {
             ?>
             <div class="field-wrapper">
             <?php 
             echo $field->label;
             ?>
             <?php 
             echo $field->input;
             ?>
             </div>
         <?php 
         }
         ?>
         </fieldset>
         <?php 
     }
     echo ob_get_clean();
 }
Example #16
0
<?php

/**
 * @version   $Id: grouped.php 2325 2012-08-13 17:46:48Z btowles $
 * @author    RocketTheme http://www.rockettheme.com
 * @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
 * @license   http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
 */
defined('GANTRY_VERSION') or die;
gantry_import('core.config.gantryformgroup');
class GantryFormGroupGrouped extends GantryFormGroup
{
    protected $type = 'grouped';
    protected $baseetype = 'group';
    public function getInput()
    {
        $buffer = '';
        $buffer .= "<div class='wrapper'>";
        foreach ($this->fields as $field) {
            $buffer .= '<div class="gantry-field">';
            if ($field->show_label) {
                $buffer .= $this->preLabel($field) . $field->getLabel() . $this->postLabel($field) . "\n";
            }
            $buffer .= $field->getInput();
            $buffer .= "<div class='clr'></div>\n";
            $buffer .= "</div>";
        }
        $buffer .= "</div>";
        return $buffer;
    }
}
Example #17
0
    public function getInput()
    {
        global $gantry;
        gantry_import('core.gantrypositions');
        $output = '';
        $lis = '';
        $currentScheme = '';
        $this->template = end(explode(DS, $gantry->templatePath));
        $this->default = explode(',', str_replace(' ', '', $this->element['default']));
        $this->defaultCount = count($this->default);
        // [0] => schemas | [1] => words | [2] => maxgrid | [3] => type
        //$opts = $node->children();
        $this->maxGrid = (int) $gantry->get('grid_system');
        if (!$this->maxGrid) {
            $this->maxGrid = 12;
        }
        if ($this->element->grid) {
            $this->maxGrid = (int) $this->element->grid;
        } else {
            $this->maxGrid = (int) $gantry->get('grid_system');
        }
        $this->words = explode(",", $this->element->words);
        $this->schemas = explode(",", $this->element->schemas);
        $this->type = $this->element->type ? $this->element->type : 'regular';
        $this->layoutSchemas = $gantry->layoutSchemas[$this->maxGrid];
        $this->defaultMainbodySchemas = $gantry->mainbodySchemas;
        $this->mainbodySchemas = $gantry->mainbodySchemasCombos[$this->maxGrid];
        $this->keyName = '';
        if ($this->type == 'custom') {
            $tmpName = str_replace("Position", "Schemas", $this->element['name']);
            $tmpSchema = $this->{$tmpName};
            $this->keyName = key($tmpSchema[1][0]);
        }
        if (!defined('GANTRY_CSS')) {
            $gantry->addStyle($gantry->gantryUrl . '/admin/widgets/gantry.css');
            define('GANTRY_CSS', 1);
        }
        if (!defined('POSITIONS')) {
            if (!defined('GANTRY_SLIDER')) {
                $gantry->addScript($gantry->gantryUrl . '/admin/widgets/slider/js/slider.js');
                define('GANTRY_SLIDER', 1);
            }
            $gantry->addScript($gantry->gantryUrl . '/admin/widgets/slider/js/unserialize.js');
            $gantry->addScript($gantry->gantryUrl . '/admin/widgets/positions/js/positions-utils.js');
            $this->settings = array("words" => $this->words, "schemas" => $this->schemas, "maxGrid" => $this->maxGrid);
            if ($this->type == 'custom') {
                $this->customCombinations = $this->getCombinations();
            } else {
                $this->combinations = $this->getCombinations();
            }
            define('POSITIONS', 1);
        }
        $posName = $this->element['name'] == "mainbodyPosition" ? "sidebar" : $this->position_info->id;
        $realCount = $gantry->countModules($posName);
        if ($posName == 'sidebar') {
            $realCount += 1;
        }
        if ($realCount > 0) {
            if (!in_array($realCount, $this->schemas)) {
                $realCount = $this->schemas[0];
            }
            $this->default = $this->oneCharConversion($this->layoutSchemas[$realCount]);
            $this->defaultCount = $realCount;
        }
        // if the same type of combinations are requested, use the cached ones, otherwise get the new set
        if ($this->type != "custom" && ($this->words != $this->settings["words"] || $this->schemas != $this->settings["schemas"] || $this->maxGrid != $this->settings["maxGrid"])) {
            $this->combinations = $this->getCombinations();
        }
        if ($this->type == "custom") {
            $this->customCombinations = $this->getCombinations();
        }
        if (!in_array((string) $this->defaultCount, $this->schemas)) {
            $this->defaultCount = (int) $this->schemas[0];
        }
        $i = 0;
        $max_positions = isset($this->position_info) ? $this->position_info->max_positions : false;
        if (!$max_positions) {
            $max_positions = 6;
        }
        foreach ($this->schemas as $scheme) {
            $active = "";
            if ($i >= $max_positions) {
                break;
            }
            if ((int) $scheme == $this->defaultCount) {
                $active = ' class="active"';
                $currentLayout = $scheme;
            }
            $lis .= '<li' . $active . '><a href="#"><span>' . $scheme . '</span></a></li>';
            $i++;
        }
        $scriptinit = $this->sliderInit($this->id);
        $gantry->addDomReadyScript($scriptinit);
        $gantry->addDomReadyScript($this->showmax($this->id));
        $letters = array('a', 'b', 'c', 'd', 'e', 'f');
        $output = '
		<div class="wrapper">
		<div id="' . $this->id . '-grp" class="g-position">
			<div class="navigation">
				<span class="title">Positions:</span>
				<ul class="list">' . $lis . '</ul>
			</div>
			<div class="clr"></div>
			<div id="' . $this->id . '-wrapper" class="col' . $this->maxGrid . ' miniatures">
				<div class="mini-container layout-grid-' . $currentLayout . '">' . "\n";
        for ($i = 0; $i < $max_positions; $i++) {
            $output .= "<div class=\"mini-grid mini-grid-2\">" . $letters[$i] . "</div>\n";
        }
        $output .= '
				</div>
				<div class="clr"></div>
				<div class="position">
					<div class="position2"></div>
					<div class="knob"></div>
				</div>
			</div>
<!--			<div class="current-positions">
				<span class="title">' . str_replace('%d', "<strong class='" . $this->id . "-currentPosition countPositions'>" . $realCount . "</strong>", JText::_('Current Positions')) . '</span>
			</div>-->
			<input type="hidden" id="' . $this->id . '" name="' . $this->name . '" value=\'';
        $output .= $this->value;
        $output .= '\' />
		</div>
		</div>
		';
        return $output;
    }
Example #18
0
<?php

/**
 * @version   3.2.20 June 19, 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.config.gantryformfield');
/**
 * @package     gantry
 * @subpackage  admin.elements
 */
class GantryFormFieldTips extends GantryFormField
{
    protected $type = 'tips';
    protected $basetype = 'none';
    public function getInput()
    {
        global $gantry;
        $gantry->addScript($gantry->gantryUrl . '/admin/widgets/tips/js/tips.js');
        $xmlist = $gantry->templatePath . '/admin/tips/' . $this->element['tab'] . '.xml';
        if (!file_exists($xmlist)) {
            die($xmlist . ' file not found');
        }
        $xml = simplexml_load_file($xmlist);
        $count = count($xml);
        $random = rand(0, $count - 1);
        $output = "\n\t\t<div class=\"gantrytips\">\n\n\t\t\t<div class=\"gantry-pin\"></div>\n\n\t\t\t<div class=\"gantrytips-controller\">\n\n\t\t\t\t<div class=\"gantrytips-arrow gantrytips-left\">&#x25c0;</div>\n\n\t\t\t\t<div class=\"gantrytips-middle\"><span><span class=\"current-tip\">" . ($random + 1) . "</span> / " . $count . "</span></div>\n\n\t\t\t\t<div class=\"gantrytips-arrow gantrytips-right\">&#x25b6;</div>\n\n\t\t\t</div>\n\n\t\t\t<div class=\"gantrytips-desc\">\n\n\t\t\t\t<div class=\"gantrytips-wrapper\">\n";
        for ($i = 0; $i < $count; $i++) {
Example #19
0
<?php

/**
 * @version   3.2.19 April 2, 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.config.gantryformfield');
gantry_import('core.config.gantryhtmlselect');
class GantryFormFieldGroupedList extends GantryFormField
{
    /**
     * The form field type.
     *
     * @var		string
     * @since	1.6
     */
    protected $type = 'groupedlist';
    protected $basetype = 'select';
    /**
     * Method to get the field option groups.
     *
     * @return	array	The field option objects as a nested array in groups.
     * @since	1.6
     */
    protected function getGroups()
    {
        // Initialize variables.
        $groups = array();
Example #20
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.gantrylayout');
/**
 *
 * @package gantry
 * @subpackage html.layouts
 */
class GantryLayoutCommentsTempl_Basic extends GantryLayout
{
    var $render_params = array('commentLayout' => 'basic');
    function render($params = array())
    {
        global $wp_query, $withcomments, $post, $wpdb, $id, $comment, $user_login, $user_ID, $user_identity, $overridden_cpage;
        global $gantry;
        $fparams = $this->_getParams($params);
        $comment_layout_name = 'comment_' . $fparams->commentLayout;
        $layout = $gantry->_getLayout($comment_layout_name);
        $className = 'GantryLayout' . ucfirst($comment_layout_name);
        // Do not delete these lines
        ob_start();
        if (post_password_required()) {
            ?>
<?php

/**
 * @version		3.2.16 February 8, 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
 *
 * Gantry uses the Joomla Framework (http://www.joomla.org), a GNU/GPLv2 content management system
 *
 */
defined('GANTRY_VERSION') or die('Restricted access');
gantry_import('facets.menu.gantrymenutreebase');
gantry_import('facets.menu.gantrymenunode');
/**
 * Rok Nav Menu Tree Class.
 */
class GantryMenuTree extends GantryMenuTreeBase
{
    //	const MENUPARAM_MENU_IMAGES 		= "menu_images";
    //	const MENUPARAM_LIMIT_LEVELS		= "limit_levels";
    //	const MENUPARAM_START_LEVEL 		= "startLevel";
    //	const MENUPARAM_END_LEVEL 			= "endLevel";
    //	const MENUPARAM_SHOW_ALL_CHILDREN 	= "showAllChildren";
    //	const MENUPARAM_TAG_ID 			= "tag_id";
    //	const MENUPARAM_CLASS_SUFFIX 		= "class_sfx";
    //	const MENUPARAM_MENU_IMAGES_LINK	= "menu_images_link";
    //	const MENUPARAM_MAX_DEPTH 			= "maxdepth";
    function addNode(&$params, $item)
    {
        // Get menu item data
<?php

/**
 * @version   3.2.20 June 19, 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
 */
require_once dirname(__FILE__) . '/cache/cache.class.php';
require_once dirname(__FILE__) . '/cache/joomlaCacheDriver.class.php';
require_once dirname(__FILE__) . '/cache/fileCacheDriver.class.php';
gantry_import('core.gantrysingleton');
/**
 *
 */
class GantryCache
{
    static $instance;
    const GROUP_NAME = 'Gantry';
    /**
     * Files to watch for changes.  Invalidate cache
     * @var array
     */
    protected $watch_files = array();
    /**
     * The cache object.
     *
     * @var Cache
     */
    protected $cache = null;
    /**
Example #23
0
 public function getInput()
 {
     global $gantry;
     $currentVersion = "3.2.3";
     if ($currentVersion == ".2.11") {
         $currentVersion = "[DEV]";
     }
     // curl check
     if (!function_exists('curl_version')) {
         $upd = "<strong>cURL is required to check for latest versions of the Gantry Framework. </strong> Learn more at <a href='http://www.php.net/manual/en/book.curl.php'>http://www.php.net</a>";
         return "\n\t\t\t\t<div id='updater' class='update'>\n\t\t\t\t\t<div id='updater-bar' class='h2bar'>Gantry <span>v" . $currentVersion . "</span></div>\n\t\t\t\t\t<div id='updater-desc'>" . $upd . "</div>\n\t\t\t\t</div>\n\t\t\t";
     }
     jimport('joomla.utilities.date');
     gantry_import('core.gantryini');
     global $gantry;
     $klass = "noupdate";
     $output = "";
     $statusText = "";
     $now = time();
     $cache_file = $gantry->custom_dir . DS . 'gantry_version';
     if (file_exists($cache_file) && is_file($cache_file) && is_readable($cache_file)) {
         $old_cache_data = GantryINI::read($cache_file, $this->type, 'check');
         $old_cache_date = $old_cache_data['date'];
     } else {
         $old_cache_data['version'] = GANTRY_VERSION;
         $old_cache_data['date'] = 1;
         $old_cache_data['link'] = '';
         $old_cache_date = 0;
     }
     // only grab from the web if its been more the 24 hours since the last check
     if ($old_cache_date + 24 * 60 * 60 < $now) {
         $data = $this->_get_url_contents('http://code.google.com/feeds/p/gantry-framework/downloads/basic');
         if (!empty($this->_error)) {
             $klass = "update";
             $upd = "<strong>Error checking version:</strong> " . $this->_error;
             $latest_version = GANTRY_VERSION;
         } else {
             $xml = new SimpleXMLElement($data);
             foreach ($xml->entry as $entry) {
                 $title = (string) $entry->title;
                 if (preg_match('/gantry_framework_joomla16-(.*).zip/', $title, $matches)) {
                     $linkattribs = $entry->link[0]->attributes();
                     $link = (string) $linkattribs['href'];
                     $latest_version = $matches[1];
                     $cache_data[$this->type]['check']['version'] = $latest_version;
                     $cache_data[$this->type]['check']['link'] = $link;
                     $cache_data[$this->type]['check']['date'] = $now;
                     GantryINI::write($cache_file, $cache_data, false);
                     break;
                 }
             }
         }
     } else {
         $latest_version = $old_cache_data['version'];
         $link = $old_cache_data['link'];
     }
     if ($latest_version != $currentVersion) {
         $klass = "update";
         $upd = "<strong>Version " . $latest_version . " of the Gantry Framework is Available</strong>.  Please <a href='" . $link . "'>download the latest version</a> now.";
     } else {
         $ms = $old_cache_date + 24 * 60 * 60 - $now;
         $hours = round($ms / 60 / 60);
         $minutes = $hours / 60;
         $upd = "<strong>The Gantry Framework is up-to-date!</strong><br />You are running the latest version, you will be notified here if a newer version is available.<br />";
         $upd .= "An update check will be executed every 24hr. Next check in: <dev>";
     }
     $output = "\n\t\t<div id='updater' class='" . $klass . "'>\n\t\t\t<div id='updater-bar' class='h2bar'>Gantry <span>v" . $currentVersion . "</span></div>\n\t\t\t<div id='updater-desc'>" . $upd . "</div>\n\t\t</div>";
     return $output;
 }
<?php

/**
 * @version   $Id: gantrymenuformatter.class.php 11319 2013-06-07 15:26:51Z steph $
 * @author    RocketTheme http://www.rockettheme.com
 * @copyright Copyright (C) 2007 - 2014 RocketTheme, LLC
 * @license   http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
 *
 * Gantry uses the Joomla Framework (http://www.joomla.org), a GNU/GPLv2 content management system
 *
 */
// no direct access
defined('GANTRY_VERSION') or die('Restricted access');
gantry_import('facets.menu.gantrymenutree');
/*
 * Created on Jan 16, 2009
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
class GantryMenuFormatter
{
    function format_tree(&$nav_menu_tree)
    {
        if ($nav_menu_tree->hasChildren()) {
            reset($nav_menu_tree->_children);
            while (list($key, $value) = each($nav_menu_tree->_children)) {
                $child_node =& $nav_menu_tree->_children[$key];
                $menu_params =& $nav_menu_tree->_params;
                $this->format_subnodes($child_node, $menu_params);
            }
Example #25
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.gantrygizmo');
/**
 * @package     gantry
 * @subpackage  features
 */
class GantryGizmoWidgetShortcodes extends GantryGizmo
{
    var $_name = 'widgetshortcodes';
    function query_parsed_init()
    {
        add_filter('widget_text', 'do_shortcode');
    }
}
Example #26
0
<?php

/**
 * @package     gantry
 * @subpackage  features
 * @version		3.0.11 September 5, 2010
 * @author		RocketTheme http://www.rockettheme.com
 * @copyright 	Copyright (C) 2007 - 2010 RocketTheme, LLC
 * @license		http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
 *
 * Gantry uses the Joomla Framework (http://www.joomla.org), a GNU/GPLv2 content management system
 *
 */
defined('JPATH_BASE') or die;
gantry_import('core.gantryfeature');
/**
 * @package     gantry
 * @subpackage  features
 */
class GantryFeatureFusionMenu extends GantryFeature
{
    var $_feature_name = 'fusionmenu';
    var $_feature_prefix = 'menu-type';
    function isEnabled()
    {
        global $gantry;
        $menu_enabled = $gantry->get('menu-enabled');
        $selected_menu = $gantry->get($this->_feature_prefix);
        if (1 == (int) $menu_enabled && $selected_menu == $this->_feature_name) {
            return true;
        }
<?php

/**
 * @version   $Id: dateformats.php 2325 2012-08-13 17:46:48Z btowles $
 * @author    RocketTheme http://www.rockettheme.com
 * @copyright Copyright (C) 2007 - 2013 RocketTheme, LLC
 * @license   http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
 */
defined('GANTRY_VERSION') or die;
/**
 * @package     gantry
 * @subpackage  admin.elements
 */
gantry_import('core.utilities.gantrydate');
require_once dirname(__FILE__) . '/selectbox.php';
class GantryFormFieldDateFormats extends GantryFormFieldSelectBox
{
    var $_name = 'DateFormats';
    protected $type = 'dateformats';
    protected $basetype = 'select';
    protected function getOptions()
    {
        $now = new GantryDate();
        // Initialize variables.
        $options = array();
        $translation = $this->element['translation'] ? $this->element['translation'] : true;
        foreach ($this->element->children() as $option) {
            // Only add <option /> elements.
            if ($option->getName() != 'option') {
                continue;
            }
<?
/**
 * @package     gantry
 * @subpackage  admin.elements
 * @version        3.0.11 September 5, 2010
 * @author        RocketTheme http://www.rockettheme.com
 * @copyright     Copyright (C) 2007 - 2010 RocketTheme, LLC
 * @license        http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
 *
 * Gantry uses the Joomla Framework (http://www.joomla.org), a GNU/GPLv2 content management system
 *
 */
defined('JPATH_BASE') or die();

gantry_import('core.config.gantrygroupelement');
/**
 * Renders chained element
 *
 * @package gantry
 * @subpackage admin.elements
 */
class JElementChain extends GantryGroupElement {
    var    $_name = 'Preset';

    function fetchElement($name, $value, &$node, $control_name) {
        global $gantry;

        $buffer = '';
        $class = ($node->attributes('class') ? 'class="' . $node->attributes('class') . '"' : 'class="inputbox"');
        $chain = $node->children();
<?php

/**
 * @package   gantry
 * @subpackage core.params
 * @version   3.2.16 February 8, 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
 *
 * Gantry uses the Joomla Framework (http://www.joomla.org), a GNU/GPLv2 content management system
 *
 */
defined('GANTRY_VERSION') or die;
gantry_import('core.params.gantryparamoverride');
/**
 * @package   gantry
 * @subpackage core.params
 */
class GantryCookieParamOverride extends GantryParamOverride
{
    public function store()
    {
        global $gantry;
        if (array_key_exists('cookie_time', $gantry->_working_params)) {
            $cookie_time = time() + (int) $gantry->_working_params['cookie_time']['value'];
        }
        foreach ($this->_setincookie as $cookie_var) {
            if ($gantry->_working_params[$cookie_var]['setby'] != 'menuitem') {
                if ($gantry->_working_params[$cookie_var]['value'] != $gantry->_working_params[$cookie_var]['sitebase'] && $gantry->_working_params[$cookie_var]['type'] != 'preset') {
                    setcookie($gantry->template_prefix . $gantry->_base_params_checksum . "-" . $cookie_var, $gantry->_working_params[$cookie_var]['value'], $cookie_time, $gantry->getCookiePath(), false);
Example #30
0
<?php

/**
 * @package gantry
 * @subpackage admin.ajax-models
 * @version        3.2.16 February 8, 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.config.gantryformnaminghelper');
global $gantry;
$action = JRequest::getWord('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 = GantryFormNamingHelper::get_field_id($param['name']);
        $passed_array[$param_name] = $param['value'];
    }
    $outdata = json_encode($passed_array);
    //$outdata = str_replace('\\\\\\' , '\\', $outdata);
    echo $outdata;
} else {
    if ($action == 'get_default_values') {
        $passed_array = array();
        foreach ($gantry->_working_params as $param) {
            $param_name = GantryFormNamingHelper::get_field_id($param['name']);
            $passed_array[$param_name] = $param['default'];