class JAddons{ static public function getTplParams(){ $app =& JFactory::getApplication(); $cont = null; $ini = JPATH_THEMES.DS.$app->getTemplate().DS.'params.ini'; $xml = JPATH_THEMES.DS.$app->getTemplate().DS.'templateDetails.xml'; jimport('joomla.filesystem.file'); if (JFile::exists($ini)) { $cont = JFile::read($ini); } else { $cont = null; } return new JParameter($cont, $xml, $app->getTemplate()); } }
Load the class:
$app =& JFactory::getApplication(); JLoader::register('JAddons', JPATH_THEMES.DS.$app->getTemplate().DS.'read_tpl_params.php');
Get the parameter:
$some_param_val = JAddons::getTplParams()->get('some_param');