function template_preprocess_views_view_summary_unformatted in Views (for Drupal 7) 6.2
Same name and namespace in other branches
- 8.3 theme/theme.inc \template_preprocess_views_view_summary_unformatted()
- 6.3 theme/theme.inc \template_preprocess_views_view_summary_unformatted()
- 7.3 theme/theme.inc \template_preprocess_views_view_summary_unformatted()
Template preprocess theme function to print summary basically unformatted.
File
Code
function template_preprocess_views_view_summary_unformatted(&$vars) {
$view = $vars['view'];
$argument = $view->argument[$view->build_info['summary_level']];
$vars['classes'] = array();
$url_options = array();
if (!empty($view->exposed_raw_input)) {
$url_options['query'] = $view->exposed_raw_input;
}
$count = 0;
foreach ($vars['rows'] as $id => $row) {
// only false on first time:
if ($count++) {
$vars['rows'][$id]->separator = filter_xss_admin($vars['options']['separator']);
}
$vars['rows'][$id]->link = $argument
->summary_name($row);
$args = $view->args;
$args[$argument->position] = $argument
->summary_argument($row);
$base_path = NULL;
if (!empty($argument->options['style_options']['base_path'])) {
$base_path = $argument->options['style_options']['base_path'];
}
$vars['rows'][$id]->url = url($view
->get_url($args, $base_path), $url_options);
$vars['rows'][$id]->count = intval($row->{$argument->count_alias});
if ($vars['rows'][$id]->url == base_path() . $_GET['q'] || $vars['rows'][$id]->url == base_path() . drupal_get_path_alias($_GET['q'])) {
$vars['classes'][$id] = 'active';
}
}
}