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

« back to all changes in this revision

Viewing changes to nag-4.1.4/lib/Tasklists/Default.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
 * The default tasklists handler.
 
4
 *
 
5
 * See the enclosed file COPYING for license information (GPL). If you
 
6
 * did not receive this file, see http://www.horde.org/licenses/gpl.
 
7
 *
 
8
 * @author  Gunnar Wrobel <wrobel@pardus.de>
 
9
 * @package Nag
 
10
 */
 
11
class Nag_Tasklists_Default extends Nag_Tasklists_Base
 
12
{
 
13
    /**
 
14
     * The current identity.
 
15
     *
 
16
     * @var Horde_Prefs_Identity
 
17
     */
 
18
    private $_identity;
 
19
 
 
20
    /**
 
21
     * Constructor.
 
22
     *
 
23
     * @param Horde_Share_Base $shares The share backend.
 
24
     * @param string           $user   The current user.
 
25
     * @param array            $params Additional parameters.
 
26
     */
 
27
    public function __construct($shares, $user, $params)
 
28
    {
 
29
        if (!isset($params['identity'])) {
 
30
            throw new Nag_Exception('This tasklist handler needs an "identity" parameter!');
 
31
        } else {
 
32
            $this->_identity = $params['identity'];
 
33
            unset($params['identity']);
 
34
        }
 
35
        parent::__construct($shares, $user, $params);
 
36
    }
 
37
 
 
38
    /**
 
39
     * Return the name of the default share.
 
40
     *
 
41
     * @return string The name of a default share.
 
42
     */
 
43
    protected function _getDefaultShareName()
 
44
    {
 
45
        return sprintf(_("Task list of %s"), $this->_identity->getName());
 
46
    }
 
47
}
 
 
b'\\ No newline at end of file'