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 '';
 }
Esempio n. 2
0
 /**
  * Get template name is being actived
  *
  * @return string   Template name
  */
 public static function get_active_template()
 {
     $mainframe = JFactory::getApplication();
     if ($mainframe->isAdmin()) {
         t3import('core.admin.util');
         return strtolower(JAT3_AdminUtil::get_active_template());
     }
     return strtolower($mainframe->getTemplate());
 }
 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);
 }
Esempio n. 5
0
 /**
  * Constructor
  *
  * @return void
  */
 function JAT3_AdminUtil()
 {
     $this->template = JAT3_AdminUtil::get_active_template();
 }