You are here

function theme_media_browser_control_result_limit in D7 Media 7

Theme function to display the results limiting- 10, 30, 50 results per page.

Parameters

$variables: array parameters

Return value

unknown

1 theme call to theme_media_browser_control_result_limit()
theme_media_browser_content_frame in includes/media.theme.inc
Default theming function for creating the browser frame. Assumes an array of file objects as $files and an array of $parameters

File

includes/media.theme.inc, line 208
Media Theming

Code

function theme_media_browser_control_result_limit($variables) {

  // Pull out all the variables into a usable form
  extract($variables);
  if (!isset($limits)) {
    $limits = array(
      10,
      30,
      50,
    );
  }

  // @NOTE these do not need to be aware of the current
  //       page because clicking them will reset the
  //       display to 1 -> $limit
  $parameters['page'] = 0;

  // save the active limit
  $current_limit = $parameters['limit'];
  $per_display = array();
  foreach ($limits as $limit) {
    if ($limit == $current_limit) {
      $class = 'active';
    }
    else {
      $class = '';
    }

    // set the value of this limit parameter to this limit value
    $parameters['limit'] = $limit;
    $per_display[] = l($limit, $limit, array(
      'query' => $parameters,
      'attributes' => array(
        'class' => $class,
      ),
    ));
  }
  return theme('item_list', array(
    'items' => $per_display,
    'attributes' => array(
      'class' => 'result_limit',
    ),
  ));
}