Ejemplo n.º 1
0
 function t3_init()
 {
     t3import('core.parameter');
     t3import('core.extendable');
     t3import('core.template');
     t3import('core.basetemplate');
     t3import('core.cache');
     t3import('core.head');
     t3import('core.hook');
     t3import('core.joomla.view');
     if (!class_exists('JModuleHelper', false)) {
         t3import('core.joomla.modulehelper');
     }
     t3import('core.joomla.pagination');
     //Load template language
     $this->loadLanguage('tpl_' . T3_ACTIVE_TEMPLATE, JPATH_SITE);
     $params = T3Common::get_template_based_params();
     //instance cache object.
     $devmode = $params ? $params->get('devmode', '0') == '1' : false;
     T3Cache::getInstance($devmode);
     //Check if enable T3 info mode. Enable by default (if not set)
     if ($params->get('infomode', 1) == 1) {
         if (!JRequest::getCmd('t3info') && JRequest::getCmd('tp')) {
             JRequest::setVar('t3info', JRequest::getCmd('tp'));
         }
     }
     $key = T3Cache::getPageKey();
     $data = null;
     $user =& JFactory::getUser();
     if (!$devmode && JRequest::getCmd('cache') != 'no') {
         T3Cache::setCaching(true);
         JResponse::allowCache(true);
     }
     $data = T3Cache::get($key);
     if ($data) {
         if (!preg_match('#<jdoc:include\\ type="([^"]+)" (.*)\\/>#iU', $data)) {
             $mainframe = JFactory::getApplication();
             $token = JUtility::getToken();
             $search = '#<input type="hidden" name="[0-9a-f]{32}" value="1" />#';
             $replacement = '<input type="hidden" name="' . $token . '" value="1" />';
             $data = preg_replace($search, $replacement, $data);
             JResponse::setBody($data);
             echo JResponse::toString($mainframe->getCfg('gzip'));
             if (JDEBUG) {
                 global $_PROFILER;
                 $_PROFILER->mark('afterCache');
                 echo implode('', $_PROFILER->getBuffer());
             }
             $mainframe->close();
         }
     }
     //Preload template
     t3import('core.preload');
     $preload = T3Preload::getInstance();
     $preload->load();
     $doc =& JFactory::getDocument();
     $t3 = T3Template::getInstance($doc);
     $t3->_html = $data;
 }
Ejemplo n.º 2
0
 /**
  * Call hook function
  *
  * @param string $hookname  Hook function name
  * @param array  $args      List of arguments
  *
  * @return mixed  Returns the function result, or FALSE on error.
  */
 function _($hookname, $args = array())
 {
     //load custom hook
     T3Hook::_load();
     //find hook function
     $themes = T3Common::get_active_themes();
     foreach ($themes as $theme) {
         $func = $theme[0] . "_" . $theme[1] . "_" . $hookname;
         if (function_exists($func)) {
             return call_user_func_array($func, $args);
         }
     }
     if (function_exists($hookname)) {
         return call_user_func_array($hookname, $args);
     }
     if (function_exists("T3Hook::{$hookname}")) {
         return call_user_func_array("T3Hook::{$hookname}", $args);
     }
     return false;
 }
Ejemplo n.º 3
0
 /**
  * Get instance of object
  *
  * @param array $plgParams  Plugin params
  *
  * @return T3Parameter
  */
 function &getInstance($plgParams = null)
 {
     static $_instance = null;
     if (!isset($_instance)) {
         $template = T3_ACTIVE_TEMPLATE;
         $template_info = T3Common::get_template_params();
         //get cookie options
         $params_cookie = array();
         $params_cookie[] = 'ui';
         foreach (array_keys($template_info->toArray()) as $name) {
             if (preg_match('/^option_(.+)$/', $name, $matches) && $template_info->get($name)) {
                 $params_cookie[] = $matches[1];
             }
         }
         $_instance = new T3Parameter($template, $params_cookie);
         if ($plgParams) {
             foreach ($plgParams->toArray() as $key => $value) {
                 $_instance->setParam($key, $value);
             }
         }
     }
     return $_instance;
 }
Ejemplo n.º 4
0
 function load($template = '')
 {
     if (!$template) {
         $template = T3_ACTIVE_TEMPLATE;
     }
     if (isset($this->data[$template])) {
         return $this->data[$template];
     }
     //$key = T3Parameter::getKey ('preload-'.$template, 0);
     $key = T3Cache::getPreloadKey($template);
     $this->data[$template] = T3Cache::get_object($key);
     if (!$this->data[$template]) {
         $this->data[$template] = array();
         $themes = $this->getT3Themes($template);
         foreach ($themes as $theme => $path) {
             $this->scanFiles(JPATH_SITE . DS . $path, '\\.php|\\.js|\\.css|\\.bmp|\\.gif|\\.jpg|\\.png', $template);
         }
         /*			
         			//create fake html, css, image for template
         			foreach ($this->data[$template] as $f=>$file) {
         				if (preg_match ('/^html/', $f)) {
         					$this->buildLayoutFile ($f, $template);
         				} else if (preg_match ('/^css/', $f)) {
         					$this->buildCSSFile ($f, $template);
         				} else if (preg_match ('/^images/', $f)) {
         					$this->buildImageFile ($f, $template);
         				}
         			}
         */
         $this->data[$template]['themes'] = T3Common::get_themes();
         $this->data[$template]['layouts'] = T3Common::get_layouts();
         $this->data[$template]['profiles'] = T3Common::get_profiles();
         //store in cache
         T3Cache::store_object($this->data[$template], $key);
     }
 }
Ejemplo n.º 5
0
 /**
  * Load resource of template
  *
  * @param string $template  Template name
  *
  * @return void
  */
 function load($template = '')
 {
     if (!$template) {
         $template = T3_ACTIVE_TEMPLATE;
     }
     if (isset($this->data[$template])) {
         return $this->data[$template];
     }
     $key = T3Cache::getPreloadKey($template);
     $t3cache = T3Cache::getT3Cache();
     $this->data[$template] = $t3cache->getObject($key);
     if (!$this->data[$template]) {
         $this->data[$template] = array();
         $themes = $this->getT3Themes($template);
         foreach ($themes as $theme => $path) {
             $this->scanFiles(JPATH_SITE . DS . $path, '\\.php|\\.js|\\.css|\\.bmp|\\.gif|\\.jpg|\\.png', $template);
         }
         $this->data[$template]['themes'] = T3Common::get_themes();
         $this->data[$template]['layouts'] = T3Common::get_layouts();
         $this->data[$template]['profiles'] = T3Common::get_profiles();
         //store in cache
         $t3cache->storeObject($this->data[$template], $key);
     }
 }
Ejemplo n.º 6
0
<?php

/**
 * ------------------------------------------------------------------------
 * JA T3v2 System Plugin for J3.x
 * ------------------------------------------------------------------------
 * Copyright (C) 2004-2011 J.O.O.M Solutions Co., Ltd. All Rights Reserved.
 * @license - GNU/GPL, http://www.gnu.org/licenses/gpl.html
 * Author: J.O.O.M Solutions Co., Ltd
 * Websites: http://www.joomlart.com - http://www.joomlancers.com
 * ------------------------------------------------------------------------
 */
// No direct access
defined('_JEXEC') or die;
$themes = T3Common::get_themes();
$currthemes = preg_split('/,/', $this->getParam('themes'));
?>

<h3><?php 
echo JText::_('CHANGE_THEMES');
?>
</h3>

<div class="ja-box-usertools">
  <ul class="ja-usertools-theme clearfix">
  <?php 
foreach ($themes as $theme => $themeinfo) {
    ?>
    <li class="theme theme-<?php 
    echo str_replace('.', '-', $theme) . (in_array($theme, $currthemes) ? '-active' : '');
    ?>
Ejemplo n.º 7
0
<?php

/**
 * ------------------------------------------------------------------------
 * JA T3v2 System Plugin for J3.x
 * ------------------------------------------------------------------------
 * Copyright (C) 2004-2011 J.O.O.M Solutions Co., Ltd. All Rights Reserved.
 * @license - GNU/GPL, http://www.gnu.org/licenses/gpl.html
 * Author: J.O.O.M Solutions Co., Ltd
 * Websites: http://www.joomlart.com - http://www.joomlancers.com
 * ------------------------------------------------------------------------
 */
// No direct access
defined('_JEXEC') or die;
$layouts = T3Common::get_layouts();
$currlayouts = preg_split('/,/', $this->getParam('layouts', T3Common::get_active_layout()));
if (count($layouts) < 2) {
    return;
}
?>

<h3><?php 
echo JText::_('Layout');
?>
</h3>

<div class="ja-box-usertools">
  <ul class="ja-usertools-layout clearfix">
  <?php 
foreach ($layouts as $layout) {
    if (preg_match('#-rtl$#', $layout)) {
Ejemplo n.º 8
0
?>
    <?php 
$this->genBlockEnd($this->getBlocksXML('middle'));
?>
    </div>
    <?php 
//Add fix height for main area
if (T3Common::node_attributes($this->getBlocksXML('middle'), 'fixheight')) {
    $this->showBlock('fixheight');
}
?>
    <!-- //MAIN CONTAINER -->

    <?php 
$blks =& $this->getBlocksXML('bottom');
$blocks =& T3Common::node_children($blks, 'block');
foreach ($blocks as $block) {
    //if (T3Common::getBrowserSortName() == 'ie' && T3Common::getBrowserMajorVersion() == 7) echo "<br class=\"clearfix\"/>";
    $this->showBlock($block);
}
?>

</div>

<?php 
if ($this->isIE6()) {
    ?>
    <?php 
    $this->showBlock('ie6/ie6warning');
}
?>
Ejemplo n.º 9
0
<?php

/**
 * @version		$Id: default.php 18117 2010-07-13 18:09:01Z infograf768 $
 * @package		Joomla.Site
 * @subpackage	mod_footer
 * @copyright	Copyright (C) 2005 - 2010 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */
// no direct access
defined('_JEXEC') or die;
?>
<small><?php 
echo $lineone;
?>
 Designed by <a href="http://www.joomlart.com/" title="Visit Joomlart.com!" <?php 
echo T3Common::isHome() ? '' : 'rel="nofollow"';
?>
>JoomlArt.com</a>.</small>
<small><?php 
echo JText::_('MOD_FOOTER_LINE2');
?>
</small>
Ejemplo n.º 10
0
<?php

/**
 * ------------------------------------------------------------------------
 * JA T3 System Plugin for Joomla 2.5
 * ------------------------------------------------------------------------
 * Copyright (C) 2004-2011 J.O.O.M Solutions Co., Ltd. All Rights Reserved.
 * @license - GNU/GPL, http://www.gnu.org/licenses/gpl.html
 * Author: J.O.O.M Solutions Co., Ltd
 * Websites: http://www.joomlart.com - http://www.joomlancers.com
 * ------------------------------------------------------------------------
 */
// No direct access
defined('_JEXEC') or die;
define('T3_ACTIVE_TEMPLATE', T3Common::get_active_template());
define('T3_BASE', 'plugins/system/jat3/jat3');
define('T3_CORE', T3_BASE . '/core');
define('T3_BASETHEME', T3_BASE . '/base-themes/default');
define('T3_TEMPLATE', 'templates/' . T3_ACTIVE_TEMPLATE);
define('T3_TEMPLATE_CORE', 'templates/' . T3_ACTIVE_TEMPLATE . '/core');
define('T3_TEMPLATE_LOCAL', 'templates/' . T3_ACTIVE_TEMPLATE . '/local');
define('T3_TOOL_COLOR', 'color');
define('T3_TOOL_SCREEN', 'screen');
define('T3_TOOL_FONT', 'font');
define('T3_TOOL_MENU', 'menu');
define('T3_TOOL_THEMES', 'themes');
define('T3_TOOL_LAYOUTS', 'layouts');
Ejemplo n.º 11
0
/**
 * ------------------------------------------------------------------------
 * JA T3 System Plugin for Joomla 2.5
 * ------------------------------------------------------------------------
 * Copyright (C) 2004-2011 J.O.O.M Solutions Co., Ltd. All Rights Reserved.
 * @license - GNU/GPL, http://www.gnu.org/licenses/gpl.html
 * Author: J.O.O.M Solutions Co., Ltd
 * Websites: http://www.joomlart.com - http://www.joomlancers.com
 * ------------------------------------------------------------------------
 */
// No direct access
defined('_JEXEC') or die;
$profiles = T3Common::get_profiles();
//$currprofiles = T3Common::get_default_profile() ;
$currprofiles = T3Common::get_active_profile();
if (count($profiles) < 2) {
    return;
}
?>

<h3><?php 
echo JText::_('PROFILE');
?>
</h3>

<div class="ja-box-usertools">
  <ul class="ja-usertools-profile clearfix">
  <?php 
foreach ($profiles as $profile) {
    if (strtolower($profile) == 'home') {
Ejemplo n.º 12
0
 function t3_init()
 {
     t3import('core.parameter');
     t3import('core.extendable');
     t3import('core.template');
     t3import('core.cache');
     t3import('core.head');
     t3import('core.hook');
     // Remove JDocumentHTML for compatible J1.6 & J1.7
     // if (!class_exists ('JDocumentHTML', false)) t3import ('core.joomla.documenthtml');
     if (!class_exists('JView', false)) {
         t3import('core.joomla.view');
     }
     if (!class_exists('JModuleHelper', false)) {
         t3import('core.joomla.modulehelper');
     }
     // if (! class_exists('JPagination', false)) t3import('core.joomla.pagination');
     //Load template language
     $this->loadLanguage('tpl_' . T3_ACTIVE_TEMPLATE, JPATH_SITE);
     $params = T3Common::get_template_based_params();
     //instance cache object.
     $devmode = $params ? $params->get('devmode', '0') == '1' : false;
     $t3cache = T3Cache::getT3Cache($devmode);
     //Check if enable T3 info mode. Enable by default (if not set)
     if ($params->get('infomode', 1) == 1) {
         if (!JRequest::getCmd('t3info') && JRequest::getCmd('tp') && JComponentHelper::getParams('com_templates')->get('template_positions_display')) {
             JRequest::setVar('t3info', JRequest::getCmd('tp'));
         }
     }
     $key = T3Cache::getPageKey();
     $user =& JFactory::getUser();
     $data = null;
     if ($devmode || JRequest::getCmd('cache') == 'no') {
         $t3cache->setCaching(false);
         JResponse::allowCache(false);
     } else {
         $t3cache->setCaching(true);
         JResponse::allowCache(true);
     }
     // Get cache
     $data = $t3cache->get($key);
     if ($data) {
         $mainframe = JFactory::getApplication();
         // Check HTTP header
         $if_modified_since = isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) : false;
         $if_none_match = isset($_SERVER['HTTP_IF_NONE_MATCH']) ? stripslashes($_SERVER['HTTP_IF_NONE_MATCH']) : false;
         $cache_time = (int) substr($data, 0, 20);
         $etag = md5($key);
         if ($if_modified_since && $if_none_match && $if_modified_since == $cache_time && $if_none_match == $etag) {
             header('HTTP/1.x 304 Not Modified', true);
             $mainframe->close();
         }
         $data = substr($data, 20);
         // Check cached data
         if (!preg_match('#<jdoc:include\\ type="([^"]+)" (.*)\\/>#iU', $data)) {
             $token = JUtility::getToken();
             $search = '#<input type="hidden" name="[0-9a-f]{32}" value="1" />#';
             $replacement = '<input type="hidden" name="' . $token . '" value="1" />';
             $data = preg_replace($search, $replacement, $data);
             JResponse::setHeader('Last-Modified', gmdate('D, d M Y H:i:s', $cache_time) . ' GMT', true);
             JResponse::setHeader('ETag', $etag, true);
             JResponse::setBody($data);
             echo JResponse::toString($mainframe->getCfg('gzip'));
             if (JDEBUG) {
                 global $_PROFILER;
                 $_PROFILER->mark('afterCache');
                 echo implode('', $_PROFILER->getBuffer());
             }
             $mainframe->close();
         }
     }
     //Preload template
     t3import('core.preload');
     $preload = T3Preload::getInstance();
     $preload->load();
     //$doc = JFactory::getDocument();
     //$t3 = T3Template::getInstance($doc);
     //$t3->_html = $data;
     // Disable joomla cache when browsing by device
     $device = T3Common::mobile_device_detect();
     if ($device !== 'false') {
         $conf = JFactory::getConfig();
         $conf->set('caching', 0);
     }
     // Separate cache when browsing in each device
     /*
     $app = JFactory::getApplication();
     $registeredurlparams = $app->get('registeredurlparams');
     if (empty($registeredurlparams)) {
         $registeredurlparams = new stdClass;
     }
     $registeredurlparams->device = 'CMD';
     $app->set('registeredurlparams', $registeredurlparams);
     JRequest::setVar('device', T3Common::mobile_device_detect());
     */
 }
Ejemplo n.º 13
0
 /**
  * Sets an entire array of search paths for templates or resources.
  *
  * @param   string 		The type of path to set, typically 'template'.
  * @param   string|array	The new set of search paths.  If null or false, resets to the current directory only.
  */
 protected function _setPath($type, $path)
 {
     jimport('joomla.application.helper');
     $component = JApplicationHelper::getComponentName();
     $app = JFactory::getApplication();
     // Clear out the prior search dirs
     $this->_path[$type] = array();
     // Actually add the user-specified directories
     $this->_addPath($type, $path);
     // Always add the fallback directories as last resort
     switch (strtolower($type)) {
         case 'template':
             // Set the alternative template search dir
             if (isset($app)) {
                 $component = preg_replace('/[^A-Z0-9_\\.-]/i', '', $component);
                 $fallback = JPATH_THEMES . '/' . $app->getTemplate() . '/html/' . $component . '/' . $this->getName();
                 //if it is T3 template, update search path for template
                 if (T3Common::detect()) {
                     if (is_array($fallback1 = T3Path::getPath('html' . DS . $component . DS . $this->getName(), true))) {
                         $fallback = array_reverse($fallback1);
                     }
                 }
                 $this->_addPath('template', $fallback);
             }
             break;
     }
 }
Ejemplo n.º 14
0
 /**
  * Sets an entire array of search paths for templates or resources.
  *
  * @access protected
  * @param string $type The type of path to set, typically 'template'.
  * @param string|array $path The new set of search paths.  If null or
  * false, resets to the current directory only.
  */
 function _setPath($type, $path)
 {
     global $mainframe, $option;
     // clear out the prior search dirs
     $this->_path[$type] = array();
     // actually add the user-specified directories
     $this->_addPath($type, $path);
     // always add the fallback directories as last resort
     switch (strtolower($type)) {
         case 'template':
             // set the alternative template search dir
             if (isset($mainframe)) {
                 $option = preg_replace('/[^A-Z0-9_\\.-]/i', '', $option);
                 $fallback = JPATH_BASE . DS . 'templates' . DS . $mainframe->getTemplate() . DS . 'html' . DS . $option . DS . $this->getName();
                 //if it is T3 template, update search path for template
                 if (T3Common::detect()) {
                     if (is_array($fallback1 = T3Path::getPath('html' . DS . $option . DS . $this->getName(), true))) {
                         $fallback = array_reverse($fallback1);
                     }
                 }
                 $this->_addPath('template', $fallback);
             }
             break;
     }
 }
Ejemplo n.º 15
0
$this->genBlockEnd($this->getBlocksXML('middle'));
?>
	</div>
	<?php 
//Add fix height for main area
if (T3Common::node_attributes($this->getBlocksXML('middle'), 'fixheight')) {
    $this->showBlock('fixheight');
}
?>
	<!-- //MAIN CONTAINER -->

	<?php 
$blks =& $this->getBlocksXML('bottom');
$blocks =& T3Common::node_children($blks, 'block');
foreach ($blocks as $block) {
    if (T3Common::getBrowserSortName() == 'ie' && T3Common::getBrowserMajorVersion() == 7) {
        echo "<br class=\"clearfix\"/>";
    }
    $this->showBlock($block);
}
?>

</div>

<?php 
if ($this->isIE6()) {
    ?>
	<?php 
    $this->showBlock('ie6/ie6warning');
}
?>
Ejemplo n.º 16
0
 /**
  * Optimize css base on list css
  *
  * @param array $css_urls  List of css file
  *
  * @return array  List of optimized css file
  */
 public static function optimizecss($css_urls)
 {
     $content = '';
     $optimize_css = T3Parameter::_getParam('optimize_css', 2);
     if (!$optimize_css) {
         return $css_urls;
         //no optimize css
     }
     // # Fix when optimized_folder is un-writeable
     $cachepath = T3Path::path(T3Parameter::_getParam('optimize_folder', 't3-assets'));
     $cachepath .= DS . 'css';
     //$parentpath = dirname($cachepath);
     if (!T3Common::checkWriteable($cachepath)) {
         return $css_urls;
     }
     $output = array();
     $optimize_exclude = trim(T3Parameter::_getParam('optimize_exclude', ''));
     $optimize_exclude_regex = null;
     if ($optimize_exclude) {
         $optimize_exclude_regex = '#' . preg_replace('#[\\r\\n]+#', '|', preg_quote($optimize_exclude)) . '#';
     }
     $files = array();
     // # Check lock file before start checking update
     $lock_file = "optimize.js.lock";
     $waiting = T3Head::optimizeCheckLock($cachepath, $lock_file);
     $lock_file_file = null;
     $needupdate = false;
     $need_optimize = false;
     $required_optimize_list = array();
     $files_array = array();
     // Limit files import into a css file (in IE7, only first 30 css files are loaded). other case, load unlimited
     $filelimit = $optimize_css == 1 ? 20 : 999;
     $filecount = 0;
     jimport('joomla.filesystem.file');
     foreach ($css_urls as $theme => $urls) {
         foreach ($urls as $url) {
             $ignore = false;
             $import = false;
             $importupdate = false;
             // check ignore to optimize
             // - not a local file
             // - not a css file
             // - in ignore list
             if (!$url[0]) {
                 $ignore = true;
             } elseif (!preg_match('#\\.css$#', $url[0])) {
                 $ignore = true;
                 //ignore dynamic css file
             } elseif ($optimize_exclude_regex && preg_match($optimize_exclude_regex, $url[1])) {
                 $ignore = true;
             }
             if (!$ignore && $optimize_css > 1) {
                 //check if need update. for css, the cache should be [filename] or [filename]-import
                 //[filename]-import - for the case there's @import inside
                 //in the ignore of @import, file still optimize but will be put into a sigle file
                 $cfile = $cachepath . DS . 'css_' . md5($url[0]) . '.' . basename($url[0]);
                 if (!(file_exists($cfile) && @filemtime($url[0]) < @filemtime($cfile)) && !(file_exists($cfile . '-import') && @filemtime($url[0]) < @filemtime($cfile . '-import'))) {
                     $required_optimize_list[] = array('cfile' => $cfile, 'url0' => $url[0], 'url1' => $url[1]);
                     //Need update
                     $data = @JFile::read($url[0]);
                     if (preg_match('#@import\\s+.+#', $data)) {
                         $import = true;
                         $importupdate = true;
                         $cfile = $cfile . '-import';
                     }
                     $needupdate = true;
                     $need_optimize = true;
                 } elseif (is_file($cfile . '-import')) {
                     $import = true;
                     $importupdate = false;
                     $cfile = $cfile . '-import';
                 }
             }
             //match ignore file, or import file, or reach the limit: flush previous files out
             if ($ignore || $import || count($files) == $filelimit) {
                 if (count($files)) {
                     $files_array[] = array('files' => $files, 'needupdate' => $needupdate);
                 }
                 //reset the flag for file update
                 $needupdate = false;
                 $files = array();
             }
             //write out the @import file
             if ($ignore) {
                 //$output[] = $url;
                 // Ignore file however must follow by order
                 $files_array[] = array('files' => $url, 'ignore' => true);
             } else {
                 if ($optimize_css > 1) {
                     $files[] = array($cfile, '', $url[2]);
                 } else {
                     $files[] = $url;
                 }
             }
         }
     }
     if ($need_optimize) {
         //# Only create lock if and only if require optimize
         if (!T3Head::optimizeCreateLock($cachepath, $lock_file)) {
             return false;
         }
         foreach ($required_optimize_list as $required_optimize) {
             $data = T3Head::compresscss(@JFile::read($required_optimize['url0']), $required_optimize['url1']);
             if (preg_match('#@import\\s+.+#', $data)) {
                 $import = true;
                 $importupdate = true;
                 $required_optimize['cfile'] = $required_optimize['cfile'] . '-import';
             }
             if (JFile::exists($required_optimize['cfile'])) {
                 @JFile::delete($required_optimize['cfile']);
             }
             if (JFile::exists($required_optimize['cfile'] . '-import')) {
                 @JFile::delete($required_optimize['cfile'] . '-import');
             }
             @JFile::write($required_optimize['cfile'], $data);
             $needupdate = true;
         }
     }
     if (count($files)) {
         $files_array[] = array('files' => $files, 'needupdate' => $needupdate);
     }
     foreach ($files_array as $group_files) {
         // Check ignore file
         if (!isset($group_files['ignore'])) {
             $ourl = T3Head::store_file2($group_files['files'], 'css', $group_files['needupdate']);
             if (!$ourl) {
                 return $css_urls;
             }
             $output[] = array('', $ourl);
         } else {
             $output[] = $group_files['files'];
         }
     }
     // # Release lock
     T3Head::optimizeReleaseLock($cachepath, $lock_file);
     return array($output);
 }
Ejemplo n.º 17
0
 /**
  * Get class of body tag
  *
  * @return string
  */
 function getBodyClass()
 {
     // font class
     $cls = '';
     // body class from layout
     $layout = $this->getLayoutXML();
     if ($bd_cls = T3Common::node_attributes($layout, 'body-class')) {
         $cls .= $bd_cls;
     }
     // get custom class
     $custom_cls = T3Hook::_('custom_body_class');
     if ($custom_cls) {
         $cls .= " " . $custom_cls;
     }
     // make the font class to the last position
     $cls .= " " . 'fs' . $this->getParam(T3_TOOL_FONT, 3);
     // add component name to body class - should be used to override style
     // for some special components
     $option = JRequest::getCmd('option');
     if ($option) {
         $cls .= ' ' . $option;
     }
     // class added from _body_class
     $cls .= ' ' . implode(' ', $this->_body_class);
     // add class body-rtl incase it is rtl
     if ($this->isRTL()) {
         $cls .= ' body-rtl';
     }
     // add page class suffix class if exists
     // $menu = JSite::getMenu();
     $menu = JFactory::getApplication()->getMenu();
     $active = $menu->getActive();
     if ($active) {
         // $params = new JParameter($active->params);
         // Strict standards: Declaration of JParameter::loadSetupFile() should be compatible with that of JRegistry::loadSetupFile()
         $params = $active->params;
         if (!$active->params instanceof JRegistry) {
             $params = new JRegistry($active->params);
         }
         if ($params->get('pageclass_sfx')) {
             $cls .= ' body' . $params->get('pageclass_sfx');
         }
     }
     return trim($cls);
 }
Ejemplo n.º 18
0
 /**
  * Method to load JA's template positions
  *
  * @return  string
  */
 protected function joomlartPostionLoad()
 {
     $positions = array();
     $hasPositions = array();
     $jat3CommonFile = JPATH_ROOT . '/plugins/system/jat3/jat3/core/common.php';
     $templateName = $this->_template->element;
     if (file_exists($jat3CommonFile)) {
         jimport($jat3CommonFile);
         $jat3_engine_layout_path = JPATH_ROOT . '/templates/' . $templateName . '/etc/layouts/default.xml';
         $layout_info = T3Common::getXML($jat3_engine_layout_path);
         if (is_file($jat3_engine_layout_path)) {
             $layout_info = T3Common::getXML($jat3_engine_layout_path);
             foreach ($layout_info['children'] as $v) {
                 if ($v['name'] == 'blocks') {
                     foreach ($v['children'] as $block) {
                         if (!$block['data']) {
                             $position = (string) $block['attributes']['name'];
                             if (!in_array($position, $hasPositions)) {
                                 $_position = new stdClass();
                                 $_position->name = $position;
                                 $_position->params = array('style' => 'none');
                                 array_push($hasPositions, $position);
                                 array_push($positions, $_position);
                             }
                         } else {
                             $_l = explode(",", $block['data']);
                             foreach ($_l as $position) {
                                 $_position = new stdClass();
                                 $_position->name = $position;
                                 $_position->params = array('style' => 'none');
                                 array_push($hasPositions, $position);
                                 array_push($positions, $_position);
                             }
                         }
                     }
                 }
             }
         }
     }
     return $positions;
 }
Ejemplo n.º 19
0
 /**
  * Get active themes info
  *
  * @return array   Themes information
  */
 public static function get_active_themes_info()
 {
     $key = T3Cache::getThemeKey();
     $t3cache = T3Cache::getT3Cache();
     $themes_info = $t3cache->getObject($key);
     if ($themes_info && isset($themes_info['layout']) && $themes_info['layout']) {
         return $themes_info;
     }
     $themes = T3Common::get_active_themes();
     $themes[] = array('engine', 'default');
     $themes_info = null;
     foreach ($themes as $theme) {
         //$theme_info = T3Common::get_themes (implode('.', $theme));
         $theme_info = T3Common::get_theme_info($theme);
         if (!$theme_info) {
             continue;
         }
         if (!$themes_info) {
             $themes_info = $theme_info;
         } else {
             //merge info
             $themes_info = T3Common::merge_info($theme_info, $themes_info);
         }
     }
     //Get layout if tmpl is not component
     $themes_info['layout'] = null;
     $tmpl = JRequest::getCmd('tmpl');
     if ($tmpl != 'component') {
         $themes_info['layout'] = T3Common::get_layout_info();
     }
     $t3cache->storeObject($themes_info, $key);
     return $themes_info;
 }
Ejemplo n.º 20
0
 /**
  * Implement event onGetLayoutPath to return the layout which override by T3 & T3 templates
  * This event is fired by overriding ModuleHelper class
  * Return path to layout if found, false if not
  *
  * @param   string  $module  The name of the module
  * @param   string  $layout  The name of the module layout. If alternative
  *                           layout, in the form template:filename.
  *
  * @return  null
  */
 function onGetLayoutPath($module, $layout)
 {
     // Detect layout path in T3 themes
     if (T3Common::detect()) {
         $tPath = T3Path::getPath('html' . DS . $module . DS . $layout . '.php', false);
         if ($tPath) {
             return $tPath;
         }
     }
     return false;
 }
Ejemplo n.º 21
0
 * JA T3v2 System Plugin for J3.x
 * ------------------------------------------------------------------------
 * Copyright (C) 2004-2011 J.O.O.M Solutions Co., Ltd. All Rights Reserved.
 * @license - GNU/GPL, http://www.gnu.org/licenses/gpl.html
 * Author: J.O.O.M Solutions Co., Ltd
 * Websites: http://www.joomlart.com - http://www.joomlancers.com
 * ------------------------------------------------------------------------
 */
// No direct access
defined('_JEXEC') or die;
$language = JFactory::getLanguage();
$language->load('plg_system_jat3', JPATH_ADMINISTRATOR, 'en-GB', true);
//get reference of this block and update its no-wrap attribute
$block =& $this->getBlockXML(T3Common::node_attributes($block, 'name'), T3Common::node_attributes($block, 'parent', 'middle'));
T3Common::set_node_attributes($block, 'no-wrap', 1);
T3Common::set_node_attributes($block, 'no-main', 1);
if (!$this->getParam('option_layouts') && !$this->getParam('option_screen') && !$this->getParam('option_font') && !$this->getParam('option_themes') && !$this->getParam('option_direction') && !$this->getParam('option_menu')) {
    return;
}
?>
<div id="ja-cpanel-wrapper">
<div id="ja-cpanel">
    <div id="ja-cpanel-main">
        <div class="ja-cpanel-head clearfix">
            <a href="http://wiki.joomlart.com/wiki/JA_T3_Framework_2/Overview" class="first" title="About T3"><span>About</span></a>
            <a href="http://wiki.joomlart.com/wiki/JA_T3_Framework_2/Guides" title="Guides"><span>Guides</span></a>
            <a href="http://wiki.joomlart.com/wiki/JA_T3_Framework_2/FAQs" title="FAQs"><span>FAQs</span></a>
        </div>
        <div class="ja-cpanel-tools clearfix">
        <?php 
if ($this->getParam('option_font')) {
Ejemplo n.º 22
0
 function get_active_themes_info()
 {
     global $mainframe;
     //$key = T3Parameter::getKey ('themes-info',2);
     $key = T3Cache::getThemeKey();
     $themes_info = T3Cache::get_object($key);
     //force cache
     if ($themes_info && isset($themes_info['layout']) && $themes_info['layout']) {
         return $themes_info;
     }
     $themes = T3Common::get_active_themes();
     $themes[] = array('engine', 'default');
     $themes_info = null;
     foreach ($themes as $theme) {
         //$theme_info = T3Common::get_themes (implode('.', $theme));
         $theme_info = T3Common::get_theme_info($theme);
         if (!$theme_info) {
             continue;
         }
         if (!$themes_info) {
             $themes_info = $theme_info;
         } else {
             //merge info
             $themes_info = T3Common::merge_info($theme_info, $themes_info);
         }
     }
     //Get layout if tmpl is not component
     $themes_info['layout'] = null;
     $tmpl = JRequest::getCmd('tmpl');
     if ($tmpl != 'component') {
         $themes_info['layout'] = T3Common::get_layout_info();
     }
     T3Cache::store_object($themes_info, $key);
     return $themes_info;
 }
Ejemplo n.º 23
0
/*
# ------------------------------------------------------------------------
# JA T3v2 Plugin - Template framework for Joomla 1.5
# ------------------------------------------------------------------------
# Copyright (C) 2004-2010 JoomlArt.com. All Rights Reserved.
# @license - GNU/GPL V2, http://www.gnu.org/licenses/gpl2.html. For details 
# on licensing, Please Read Terms of Use at http://www.joomlart.com/terms_of_use.html.
# Author: JoomlArt.com
# Websites: http://www.joomlart.com - http://www.joomlancers.com.
# ------------------------------------------------------------------------
*/
$modules = preg_split('/,/', T3Common::node_data($block));
$parent = T3Common::node_attributes($block, 'parent', 'middle');
$style = $this->getBlockStyle($block, $parent);
if (!$this->countModules(T3Common::node_data($block))) {
    return;
}
foreach ($modules as $module) {
    if ($this->countModules($module)) {
        ?>
		<jdoc:include type="module" name="<?php 
        echo $module;
        ?>
" style="<?php 
        echo $style;
        ?>
" />		
<?php 
    }
}
Ejemplo n.º 24
0
 /**
  * Constructor
  *
  * @param array &$params  Parameters
  *
  * @return void
  */
 function __construct(&$params)
 {
     $this->_params = $params;
     $this->Itemid = T3Common::getItemid();
     //$this->loadMenu();
 }
Ejemplo n.º 25
0
}
$component = JComponentHelper::getComponent(JEV_COM_COMPONENT);
$component->params =& $newparams;
$isMobile = $browser->isMobile();
// Joomla isMobile method doesn't identify all android phones
if (!$isMobile && isset($_SERVER['HTTP_USER_AGENT'])) {
    if (stripos($_SERVER['HTTP_USER_AGENT'], 'android') > 0 || stripos($_SERVER['HTTP_USER_AGENT'], 'blackberry') > 0) {
        $isMobile = true;
    } else {
        if (stripos($_SERVER['HTTP_USER_AGENT'], 'iphone') > 0 || stripos($_SERVER['HTTP_USER_AGENT'], 'ipod') > 0) {
            $isMobile = true;
        }
    }
}
$params = JComponentHelper::getParams(JEV_COM_COMPONENT);
if ($isMobile || strpos(JFactory::getApplication()->getTemplate(), 'mobile_') === 0 || class_exists("T3Common") && class_exists("T3Parameter") && T3Common::mobile_device_detect() || JRequest::getVar("jEV", "") == "smartphone") {
    if (!$params->get("disablesmartphone")) {
        JRequest::setVar("jevsmartphone", 1);
        if (JFolder::exists(JEV_VIEWS . "/smartphone")) {
            JRequest::setVar("jEV", "smartphone");
        }
        $params->set('iconicwidth', 485);
        $params->set('extpluswidth', 485);
        $params->set('ruthinwidth', 485);
    }
}
// See http://www.php.net/manual/en/timezones.php
$tz = $params->get("icaltimezonelive", "");
if ($tz != "" && is_callable("date_default_timezone_set")) {
    $timezone = date_default_timezone_get();
    date_default_timezone_set($tz);
Ejemplo n.º 26
0
?>
;
</script>

<jdoc:include type="head" />

<?php 
if (T3Common::mobile_device_detect() == 'iphone') {
    ?>
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1; user-scalable=1;" />
<meta name="apple-touch-fullscreen" content="YES" />
<?php 
}
?>

<?php 
if (T3Common::mobile_device_detect()) {
    ?>
<meta name="HandheldFriendly" content="true" />
<?php 
}
?>

<link href="<?php 
echo T3Path::getUrl('images/favicon.ico');
?>
" rel="shortcut icon" type="image/x-icon" />

<?php 
JHTML::stylesheet('templates/system/css/system.css');
JHTML::stylesheet('templates/system/css/general.css');
Ejemplo n.º 27
0
 /**
  * Get theme key from active layout & active themes
  *
  * @return mixed   NULL if devmode or keycode string
  */
 public static function getThemeKey()
 {
     $t3cache = T3Cache::getT3Cache();
     if ($t3cache->_devmode) {
         return null;
     }
     //no cache in devmode
     $themes = T3Common::get_active_themes();
     $layout = T3Common::get_active_layout();
     $string = 'theme-infos-' . $layout;
     if (is_array($themes)) {
         $string .= serialize($themes);
     }
     return $string;
 }
Ejemplo n.º 28
0
 * ------------------------------------------------------------------------
 * Copyright (C) 2004-2011 J.O.O.M Solutions Co., Ltd. All Rights Reserved.
 * @license - Copyrighted Commercial Software
 * Author: J.O.O.M Solutions Co., Ltd
 * Websites:  http://www.joomlart.com -  http://www.joomlancers.com
 * This file may not be redistributed in whole or significant part.
 * ------------------------------------------------------------------------
 */
// No direct access
defined('_JEXEC') or die;
//$spotlight = array ('user1','user2','user3','user4','user5');
$spotlight = preg_split('/,/', T3Common::node_data($block));
$name = T3Common::node_attributes($block, 'name');
$special = T3Common::node_attributes($block, 'special');
$specialwidth = T3Common::node_attributes($block, 'specialwidth');
$totalwidth = T3Common::node_attributes($block, 'totalwidth', 100);
$style = $this->getBlockStyle($block);
$botsl = $this->calSpotlight($spotlight, $totalwidth, $specialwidth, $special);
if ($botsl) {
    ?>

<!-- SPOTLIGHT -->
<?php 
    foreach ($spotlight as $pos) {
        if ($this->countModules($pos)) {
            ?>
<div class="ja-box-wrap column ja-box<?php 
            echo $botsl[$pos]['class'];
            ?>
" style="width: <?php 
            echo $botsl[$pos]['width'];
Ejemplo n.º 29
0
<?php

/*
# ------------------------------------------------------------------------
# JA T3v2 Plugin - Template framework for Joomla 1.5
# ------------------------------------------------------------------------
# Copyright (C) 2004-2010 JoomlArt.com. All Rights Reserved.
# @license - GNU/GPL V2, http://www.gnu.org/licenses/gpl2.html. For details 
# on licensing, Please Read Terms of Use at http://www.joomlart.com/terms_of_use.html.
# Author: JoomlArt.com
# Websites: http://www.joomlart.com - http://www.joomlancers.com.
# ------------------------------------------------------------------------
*/
if (!($mobile = T3Common::mobile_device_detect())) {
    return;
}
$handheld_view = $this->getParam('ui');
$switch_to = $handheld_view == 'desktop' ? 'default' : 'desktop';
$text = $handheld_view == 'desktop' ? 'Mobile Version' : 'Desktop Version';
?>

<a class="ja-tool-switchlayout" href="<?php 
echo JURI::base();
?>
?ui=<?php 
echo $switch_to;
?>
" title="<?php 
echo JText::_($text);
?>
"><span><?php 
Ejemplo n.º 30
0
<?php

/*
# ------------------------------------------------------------------------
# JA T3v2 Plugin - Template framework for Joomla 1.5
# ------------------------------------------------------------------------
# Copyright (C) 2004-2010 JoomlArt.com. All Rights Reserved.
# @license - GNU/GPL V2, http://www.gnu.org/licenses/gpl2.html. For details 
# on licensing, Please Read Terms of Use at http://www.joomlart.com/terms_of_use.html.
# Author: JoomlArt.com
# Websites: http://www.joomlart.com - http://www.joomlancers.com.
# ------------------------------------------------------------------------
*/
$layouts = T3Common::get_layouts();
$currlayouts = preg_split('/,/', $this->getParam('layouts'));
if (count($layouts) < 2) {
    return;
}
?>

<h3><?php 
echo JText::_('Layout');
?>
</h3>

<div class="ja-box-usertools">
  <ul class="ja-usertools-layout clearfix">
  <?php 
foreach ($layouts as $layout) {
    if (preg_match('#-rtl$#', $layout)) {
        continue;