~ubuntu-branches/ubuntu/vivid/php-horde-nag/vivid

« back to all changes in this revision

Viewing changes to nag-4.1.2/lib/Prefs/Special/TaskAlarms.php

  • Committer: Package Import Robot
  • Author(s): Mathieu Parent
  • Date: 2013-10-29 22:01:43 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20131029220143-k16crjhccwr56jxq
Tags: 4.1.3-1
New upstream version 4.1.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?php
2
 
/**
3
 
 * Special prefs handling for the 'task_alarms_select' preference.
4
 
 *
5
 
 * Copyright 2012-2013 Horde LLC (http://www.horde.org/)
6
 
 *
7
 
 * See the enclosed file COPYING for license information (GPL). If you
8
 
 * did not receive this file, see http://www.horde.org/licenses/gpl.
9
 
 *
10
 
 * @author   Michael Slusarz <slusarz@horde.org>
11
 
 * @category Horde
12
 
 * @license  http://www.horde.org/licenses/gpl GPL
13
 
 * @package  Nag
14
 
 */
15
 
class Nag_Prefs_Special_TaskAlarms implements Horde_Core_Prefs_Ui_Special
16
 
{
17
 
    /**
18
 
     */
19
 
    public function init(Horde_Core_Prefs_Ui $ui)
20
 
    {
21
 
        Horde_Core_Prefs_Ui_Widgets::alarmInit();
22
 
    }
23
 
 
24
 
    /**
25
 
     */
26
 
    public function display(Horde_Core_Prefs_Ui $ui)
27
 
    {
28
 
        return Horde_Core_Prefs_Ui_Widgets::alarm(array(
29
 
            'label' => _("Choose how you want to receive reminders for tasks with alarms:"),
30
 
            'pref' => 'task_alarms'
31
 
        ));
32
 
    }
33
 
 
34
 
    /**
35
 
     */
36
 
    public function update(Horde_Core_Prefs_Ui $ui)
37
 
    {
38
 
        $data = Horde_Core_Prefs_Ui_Widgets::alarmUpdate($ui, array('pref' => 'task_alarms'));
39
 
        if (is_null($data)) {
40
 
            return false;
41
 
        }
42
 
 
43
 
        $GLOBALS['prefs']->setValue('task_alarms', serialize($data));
44
 
        return true;
45
 
    }
46
 
 
47
 
}