You are here

function statspro_get_period_info in Statistics Pro 6.2

Returns the presentable period name and returns a period definition as number of days for custom_days period.

Parameters

<string> $period:

<int> $number_of_days:

Return value

<array>

3 calls to statspro_get_period_info()
statspro_drush_run in ./statspro.drush.inc
Run drush command for specified mode
statspro_overview in ./statspro_overview.inc
Callback function for overview page.
statspro_path_aggregated in ./statspro_path_aggregated.inc
Callback function for path aggregated page.

File

./statspro_settings.inc, line 179

Code

function statspro_get_period_info($period, $number_of_days) {
  $period_name = NULL;
  if ($period == 'custom_days') {
    $period = $number_of_days;
    $period_name = t('custom period of @days past days', array(
      '@days' => $number_of_days,
    ));
  }
  else {
    $periods = statspro_get_period_items();
    if (array_key_exists($period, $periods)) {
      $period_name = $periods[$period];
    }
  }
  return array(
    'period' => $period,
    'period_name' => $period_name,
  );
}