' . JText :: _('REFINE_BY') . '
' . implode('', $statistics) . '
'); } public static function _formatStatistic($statistic, $filters, $baseUrl, $fragment) { $data = (($statistic -> data == NULL) || array_key_exists($statistic -> id, $filters)) ? NULL : array_filter(array_map(function ($row) use ($statistic, $filters, $baseUrl, $fragment) {return StatisticHelper :: _formatRow($row, $statistic -> id, $filters, $baseUrl, $fragment);}, $statistic -> data)); return ($data == NULL) ? '' : ('

' . $statistic -> title . '

' . implode('
', array_slice($data, 0, StatisticHelper :: MAX_ROWS)) . ((count($data) > StatisticHelper :: MAX_ROWS) ? ('
' . JText :: _('VIEW_MORE') . '
' . $statistic -> title . '

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

') : '') . '
'); } public static function _formatRow($row, $statisticId, $filters, $baseUrl, $fragment) { $filters = ($filters == NULL) ? NULL : array_filter(array_map(function ($filter) use ($statisticId) {return ($filter -> name == $statisticId) ? '' : (urlencode($filter -> name) . '=' . urlencode(($filter -> value === TRUE) ? 'true' : (($filter -> value === FALSE) ? 'false' : $filter -> value)));}, $filters)); // TODO JRoute :: _ keeps decoding urlencoded values, so this is just a hack to cope with this return '' . ((strlen($row -> name) > StatisticHelper :: MAX_ROW) ? (substr($row -> name, 0, StatisticHelper :: MAX_ROW - strlen('...')) . '...') : $row -> name ) . ' (' . $row -> count . ')'; } }