Add default length of lists

peterx - August 13, 2009 - 01:21
Project:Storm
Version:6.x-1.23
Component:Storm.module
Category:feature request
Priority:minor
Assigned:Unassigned
Status:closed
Description

The Storm lists all appear to contain 10 entries. 20 would fit my screen. An administration option to change all the list lengths would be useful.

#1

Magnity - August 13, 2009 - 09:25

This can already be done using the filter options on each list.

(EDIT: Although this is setting per list rather than globally)

#2

Mark_Watson27 - August 21, 2009 - 17:55
Status:active» needs review

This could be easily acheivable by adding the following lines to the storm_admin_settings function in storm.module

  $form['storm_default_items_per_page'] = array(
    '#type' => 'textfield',
    '#title' => t('Default Items per Page'),
    '#default_value' => variable_get('storm_default_items_per_page', 10),
    '#description' => t('Default items per page when viewing lists'),
    '#size' => 5,
    '#weight' => $w++
  );

Then in the modeles theme.inc i.e. for Tickets stormticket.theme.inc change the code in stormticket_list

  $itemsperpage = $_SESSION['stormticket_list_filter']['itemsperpage'];
  if (!$itemsperpage) {
    $itemsperpage = variable_get('storm_default_items_per_page', 10);
    $_SESSION['stormticket_list_filter']['itemsperpage'] = $itemsperpage;
  }

So that you're getting the default setting or using 10 if there isn't one.

#3

Magnity - August 21, 2009 - 22:09
Status:needs review» reviewed & tested by the community

Looks good.

#4

Magnity - August 21, 2009 - 23:21
Title:Change length of lists from 10 to 20» Add default length of lists
Status:reviewed & tested by the community» fixed

Committed to all modules.

Note that the items per page settings are in each module's admin.inc file, not theme.inc and that it is the setting in stormmodule_list_filter which matters rather than stormmodule_list.

#5

System Message - September 4, 2009 - 23:30
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.