示例#1
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;
 }
示例#2
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)) {
示例#3
0
 /**
  * Get layout infomation
  *
  * @param string $layout  Layout name
  *
  * @return array  Layout info
  */
 public static function get_layout_info($layout = '')
 {
     static $layout_infos = array();
     $params = T3Common::get_template_params();
     $device = T3Common::mobile_device_detect();
     if (!$layout || !T3Common::layout_exists($layout)) {
         $layout = T3Common::get_active_layout();
     }
     if (!isset($layout_infos[$layout])) {
         $layout_infos[$layout] = null;
         $active_layout_path = T3Common::layout_exists($layout);
         $engine_layout_path = '';
         $layout_info = null;
         if (is_file($active_layout_path)) {
             $layout_info = T3Common::getXML($active_layout_path);
         }
         // Detect engine layout to extend
         // If the layout property device is set, get the default engine layout by this property
         // If not found - get the engine layout by $device
         $basepath = T3Path::path(T3_BASETHEME) . DS . 'etc' . DS . 'layouts';
         $layout_device = T3Common::node_attributes($layout_info, 'device', $device);
         $engine_layout_path = $basepath . DS . $layout_device . '.xml';
         if (!is_file($engine_layout_path)) {
             if (!$device) {
                 $engine_layout_path = $basepath . DS . 'default.xml';
             } else {
                 $engine_layout_path = $basepath . DS . $device . '.xml';
                 if (!is_file($engine_layout_path)) {
                     $engine_layout_path = $basepath . DS . 'handheld.xml';
                 }
             }
         }
         $engine_layout_path_temp = T3Common::getXML($engine_layout_path);
         if ($engine_layout_path != $active_layout_path && is_file($engine_layout_path)) {
             $layout_info = $layout_info ? T3Common::merge_info($engine_layout_path_temp, $layout_info) : T3Common::getXML($engine_layout_path);
         }
         $layout_infos[$layout] = $layout_info;
     }
     return $layout_infos[$layout];
 }
示例#4
0
 function get_layout_info($layout = '')
 {
     static $layout_infos = array();
     $params = T3Common::get_template_params();
     $device = T3Common::mobile_device_detect();
     if (!$layout || !T3Common::layout_exists($layout)) {
         $layout = T3Common::get_active_layout();
     }
     if (!isset($layout_infos[$layout])) {
         $layout_infos[$layout] = null;
         $active_layout_path = T3Common::layout_exists($layout);
         $engine_layout_path = '';
         //detect engine layout to extend
         //check the layout with the same name in engine
         //if not found - check the layout base on the device
         $engine_layout_path = T3Path::path(T3_BASETHEME) . DS . 'etc' . DS . 'layouts' . DS . $layout . '.xml';
         if (!is_file($engine_layout_path)) {
             if (!$device) {
                 $engine_layout_path = T3Path::path(T3_BASETHEME) . DS . 'etc' . DS . 'layouts' . DS . 'default.xml';
             } else {
                 $engine_layout_path = T3Path::path(T3_BASETHEME) . DS . 'etc' . DS . 'layouts' . DS . $device . '.xml';
                 if (!is_file($engine_layout_path)) {
                     $engine_layout_path = T3Path::path(T3_BASETHEME) . DS . 'etc' . DS . 'layouts' . DS . 'handheld.xml';
                 }
             }
         }
         $layout_info = null;
         if (is_file($active_layout_path)) {
             $layout_info = T3Common::getXML($active_layout_path);
         }
         if ($engine_layout_path != $active_layout_path && is_file($engine_layout_path)) {
             $layout_info = $layout_info ? T3Common::merge_info(T3Common::getXML($engine_layout_path), $layout_info) : T3Common::getXML($engine_layout_path);
         }
         $layout_infos[$layout] = $layout_info;
     }
     return $layout_infos[$layout];
 }