addStyleSheet(JRoute :: _(JURI :: base() . 'components/' . JRequest :: getVar('option') . '/css/search.css')); $document -> addCustomTag(''); $model = &$this->getModel('statistics'); $thriftResult = $this->getStats(); $programmeStats = $thriftResult->pubStats->programmeStats->lines; $subdivisionStats = $thriftResult->pubStats->subdivisionStats->lines; $countryStats = $thriftResult->pubStats->countryStats->lines; $institutionStats = $thriftResult->pubStats->organizationStats->lines; if (JRequest::getVar('showInstitutions', 'false', 'get') == "false") { $institutionStats = array_slice($institutionStats, 0, 15); } if (JRequest::getVar('showCountries', 'false', 'get') == "false") { $countryStats = array_slice($countryStats, 0, 15); } $this->assignRef('stats', $thriftResult); $this->assignRef('programmeStats', $programmeStats); $this->assignRef('institutionStats', $institutionStats); $this->assignRef('subdivisionStats', $subdivisionStats); $this->assignRef('countryStats', $countryStats); $this->assignRef('searchMenuId', $model->getSearchMenuId()); parent::display($tpl); } private function getStats() { $model = &$this->getModel('statistics'); $cache = & JFactory::getCache('com_openaire', 'callback'); $conf =& JFactory::getConfig(); $cacheactive = $conf->getValue('config.caching'); $cache->setCaching(1); //enable caching $stats = $cache->call(array($model, 'getEvaluationStatistics')); $cache->setCaching($cacheactive); return $stats; } } ?>