1: <?php
2: /**
3: * This class extends the base indices class by automatically converting
4: * base64 encoded form data into the mailbox format internally understood by
5: * the IMP server code.
6: *
7: * Copyright 2011-2012 Horde LLC (http://www.horde.org/)
8: *
9: * See the enclosed file COPYING for license information (GPL). If you
10: * did not receive this file, see http://www.horde.org/licenses/gpl.
11: *
12: * @author Michael Slusarz <slusarz@horde.org>
13: * @category Horde
14: * @license http://www.horde.org/licenses/gpl GPL
15: * @package IMP
16: */
17: class IMP_Indices_Form extends IMP_Indices
18: {
19: /**
20: * Default name is base64url encoded version of INBOX.
21: */
22: protected $_default = 'SU5CT1g';
23:
24: /**
25: */
26: public function __construct()
27: {
28: if (func_num_args()) {
29: $args = func_get_args();
30: call_user_func_array(array($this, 'add'), $args);
31:
32: if ((count($args) == 1) && is_string($args[0])) {
33: $converted = array();
34: foreach ($this->_indices as $key => $val) {
35: $converted[strval(IMP_Mailbox::formFrom($key))] = $val;
36: }
37: $this->_indices = $converted;
38: }
39: }
40: }
41:
42: }
43: