1: <?php
2: /**
3: * Copyright 2014 Horde LLC (http://www.horde.org/)
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: * @category Horde
9: * @copyright 2014 Horde LLC
10: * @license http://www.horde.org/licenses/gpl GPL
11: * @package IMP
12: */
13:
14: /**
15: * Viewport error object.
16: *
17: * @author Michael Slusarz <slusarz@horde.org>
18: * @category Horde
19: * @copyright 2014 Horde LLC
20: * @license http://www.horde.org/licenses/gpl GPL
21: * @package IMP
22: */
23: class IMP_Ajax_Application_Viewport_Error
24: {
25: /**
26: * View object.
27: *
28: * @var IMP_Mailbox
29: */
30: private $_mbox;
31:
32: /**
33: * Constructor.
34: *
35: * @param IMP_Mailbox $mbox Viewport view.
36: */
37: public function __construct(IMP_Mailbox $mbox)
38: {
39: $this->_mbox = $mbox;
40: }
41:
42: /**
43: * Prepare the object used by the ViewPort javascript class.
44: *
45: * @return object The ViewPort object.
46: */
47: public function toObject()
48: {
49: $ob = new stdClass;
50: $ob->cacheid = strval(new Horde_Support_Randomid());
51: $ob->error = true;
52: $ob->label = $this->_mbox->label;
53: $ob->view = $this->_mbox->form_to;
54:
55: return $ob;
56: }
57:
58: }
59: