1: <?php
2: /**
3: * The Horde_Kolab_Storage_Folder_Namespace_Fixed:: implements the default IMAP
4: * namespaces on the Kolab server.
5: *
6: * PHP version 5
7: *
8: * @category Kolab
9: * @package Kolab_Storage
10: * @author Gunnar Wrobel <wrobel@pardus.de>
11: * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
12: * @link http://pear.horde.org/index.php?package=Kolab_Storage
13: */
14:
15: /**
16: * The Horde_Kolab_Storage_Folder_Namespace_Fixed:: implements the default IMAP
17: * namespaces on the Kolab server.
18: *
19: * Copyright 2010-2012 Horde LLC (http://www.horde.org/)
20: *
21: * See the enclosed file COPYING for license information (LGPL). If you
22: * did not receive this file, see http://www.horde.org/licenses/lgpl21.
23: *
24: * @category Kolab
25: * @package Kolab_Storage
26: * @author Gunnar Wrobel <wrobel@pardus.de>
27: * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
28: * @link http://pear.horde.org/index.php?package=Kolab_Storage
29: */
30: class Horde_Kolab_Storage_Folder_Namespace_Fixed
31: extends Horde_Kolab_Storage_Folder_Namespace
32: {
33: /**
34: * Constructor.
35: */
36: public function __construct($user)
37: {
38: $this->user = $user;
39: parent::__construct($this->_initializeData());
40: }
41:
42: /**
43: * Initialize the namespace elements.
44: *
45: * @return array The namespace elements.
46: */
47: private function _initializeData()
48: {
49: return array(
50: new Horde_Kolab_Storage_Folder_Namespace_Element_Personal('INBOX/', '/', $this->user),
51: new Horde_Kolab_Storage_Folder_Namespace_Element_Other('user/', '/', $this->user),
52: new Horde_Kolab_Storage_Folder_Namespace_Element_SharedWithPrefix('', '/', $this->user, 'shared.')
53: );
54: }
55:
56: /**
57: * Serialize this object.
58: *
59: * @return string The serialized data.
60: */
61: public function serialize()
62: {
63: return serialize($this->user);
64: }
65:
66: /**
67: * Reconstruct the object from serialized data.
68: *
69: * @param string $data The serialized data.
70: */
71: public function unserialize($data)
72: {
73: $this->user = @unserialize($data);
74: $this->initialize($this->_initializeData());
75: }
76: }