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

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Mathieu Parent
  • Date: 2014-03-11 21:27:39 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20140311212739-m6rbihspu5zjpvaq
Tags: 4.1.4-1
New upstream version 4.1.4

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
}