<?php
/* --------------------------------------------------------------
TemplateContol.inc.php 2012-05-21 gm
Gambio GmbH
http://www.gambio.de
Copyright (c) 2012 Gambio GmbH
Released under the GNU General Public License (Version 2)
[http://www.gnu.org/licenses/gpl-2.0.html]
--------------------------------------------------------------
*/
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Description of TemplateControl
*
* first load: $coo_template_control =& MainFactory::create_object('TemplateControl', array(CURRENT_TEMPLATE), true);
* later use: $coo_template_control =& MainFactory::create_object('TemplateControl', array(), true);
*
* @author ncapuno
*/
class TemplateControl
{
public $v_optional_template_settings_array = array();
# set in load_template()
private $v_template_name = '';
private $v_template_presentation_version = '';
# set in constructor
private $v_template_container = '';
private $v_coo_boxes_master = false;
public static function &get_instance($p_template_name=false)
{
static $s_instance;
if($s_instance === NULL)
{
if($p_template_name === false)
{
trigger_error('need template-parameter for creating instance', E_USER_ERROR);
die();
}
$s_instance = new TemplateControl($p_template_name);
}
return $s_instance;
}
public function TemplateControl($p_template_name)
{
if(isset($GLOBALS['gmBoxesMaster']))
{
$this->v_coo_boxes_master = $GLOBALS['gmBoxesMaster'];
}
else {
$this->v_coo_boxes_master = MainFactory::create_object('SimpleBoxesMaster');
}
$this->v_template_container = DIR_FS_CATALOG.'templates/';
$this->load_template($p_template_name);
}
public function load_template($p_template_name)
{
# look for main file in given template directory name
$t_check_file = $this->v_template_container.$p_template_name.'/index.html';
if(file_exists($t_check_file) == false)
{
# main file not found. template name invalid?
trigger_error('template not found: '. $p_template_name, E_USER_ERROR);
die();
}
# all right. set template name
$this->v_template_name = $p_template_name;
# try to load template settings
$t_settings_file = $this->v_template_container.$this->v_template_name.'/template_settings.php';
if(file_exists($t_settings_file))
{
# include file with settings-array inside
include($t_settings_file);
# load settings
$this->v_optional_template_settings_array = $t_template_settings_array;
$this->v_template_presentation_version = $t_template_settings_array['TEMPLATE_PRESENTATION_VERSION'];
}
else
{
# old templates dont have settings files. use default version (=1.0)
$this->v_template_presentation_version = 1.0;
}
}
public function get_menubox_status($p_menubox)
{
if(isset($_SESSION['style_edit_mode']) && $_SESSION['style_edit_mode'] == 'edit')
{
# show all boxes, if style_edit is running
$t_output = 1;
}
else {
$t_output = $this->v_coo_boxes_master->get_status($p_menubox);
}
return $t_output;
}
public function get_menubox_position($p_menubox)
{
$t_output = $this->v_coo_boxes_master->get_position($p_menubox);
return $t_output;
}
public function get_template_name()
{
return $this->v_template_name;
}
public function get_template_presentation_version()
{
return $this->v_template_presentation_version;
}
}
?>| nama | waktu | ukuran | owner | perm | aksi |
|---|---|---|---|---|---|
| .. | |||||
| FeatureFilter/ | 2013-11-12 21:11 | 63.96 KB | 76129f60960:kunden | dxwrx-rx-r | |
| Properties/ | 2013-11-12 21:11 | 33.17 KB | 76129f60960:kunden | dxwrx-rx-r | |
| QuantityUnit/ | 2013-11-12 21:11 | 11.82 KB | 76129f60960:kunden | dxwrx-rx-r | |
| SliderSet/ | 2013-11-12 21:11 | 35.94 KB | 76129f60960:kunden | dxwrx-rx-r | |
| google/ | 2013-11-12 21:11 | 13.18 KB | 76129f60960:kunden | dxwrx-rx-r | |
| AdminMenuControl.inc.php | 2013-11-12 21:11 | 2.54 KB | 76129f60960:kunden | -xw-x----- | |
| BrowserExtensionControl.inc.php | 2013-11-12 21:11 | 5.4 KB | 76129f60960:kunden | -xw-x----- | |
| CacheControl.inc.php | 2013-11-12 21:11 | 7.99 KB | 76129f60960:kunden | -xw-x----- | |
| CategoriesAgent.inc.php | 2013-11-12 21:11 | 9.8 KB | 76129f60960:kunden | -xw-x----- | |
| DataObjectContainer.inc.php | 2013-11-12 21:11 | 1.44 KB | 76129f60960:kunden | -xw-x----- | |
| EkomiAccountManager.inc.php | 2013-11-12 21:11 | 3.63 KB | 76129f60960:kunden | -xw-x----- | |
| EkomiManager.inc.php | 2013-11-12 21:11 | 8.81 KB | 76129f60960:kunden | -xw-x----- | |
| ExtenderComponent.inc.php | 2013-11-12 21:11 | 758 B | 76129f60960:kunden | -xw-x----- | |
| HTTPCaching.inc.php | 2013-11-12 21:11 | 3.78 KB | 76129f60960:kunden | -xw-x----- | |
| JSOptionsControl.inc.php | 2013-11-12 21:11 | 654 B | 76129f60960:kunden | -xw-x----- | |
| LanguageTextManager.inc.php | 2013-11-12 21:11 | 5.66 KB | 76129f60960:kunden | -xw-x----- | |
| ListingManager.inc.php | 2013-11-12 21:11 | 1.34 KB | 76129f60960:kunden | -xw-x----- | |
| LoadUrl.php | 2013-11-12 21:11 | 1.86 KB | 76129f60960:kunden | -xw-x----- | |
| PageTrack.inc.php | 2013-11-12 21:11 | 1.73 KB | 76129f60960:kunden | -xw-x----- | |
| RecreateOrder.inc.php | 2013-11-12 21:11 | 7.99 KB | 76129f60960:kunden | -xw-x----- | |
| ShopURLHandler.inc.php | 2013-11-12 21:11 | 2 KB | 76129f60960:kunden | -xw-x----- | |
| TemplateControl.inc.php | 2013-11-12 21:11 | 3.47 KB | 76129f60960:kunden | -xw-x----- | |
| index.html | 2013-11-12 21:11 | 395 B | 76129f60960:kunden | -xw-x----- | |