X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FSelectValues.php;h=721ba43ea4b4754f4c68d9c94f1908dff9afd6c0;hb=e32e663dddae93274cc28fd0539e48a98edbe8df;hp=b7273e435030d82b4649f2e8cfa72124451ba41a;hpb=e9b0c2a705c021d2a96ee331e97048bb9cad5db5;p=civicrm-core.git diff --git a/CRM/Core/SelectValues.php b/CRM/Core/SelectValues.php index b7273e4350..721ba43ea4 100644 --- a/CRM/Core/SelectValues.php +++ b/CRM/Core/SelectValues.php @@ -37,6 +37,18 @@ */ class CRM_Core_SelectValues { + /** + * Yes/No options + * + * @return array + */ + public static function boolean() { + return array( + 1 => ts('Yes'), + 0 => ts('No'), + ); + } + /** * Preferred mail format. * @@ -231,7 +243,6 @@ class CRM_Core_SelectValues { * Styles for displaying the custom data group. * * @return array - * */ public static function customGroupStyle() { return array( @@ -265,7 +276,6 @@ class CRM_Core_SelectValues { * The status of a contact within a group. * * @return array - * */ public static function groupContactStatus() { return array( @@ -968,18 +978,21 @@ class CRM_Core_SelectValues { /** * Frequency unit for schedule reminders. * + * @param int $count + * For pluralization * @return array */ - public static function getScheduleReminderFrequencyUnits() { - //@todo update schema to refer to option group direct & remove this - static $scheduleReminderFrequencyUnits = NULL; - if (!$scheduleReminderFrequencyUnits) { - $scheduleReminderFrequencyUnits = array( - 'hour' => ts('hour'), - ) + CRM_Core_OptionGroup::values('recur_frequency_units'); - } - - return $scheduleReminderFrequencyUnits; + public static function getRecurringFrequencyUnits($count = 1) { + // @todo this used to refer to the 'recur_frequency_unit' option_values which + // is for recurring payments and probably not good to re-use for recurring entities. + // If something other than a hard-coded list is desired, add a new option_group. + return array( + 'hour' => ts('hour', array('plural' => 'hours', 'count' => $count)), + 'day' => ts('day', array('plural' => 'days', 'count' => $count)), + 'week' => ts('week', array('plural' => 'weeks', 'count' => $count)), + 'month' => ts('month', array('plural' => 'months', 'count' => $count)), + 'year' => ts('year', array('plural' => 'years', 'count' => $count)), + ); } }