You are here

function template_preprocess_mostpopular_intervals in Drupal Most Popular 7

1 string reference to 'template_preprocess_mostpopular_intervals'
mostpopular_theme in ./mostpopular.module
Implements hook_theme().

File

./mostpopular.theme.inc, line 54
Defines all the pages, blocks and themes for rendering the most popular data to general users.

Code

function template_preprocess_mostpopular_intervals(&$variables) {
  $variables['theme_hook_suggestions'][] = 'item_list__mostpopular_intervals';
  $variables['theme_hook_suggestions'][] = 'item_list';
  $variables += array(
    'attributes' => array(),
    'title' => NULL,
    'type' => 'ul',
    'items' => array(),
  );
  $variables['attributes']['class'][] = 'mostpopular--intervals';
  $variables['items'][] = array(
    'data' => t('Past:'),
    'class' => array(
      'mostpopular--label',
    ),
  );
  foreach ($variables['intervals'] as $iid => $interval) {
    $variables['items'][$iid] = array(
      'data' => theme('mostpopular_interval', array(
        'interval' => $interval,
      )),
      'data-iid' => $iid,
    );
  }
}