You are here

function mostpopular_interval_defaults in Drupal Most Popular 7

Returns an array of default intervals to use for a new block.

Parameters

integer $bid The ID of the block.:

1 call to mostpopular_interval_defaults()
mostpopular_intervals_admin_form in ./mostpopular.intervals.inc

File

./mostpopular.module, line 637
The main file for the Most Popular module.

Code

function mostpopular_interval_defaults($bid) {
  $defaults = array(
    (object) array(
      'bid' => $bid,
      'title' => '1 day',
      'string' => '-1 day',
      'weight' => 0,
    ),
    (object) array(
      'bid' => $bid,
      'title' => '1 week',
      'string' => '-1 week',
      'weight' => 1,
    ),
    (object) array(
      'bid' => $bid,
      'title' => '1 month',
      'string' => '-1 month',
      'weight' => 2,
    ),
    (object) array(
      'bid' => $bid,
      'title' => '1 year',
      'string' => '-1 year',
      'weight' => 3,
    ),
  );

  // Allow other modules to change this list.
  drupal_alter('mostpopular_interval_defaults', $defaults, $bid);
  return $defaults;
}