public static function &getInstance() { if (AdminPraise3Tools::$_instance === null) { AdminPraise3Tools::$_instance = new AdminPraise3Tools(); } return AdminPraise3Tools::$_instance; }
function renderComponentFooter($components) { $stainless = AdminPraise3Tools::getInstance(); $ap_task = $stainless->get('ap_task'); $html = ''; $k = 0; foreach ($components as $i => $row) { $html .= '<li class="parent ' . $row->option . '">'; if ($row->admin_menu_link) { $ignore_first = false; $html .= '<a href="index.php?' . $row->admin_menu_link . '" class="parent-link hasTip" title="' . JText::_($row->name) . '::"><div class="component-image"></div><span class="component-label">' . JText::_($row->name) . '</span></a>'; } else { $ignore_first = true; $html .= '<a href="index.php?option=' . $row->option . '" class="parent-link hasTip" title="' . JText::_($row->name) . '::"><div class="component-image"></div><span class="component-label">' . JText::_($row->name) . '</span></a>'; } $html .= "</li>"; $k = 1 - $k; } return $html; }
<?php // no direct access defined('_JEXEC') or die('Restricted access'); $template_path = dirname(__FILE__); require_once $template_path . '/lib/stainless.php'; $stainless = AdminPraise3Tools::getInstance(); // redirect to fallback template for fallback components $fallbackComponents = $stainless->get('fallbackComponents'); $fallbackTemplate = $stainless->get('fallbackTemplate'); if (in_array($stainless->get('option'), $fallbackComponents) && $fallbackTemplate) { $this->template = $fallbackTemplate; $params_ini = file_get_contents(JPATH_ROOT . DS . 'administrator' . DS . 'templates' . DS . $fallbackTemplate . DS . 'params.ini'); $active_params = new JParameter($params_ini); foreach ($active_params->_registry['_default']['data'] as $name => $value) { $this->params->set($name, $value); } if ($fallbackTemplate == "stainless") { print '<style type="text/css">div.icon a{height:90px !important;}</style>'; $this->params->set('switchSidebar', $active_params->get('switchSidebar')); $this->params->set('showSidebar', $active_params->get('showSidebar')); } require_once 'templates' . DS . $fallbackTemplate . DS . 'index.php'; return; } require_once dirname(__FILE__) . DS . 'index.php';