Horde_LoginTasks::getLabels PHP Method

getLabels() public static method

Labels for the class constants.
public static getLabels ( ) : array
return array A mapping of constant to gettext string.
    public static function getLabels()
    {
        return array(self::YEARLY => Horde_LoginTasks_Translation::t("Yearly"), self::MONTHLY => Horde_LoginTasks_Translation::t("Monthly"), self::WEEKLY => Horde_LoginTasks_Translation::t("Weekly"), self::DAILY => Horde_LoginTasks_Translation::t("Daily"), self::EVERY => Horde_LoginTasks_Translation::t("Every Login"));
    }

Usage Example

Esempio n. 1
0
$prefGroups['share'] = array('column' => _("Task List and Share Preferences"), 'label' => _("Default Task List"), 'desc' => _("Choose your default task list."), 'members' => array('default_tasklist'));
$prefGroups['sync'] = array('column' => _("Task List and Share Preferences"), 'label' => _("Synchronization Preferences"), 'desc' => _("Choose the task lists to use for synchronization with external devices."), 'members' => array('sync_lists', 'activesync_no_multiplex'));
$prefGroups['notification'] = array('column' => _("Task List and Share Preferences"), 'label' => _("Notifications"), 'desc' => _("Choose if you want to be notified of task changes and task alarms."), 'members' => array('task_notification', 'task_notification_exclude_self', 'task_alarms_select'));
$prefGroups['external'] = array('column' => _("Task List and Share Preferences"), 'label' => _("External Data"), 'desc' => _("Show data from other applications or sources."), 'members' => array('show_external'));
// columns in the list view
$_prefs['tasklist_columns'] = array('value' => 'a:2:{i:0;s:8:"priority";i:1;s:3:"due";}', 'type' => 'multienum', 'enum' => array('tasklist' => _("Task List"), 'priority' => _("Priority"), 'assignee' => _("Assignee"), 'due' => _("Due Date"), 'start' => _("Start Date"), 'estimate' => _("Estimated Time")), 'desc' => _("Select the columns that should be shown in the list view:"));
// user preferred sorting column
$_prefs['sortby'] = array('value' => Nag::SORT_PRIORITY, 'type' => 'enum', 'enum' => array(Nag::SORT_PRIORITY => _("Priority"), Nag::SORT_NAME => _("Task Name"), Nag::SORT_DUE => _("Due Date"), Nag::SORT_START => _("Start Date"), Nag::SORT_COMPLETION => _("Completed?"), Nag::SORT_ESTIMATE => _("Estimated Time"), Nag::SORT_ASSIGNEE => _("Assignee"), Nag::SORT_OWNER => _("Task List")), 'desc' => _("Sort tasks by:"));
// alternate sort column
$_prefs['altsortby'] = array('value' => Nag::SORT_DUE, 'type' => 'enum', 'enum' => array(Nag::SORT_PRIORITY => _("Priority"), Nag::SORT_NAME => _("Task Name"), Nag::SORT_DUE => _("Due Date"), Nag::SORT_START => _("Start Date"), Nag::SORT_COMPLETION => _("Completed?"), Nag::SORT_ESTIMATE => _("Estimated Time"), Nag::SORT_ASSIGNEE => _("Assignee"), Nag::SORT_OWNER => _("Task List")), 'desc' => _("Then:"));
// user preferred sorting direction
$_prefs['sortdir'] = array('value' => Nag::SORT_ASCEND, 'type' => 'enum', 'enum' => array(Nag::SORT_ASCEND => _("Ascending"), Nag::SORT_DESCEND => _("Descending")), 'desc' => _("Sort direction:"));
// preference for delete confirmation dialog.
$_prefs['delete_opt'] = array('value' => 1, 'type' => 'checkbox', 'desc' => _("Do you want to confirm deleting entries?"));
// how often to purge completed tasks?
$_prefs['purge_completed_interval'] = array('value' => 0, 'type' => 'enum', 'enum' => array_merge(array(0 => _("Never")), Horde_LoginTasks::getLabels()), 'desc' => _("Purge completed tasks how often:"));
$_prefs['purge_completed_keep'] = array('value' => 30, 'type' => 'number', 'desc' => _("Purge completed tasks older than this amount of days."));
// default to tasks having a due date?
$_prefs['default_due'] = array('value' => 0, 'type' => 'checkbox', 'desc' => _("When creating a new task, should it default to having a due date?"));
// default number of days out for due dates
$_prefs['default_due_days'] = array('value' => 1, 'type' => 'number', 'zero' => true, 'desc' => _("When creating a new task, how many days in the future should the default due date be (0 means today)?"));
// default due time
$_prefs['default_due_time'] = array('value' => 'now', 'type' => 'enum', 'enum' => array(), 'desc' => _("What do you want to be the default due time for tasks?"), 'on_init' => function ($ui) {
    $enum = array('now' => _("The current hour"));
    $twentyfour = $GLOBALS['prefs']->getValue('twentyFour');
    for ($i = 0; $i < 24; ++$i) {
        $value = sprintf('%02d:00', $i);
        $enum[$value] = $twentyfour ? $value : sprintf('%02d:00 ' . ($i >= 12 ? _("pm") : _("am")), $i % 12 ? $i % 12 : 12);
    }
    $ui->prefs['default_due_time']['enum'] = $enum;
});
All Usage Examples Of Horde_LoginTasks::getLabels