You are here

function _node_revision_delete_time_number_string in Node Revision Delete 7.3

Return the time option in singular or plural.

Parameters

string $number: The number.

string $time: The time option (days, weeks or months).

Return value

string The singular or plural value for the time.

3 calls to _node_revision_delete_time_number_string()
drush_node_revision_delete_nrd_minimum_age_to_delete_time in ./node_revision_delete.drush.inc
Callback for the nrd-minimum-age-to-delete-time command.
drush_node_revision_delete_nrd_when_to_delete_time in ./node_revision_delete.drush.inc
Callback for the nrd-when-to-delete-time command.
_node_revision_delete_time_string in ./node_revision_delete.helpers.inc
Return the time string for the config_name parameter.

File

./node_revision_delete.helpers.inc, line 237
Helper functions.

Code

function _node_revision_delete_time_number_string($number, $time) {

  // Time options.
  $time_options = array(
    'days' => array(
      'singular' => t('day'),
      'plural' => t('days'),
    ),
    'weeks' => array(
      'singular' => t('week'),
      'plural' => t('weeks'),
    ),
    'months' => array(
      'singular' => t('month'),
      'plural' => t('months'),
    ),
  );
  return $number == 1 ? $time_options[$time]['singular'] : $time_options[$time]['plural'];
}