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
12: extends Nag_Tasklists_Base
13: {
14: /**
15: * The current identity.
16: *
17: * @var Horde_Prefs_Identity
18: */
19: private $_identity;
20:
21: /**
22: * Constructor.
23: *
24: * @param Horde_Share_Base $shares The share backend.
25: * @param string $user The current user.
26: * @param array $params Additional parameters.
27: */
28: public function __construct($shares, $user, $params)
29: {
30: if (!isset($params['identity'])) {
31: throw new Nag_Exception('This tasklist handler needs an "identity" parameter!');
32: } else {
33: $this->_identity = $params['identity'];
34: unset($params['identity']);
35: }
36: parent::__construct($shares, $user, $params);
37: }
38:
39: /**
40: * Return the name of the default share.
41: *
42: * @return string The name of a default share.
43: */
44: protected function getDefaultShareName()
45: {
46: return sprintf(_("Task list of %s"), $this->_identity->getName());
47: }
48: }