' . JText :: _('AT_A_GLANCE') . '

' . (($statistics == NULL) ? ('
' . JText :: _('ERROR_RETRIEVING_STATISTICS') . '
') : implode('', array_map(function ($statistic) use ($baseUrl) {return BrowseHelper :: formatStatistic($statistic, $baseUrl);}, $statistics))) . '
'; } // Format a single statistic. // $statistic the statistic to format // $baseUrl the base URL to use for links // return a string containing the full HTML for the statistic or an empty string if any errors occur public static function formatStatistic($statistic, $baseUrl) { // TODO JRoute :: _ keeps decoding urlencoded values, so this is just a hack to cope with this $data = ($statistic -> data == NULL) ? NULL : array_map(function ($row) use ($statistic, $baseUrl) {return '' . ((strlen($row -> name) > BrowseHelper :: MAX_ROW) ? (substr($row -> name, 0, BrowseHelper :: MAX_ROW - strlen('...')) . '...') : $row -> name) . ' (' . $row -> count . ')';}, $statistic -> data); return '
' . $statistic -> title . '
' . (($statistic -> data == NULL) ? ('
' . $statistic -> error . '
') : ('

' . implode('
', array_slice($data, 0, BrowseHelper :: MAX_ROWS)) . ((count($data) > BrowseHelper :: MAX_ROWS) ? ('
' . JText :: _('VIEW_MORE') . '') : '') . '

')) . ((count($data) > BrowseHelper :: MAX_ROWS) ? ('
' . $statistic -> title . '

' . implode('
', $data) . '

') : '') . '
'; } }