/** * Method to get the field input markup. * * @return string The field input markup. */ function getInput() { t3import('core.admin.util'); $uri = str_replace(DS, "/", str_replace(JPATH_SITE, JURI::base(), dirname(__FILE__))); $uri = str_replace("/administrator", "", $uri); if (!defined('_JA_THEME')) { define('_JA_THEME', 1); $html = "<link href=\"{$uri}/assets/css/jathemesettings.css\" rel=\"stylesheet\" type=\"text/css\" />\n"; $html .= "<script type=\"text/javascript\" src=\"{$uri}/assets/js/jathemesettings.js\"></script>\n"; echo $html; } $objutil = new JAT3_AdminUtil(); $template = $objutil->template; $themes = $objutil->getThemes($template); $value = $this->value; $name = $this->fieldname; if ($value && $themes) { if ((!isset($themes['core']) || isset($themes['core']) && !in_array($value, $themes['core'])) && (!isset($themes['local']) || isset($themes['local']) && !in_array($value, $themes['local']))) { $value = isset($themes['local'][0]) ? $themes['local'][0] : $themes['core'][0]; } } $layout = dirname(__FILE__) . DS . 'tmpl' . DS . 'jathemesettings.php'; if (file_exists($layout)) { ob_start(); include $layout; $content = ob_get_clean(); return $content; } return ''; }
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; }
/** * Method to get the field input markup. * * @return string The field input markup. */ function getInput() { t3import('core.admin.util'); $objutil = new JAT3_AdminUtil(); $template = $objutil->template; $layouts = $objutil->buildHTML_Layout($this->value, $this->name); return $layouts; }
/** * Method to get the field input markup. * * @return string The field input markup. */ function getInput() { t3import('core.admin.util'); $uri = str_replace(DS, "/", str_replace(JPATH_SITE, JURI::base(), dirname(__FILE__))); $uri = str_replace("/administrator", "", $uri); // Import css/js if (!defined('_GFONTS_ADDED')) { define('_GFONTS_ADDED', 1); echo "<link href=\"{$uri}/assets/css/Autocompleter.css\" rel=\"stylesheet\" type=\"text/css\" />\n"; echo "<link href=\"{$uri}/assets/css/gfonts.css\" rel=\"stylesheet\" type=\"text/css\" />\n"; echo "<script type=\"text/javascript\" src=\"{$uri}/assets/js/autocompleter/Observer.js\"></script>\n"; echo "<script type=\"text/javascript\" src=\"{$uri}/assets/js/autocompleter/Autocompleter.js\"></script>\n"; echo "<script type=\"text/javascript\" src=\"{$uri}/assets/js/autocompleter/Autocompleter.Request.js\"></script>\n"; echo "<script type=\"text/javascript\" src=\"{$uri}/assets/js/gfonts.js\"></script>\n"; $layout = dirname(__FILE__) . DS . 'tmpl' . DS . 'gfonts.php'; if (file_exists($layout)) { ob_start(); include $layout; $content = ob_get_contents(); ob_end_clean(); echo $content; } } $eid = $this->id; $ename = $this->name; $template = T3_ACTIVE_TEMPLATE; $lists = ''; $lists .= "<div class=\"gfont-panel\">"; $lists .= " <span id=\"{$eid}-edit\" class=\"ja-gfont-edit\"> </span>"; $lists .= " <span id=\"{$eid}-family\" class=\"ja-gfont-family\"></span> "; $lists .= " <span id=\"{$eid}-info\" class=\"ja-gfont-info\" ></span>"; $lists .= " <span id=\"{$eid}-custom\" class=\"ja-gfont-custom\" ></span> "; $lists .= '</div>'; $lists .= "<input type=\"hidden\" id=\"{$eid}\" name=\"{$ename}\" value=\"{$this->value}\" rel=\"gfonts\" />\n"; return $lists; }
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()); */ }
/** * Get browser major version * * @return string */ public static function getBrowserMajorVersion() { if (!class_exists('Browser')) { t3import('core.libs.browser'); } $browser = new Browser(); $bver = explode('.', $browser->getVersion()); return $bver[0]; //Major version only }
function onAfterRoute() { t3import('core.framework'); $app = JFactory::getApplication('administrator'); if ($app->isAdmin()) { t3import('core.admin.util'); //Clean cache if there's something changed backend if (JRequest::getCmd('jat3action') || in_array(JRequest::getCmd('task'), array('save', 'delete', 'remove', 'apply', 'publish', 'unpublish'))) { if (JRequest::getCmd('jat3action')) { //if template parameter updated => clear cache t3_import('core/cache'); T3Cache::clean(2); } else { $params = T3Common::get_template_based_params(); $cache = $params->get('cache'); if ($cache) { //if other update: clear cache if cache is enabled t3_import('core/cache'); T3Cache::clean(1); } } } if (JAT3_AdminUtil::checkPermission()) { if (JAT3_AdminUtil::checkCondition_for_Menu()) { JHTML::stylesheet('', JURI::root() . T3_CORE . '/element/assets/css/japaramhelper.css'); JHTML::script('', JURI::root() . T3_CORE . '/element/assets/js/japaramhelper.js', true); } if (JRequest::getCmd('jat3type') == 'plugin') { $action = JRequest::getCmd('jat3action'); t3import('core.ajax'); $obj = new JAT3_Ajax(); if ($action && method_exists($obj, $action)) { $obj->{$action}(); } return; } if (!T3Common::detect()) { return; } JAT3_AdminUtil::loadStyle(); JAT3_AdminUtil::loadScipt(); return; } elseif (JRequest::getCmd('jat3type') == 'plugin') { $result['error'] = 'Session has expired. Please login before continuing.'; echo json_encode($result); exit; } return; } if (!$app->isAdmin() && T3Common::detect()) { $action = JRequest::getCmd('jat3action'); //process request ajax like action - public if ($action) { t3import('core.ajaxsite'); if (method_exists('T3AjaxSite', $action)) { T3AjaxSite::$action(); $app->close(); //exit after finish action } } //load core library T3Framework::t3_init($this->plgParams); //Init T3Engine //get list templates $themes = T3Common::get_active_themes(); $path = T3Path::getInstance(); //path in t3 engine //active themes path if ($themes && count($themes)) { foreach ($themes as $theme) { $path->addPath($theme[0] . '.' . $theme[1], T3Path::path(T3_TEMPLATE) . DS . $theme[0] . DS . 'themes' . DS . $theme[1], T3Path::url(T3_TEMPLATE) . "/{$theme[0]}/themes/{$theme[1]}"); } } //add default & base theme path //if isRTL, auto add rtl theme if (T3Common::isRTL() && is_dir(T3Path::path(T3_TEMPLATE_CORE . '/themes/default-rtl'))) { $path->addPath('core.default-rtl', T3Path::path(T3_TEMPLATE_CORE . '/themes/default-rtl'), T3Path::url(T3_TEMPLATE_CORE . '/themes/default-rtl')); } $path->addPath('template.default', T3Path::path(T3_TEMPLATE), T3Path::url(T3_TEMPLATE)); if (T3Common::isRTL() && is_dir(T3Path::path(T3_BASETHEME . '-rtl'))) { $path->addPath('engine.default-rtl', T3Path::path(T3_BASETHEME . '-rtl'), T3Path::url(T3_BASETHEME . '-rtl')); } $path->addPath('engine.default', T3Path::path(T3_BASETHEME), T3Path::url(T3_BASETHEME)); T3Framework::init_layout(); } }
<?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; t3import('core.libs.browser'); $browser = new Browser(); if (!$browser->isMobile()) { 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
<?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; t3import('core.define'); /** * T3Preload class * * @package JAT3.Core */ class T3Preload extends JObject { var $_devmode = 0; var $data = array(); /** * Constructor * * @return void */ function __construct() {
/** * Clear cache * * @return void */ function clearCache() { // Clean cache t3import('core.cache'); T3Cache::clean(10); echo JText::_('T3 Cache is cleaned!'); exit; }
/** * Compress js file * * @param string $data JS data * @param string $url JS URL * * @return string Compressed js data */ public static function compressjs($data, $url) { $optimize_js = T3Parameter::_getParam('optimize_js', 1); if ($optimize_js < 2) { return $data; //no compress } //compress using jsmin t3import('core.libs.jsmin'); return JSMin::minify($data); }
function getBrowserMajorVersion() { t3import('core.libs.Browser'); $browser = new Browser(); $bver = explode('.', $browser->getVersion()); return $bver[0]; //Major version only }
function getKey($name, $level = 10) { //$uri = JURI::getInstance(); //$string = $uri->getQuery(); $string = $name; if ($level > 0) { $string .= JRequest::getURI(); } if ($level > 1) { $params = T3Parameter::getInstance(); $string .= T3_TOOL_THEMES . "=" . $params->getParam(T3_TOOL_THEMES); $string .= T3_TOOL_LAYOUTS . "=" . $params->getParam(T3_TOOL_LAYOUTS); } if ($level > 2) { t3import('core.libs.Browser'); $browser = new Browser(); $string .= $browser->getBrowser() . ":" . $browser->getVersion(); } if ($level > 3) { $params = T3Parameter::getInstance(); foreach ($params->_params_cookie as $k => $v) { $string .= $k . "=" . $v; } } return md5($string); }
<?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; t3import('core.admin.util'); $obj = new JAT3_AdminUtil(); // Check template use old or new folder structure $isNewFolderStruct = $obj->checkUseNewFolderStructure(); $uri = str_replace(DS, "/", str_replace(JPATH_SITE, JURI::base(), dirname(__FILE__))); $uri = str_replace("/administrator", "", $uri); $template = $obj->template; $name = 'pages_profile'; $profiles = $obj->getProfiles(); $pageids = $obj->getPageIds($name); $langlist = $obj->getLanguageList(); jimport('joomla.filesystem.file'); $jsonData = $profiles; $configfile = dirname(__FILE__) . DS . 'config.xml'; if (file_exists($configfile)) { /* For General Tab */ $generalconfig = $obj->getGeneralConfig();
* Decode JSON to string * * @param string $str JSON string * * @return string Decoded string */ function json_decode($str) { //make a new json parser $json = new Services_JSON(); return $json->decode($str); } } if (!function_exists('json_encode')) { if (!class_exists('Services_JSON')) { t3import('core.libs.json'); } /** * Encode string to JSON * * @param string $var String * * @return string JSON string */ function json_encode($var) { //make a new json parser $json = new Services_JSON(); return $json->encode($var); } }
/** * Implement after route event * * @return null */ function onAfterRoute() { // Load t3 language file for front-end & template admin. //$this->loadLanguage(null, JPATH_ADMINISTRATOR); //this language should be loaded by joomla $lang = JFactory::getLanguage(); $lang->load('plg_system_jat3', JPATH_ADMINISTRATOR); t3import('core.framework'); $app = JFactory::getApplication('administrator'); if ($app->isAdmin()) { t3import('core.admin.util'); // Clean cache if there's something changed backend if (JRequest::getCmd('jat3action') || in_array(JRequest::getCmd('task'), array('save', 'delete', 'remove', 'apply', 'publish', 'unpublish'))) { if (JRequest::getCmd('jat3action')) { //if template parameter updated => clear cache t3import('core.cache'); T3Cache::clean(2); } else { $params = T3Common::get_template_based_params(); $cache = $params->get('cache'); if ($cache) { //if other update: clear cache if cache is enabled t3import('core.cache'); T3Cache::clean(1); } } } if (JAT3_AdminUtil::checkPermission()) { if (JAT3_AdminUtil::checkCondition_for_Menu()) { JHTML::stylesheet(JURI::root() . T3_CORE . '/element/assets/css/japaramhelper.css'); JHTML::script(JURI::root() . T3_CORE . '/element/assets/js/japaramhelper.js', true); } if (JRequest::getCmd('jat3type') == 'plugin') { $action = JRequest::getCmd('jat3action'); t3import('core.ajax'); $obj = new JAT3_Ajax(); if ($action && method_exists($obj, $action)) { jimport('joomla.filesystem.folder'); jimport('joomla.filesystem.file'); $obj->{$action}(); } return; } //Load moontools library JHtml::_('behavior.framework'); if (!T3Common::detect()) { return; } JAT3_AdminUtil::loadStyle(); JAT3_AdminUtil::loadScipt(); return; } elseif (JRequest::getCmd('jat3type') == 'plugin') { $result['error'] = 'Session has expired. Please login before continuing.'; echo json_encode($result); exit; } return; } if (!$app->isAdmin() && T3Common::detect()) { $action = JRequest::getCmd('jat3action'); // Process request ajax like action - public if ($action) { t3import('core.ajaxsite'); if (method_exists('T3AjaxSite', $action)) { T3AjaxSite::$action(); $app->close(); //exit after finish action } } // Load core library T3Framework::t3_init($this->plgParams); // Init T3Engine // Get list templates $themes = T3Common::get_active_themes(); $path = T3Path::getInstance(); // Path in t3 engine // Active themes path if ($themes && count($themes)) { foreach ($themes as $theme) { if ($theme[0] == 'engine') { $path->addPath($theme[0] . '.' . $theme[1], T3Path::path(T3_BASE . '/base-themes/' . $theme[1]), T3Path::url(T3_BASE . '/base-themes/' . $theme[1])); } elseif ($theme[0] == 'template') { $path->addPath($theme[0] . '.' . $theme[1], T3Path::path(T3_TEMPLATE), T3Path::url(T3_TEMPLATE)); } else { $themepath = T3Path::path(T3_TEMPLATE) . DS . 'themes'; // Check if template use newest folder structure or not // If themes folder is exists in template folder, consider as template use newst folder structure if (@is_dir($themepath)) { $path->addPath($theme[0] . '.' . $theme[1], T3Path::path(T3_TEMPLATE) . DS . 'themes' . DS . $theme[1], T3Path::url(T3_TEMPLATE) . "/themes/{$theme[1]}"); } else { // Compatible: if template use older folder structure, try to use it $path->addPath($theme[0] . '.' . $theme[1], T3Path::path(T3_TEMPLATE) . DS . $theme[0] . DS . 'themes' . DS . $theme[1], T3Path::url(T3_TEMPLATE) . "/{$theme[0]}/themes/{$theme[1]}"); } } } } // Disable editor if website is access by iphone & handheld $device = T3Common::mobile_device_detect(); if ($device == 'iphone' || $device == 'handheld') { $config = JFactory::getConfig(); $config->set('editor', 'none'); } T3Framework::init_layout(); } }
<?php defined('ARI_FRAMEWORK_LOADED') or die('Direct Access to this location is not allowed.'); if (function_exists('t3import')) t3import('core.joomla.modulehelper'); else if (!class_exists('JModuleHelper')) jimport('joomla.application.module.helper'); $version = new JVersion(); $j15 = version_compare($version->getShortVersion(), '1.6.0', '<'); if ($j15) AriKernel::import('Module.j15.ModuleHelper'); else AriKernel::import('Module.j16.ModuleHelper'); ?>