function fetchElement($name, $value, &$node, $control_name) { t3_import('core/admin/util'); if (!defined('_JA_THEME')) { define('_JA_THEME', 1); $uri = str_replace(DS, "/", str_replace(JPATH_SITE, JURI::base(), dirname(__FILE__))); $uri = str_replace("/administrator", "", $uri); JHTML::stylesheet('jathemesettings.css', $uri . "/assets/css/"); JHTML::script('jathemesettings.js', $uri . "/assets/js/"); } $objutil = new JAT3_AdminUtil(); $template = $objutil->get_active_template(); $themes = $objutil->getThemes($template); 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']) ? $themes['local'][0] : $themes['core'][0]; } } $layout = dirname(__FILE__) . DS . 'tmpl' . DS . 'jathemesettings.php'; if (file_exists($layout)) { ob_start(); require $layout; $content = ob_get_clean(); return $content; } return ''; }
/** * Method to get the field input markup. * * @return string The field input markup. */ function getInput() { t3_import('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 ''; }
/** * Method to get the field input markup. * * @return string The field input markup. */ function getInput() { t3_import('core/admin/util'); $objutil = new JAT3_AdminUtil(); $template = $objutil->template; $layouts = $objutil->buildHTML_Layout($this->value, $this->name); return $layouts; }
/** * Determite active template is T3 template or not * * @param string $template Template name * * @return bool True if T3 template otherwise False */ function detect($template = '') { t3_import('core/framework'); if (!$template) { $template = T3_ACTIVE_TEMPLATE; } $path = T3Path::path(T3_TEMPLATE) . DS . 'info.xml'; return is_file($path); }
function fetchElement($name, $value, &$node, $control_name) { t3_import('core/admin/util'); $uri = str_replace(DS, "/", str_replace(JPATH_SITE, JURI::base(), dirname(__FILE__))); $uri = str_replace("/administrator", "", $uri); $objutil = new JAT3_AdminUtil(); $template = $objutil->get_active_template(); $layouts = $objutil->buildHTML_Layout($value, $name); return $layouts; }
public function fetchElement($name, $value, &$node, $control_name) { // Check for the T3 framework if (!function_exists('t3_import')) { return '- No configuration needed -'; } // Add the control name if (!empty($control_name)) { $name = $control_name . '[' . $name . ']'; } t3_import('core/admin/util'); $adminutil = new JAT3_AdminUtil(); $template = $adminutil->get_active_template(); $layouts = $adminutil->getLayouts(); foreach ($layouts as $layoutIndex => $layoutObject) { $options[] = array('value' => $layoutIndex, 'label' => $layoutIndex); } return JHTML::_('select.genericlist', $options, $name, null, 'value', 'label', $value); }
function fetchElement($name, $value, &$node, $control_name) { t3_import('core/admin/util'); $uri = str_replace(DS, "/", str_replace(JPATH_SITE, JURI::base(), dirname(__FILE__))); $uri = str_replace("/administrator", "", $uri); $gfont_group = array('latin' => array('Droid Sans', 'Droid Serif', 'Lobster', 'Yanone Kaffeesatz', 'Nobile', 'Reenie Beanie', 'Tangerine', 'Neucha', 'Josefin Slab', 'OFL Sorts Mill Goudy TT', 'Molengo', 'PT Sans', 'Vollkorn', 'Just Me Again Down Here', 'Ubuntu', 'Cantarell', 'Inconsolata', 'Crimson Text', 'Cardo', 'Cuprum', 'Droid Sans Mono', 'Neuton', 'Arvo', 'Philosopher', 'Old Standard TT', 'Josefin Sans', 'Covered By Your Grace', 'Arimo', 'IM Fell', 'Geo', 'Copse', 'Raleway', 'Allerta', 'Just Another Hand', 'Tinos', 'Puritan', 'Mountains of Christmas', 'Cabin', 'Sniglet', 'Allan', 'Lato', 'Orbitron', 'Vibur', 'Gruppo', 'Allerta Stencil', 'Cousine', 'Syncopate', 'Merriweather', 'Kristi', 'Anonymous Pro', 'Coda', 'Corben', 'Buda', 'Bentham', 'Lekton', 'UnifrakturMaguntia', 'UnifrakturCook', 'Kenia', 'Rock Salt', 'Calligraffitti', 'Cherry Cream Soda', 'Chewy', 'Coming Soon', 'Crafty Girls', 'Crushed', 'Fontdiner Swanky', 'Homemade Apple', 'Irish Growler', 'Kranky', 'Luckiest Guy', 'Permanent Marker', 'Schoolbell', 'Slackey', 'Sunshiney', 'Unkempt', 'Walter Turncoat'), 'Cyrillic' => array('Anonymous Pro', 'Cuprum', 'Neucha', 'PT Sans', 'Philosopher', 'Ubuntu'), 'Greek' => array('GFS Didot', 'GFS Neohellenic', 'Ubuntu', 'Anonymous Pro'), 'Khmer' => array('Hanuman')); //embed google fonts if (!defined('_GFONTS_ADDED')) { define('_GFONTS_ADDED', 1); echo "<script type=\"text/javascript\">window.addEvent('load', function() {new Asset.css ('http://code.google.com/webfonts/css?kit=fRn5xRji3KlvfYTK4F2Aig');});</script>"; echo "<script type=\"text/javascript\" src=\"{$uri}/assets/js/gfonts.js\"></script>\n"; } $eid = $control_name . $name; $ename = $control_name . '[' . $name . ']'; $lists = ""; $lists .= "<select id=\"{$eid}.font\" name=\"{$eid}.font\" class=\"inputbox\">\n"; if (in_array($name, array('gfont_logo', 'gfont_slogan'))) { $lists .= "<option value=\"\">--- Select if logo type is text ---</option>\n"; } else { $lists .= "<option value=\"\">--- Not applied ---</option>\n"; } foreach ($gfont_group as $group => $gfonts) { $lists .= "<optgroup label=\"{$group}\">\n"; foreach ($gfonts as $gfont) { $selected = $value == $gfont ? "selected=\"selected\"" : ""; $lists .= "<option style=\"font-family: '{$gfont}::Menu';font-size:2em;\" value=\"{$gfont}\" {$selected}>{$gfont}</option>\n"; } $lists .= "</optgroup>\n"; } $lists .= "</select>\n"; //checkbox $lists .= "<input type=\"checkbox\" id=\"{$eid}.extra\" name=\"{$eid}.extra\" onclick=\"gfonts_showhideextra('{$eid}');\" \" />\n"; $lists .= "<label for=\"{$eid}.extra\" class=\"editlinktip hasTip\" title=\"" . JText::_('Custom CSS Desc') . "\">" . JText::_('Custom CSS') . "</label>"; //textarea, the extra property - hide by default. show when extra field is checked $lists .= "<textarea id=\"{$eid}.style\" cols=\"40\" rows=\"5\" name=\"{$eid}.style\" class=\"clearfix\" style=\"display:none; margin-top: 5px; clear: both; \"></textarea>\n"; $lists .= "<input type=\"hidden\" id=\"{$eid}\" name=\"{$ename}\" value=\"{$value}\" rel=\"gfonts\" />\n"; return $lists; }
/** * Method to get the field input markup. * * @return string The field input markup. */ function getInput() { t3_import('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 clearCache() { //clean cache t3_import('core/cache'); T3Cache::clean(10); //clear all cache echo JText::_('T3 Cache is cleaned!'); exit; }
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(); } }
}).inject(span); bttclear.setText('JAT3 Clean Cache'); } }) </script> <?php } } if (!function_exists('json_decode')) { if (!class_exists('Services_JSON')) { t3_import('core/libs/JSON'); } 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')) { t3_import('core/libs/JSON'); } function json_encode($var) { //make a new json parser $json = new Services_JSON(); return $json->encode($var); } }
<?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; t3_import('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();
/** * Implement after route event * * @return null */ function onAfterRoute() { // Load t3 language file for front-end & template admin. $this->loadLanguage(null, 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 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; } //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(); } }