0
|
1 <?php
|
|
2
|
|
3 /**
|
|
4 +-----------------------------------------------------------------------+
|
|
5 | program/include/rcmail_output.php |
|
|
6 | |
|
|
7 | This file is part of the Roundcube PHP suite |
|
|
8 | Copyright (C) 2005-2012 The Roundcube Dev Team |
|
|
9 | |
|
|
10 | Licensed under the GNU General Public License version 3 or |
|
|
11 | any later version with exceptions for skins & plugins. |
|
|
12 | See the README file for a full license statement. |
|
|
13 | CONTENTS: |
|
|
14 | Abstract class for output generation |
|
|
15 | |
|
|
16 +-----------------------------------------------------------------------+
|
|
17 | Author: Thomas Bruederli <roundcube@gmail.com> |
|
|
18 | Author: Aleksander Machniak <alec@alec.pl> |
|
|
19 +-----------------------------------------------------------------------+
|
|
20 */
|
|
21
|
|
22 /**
|
|
23 * Class for output generation
|
|
24 *
|
|
25 * @package Webmail
|
|
26 * @subpackage View
|
|
27 */
|
|
28 abstract class rcmail_output extends rcube_output
|
|
29 {
|
|
30 const JS_OBJECT_NAME = 'rcmail';
|
|
31 const BLANK_GIF = 'R0lGODlhDwAPAIAAAMDAwAAAACH5BAEAAAAALAAAAAAPAA8AQAINhI+py+0Po5y02otnAQA7';
|
|
32
|
|
33 public $type = 'html';
|
|
34 public $ajax_call = false;
|
|
35 public $framed = false;
|
|
36
|
|
37 protected $pagetitle = '';
|
|
38 protected $object_handlers = array();
|
|
39 protected $devel_mode = false;
|
|
40
|
|
41
|
|
42 /**
|
|
43 * Object constructor
|
|
44 */
|
|
45 public function __construct($task = null, $framed = false)
|
|
46 {
|
|
47 parent::__construct();
|
|
48
|
|
49 $this->devel_mode = (bool) $this->config->get('devel_mode');
|
|
50 }
|
|
51
|
|
52 /**
|
|
53 * Setter for page title
|
|
54 *
|
|
55 * @param string $title Page title
|
|
56 */
|
|
57 public function set_pagetitle($title)
|
|
58 {
|
|
59 $this->pagetitle = $title;
|
|
60 }
|
|
61
|
|
62 /**
|
|
63 * Getter for the current skin path property
|
|
64 */
|
|
65 public function get_skin_path()
|
|
66 {
|
|
67 return $this->config->get('skin_path');
|
|
68 }
|
|
69
|
|
70 /**
|
|
71 * Delete all stored env variables and commands
|
|
72 */
|
|
73 public function reset()
|
|
74 {
|
|
75 parent::reset();
|
|
76
|
|
77 $this->object_handlers = array();
|
|
78 $this->pagetitle = '';
|
|
79 }
|
|
80
|
|
81 /**
|
|
82 * Call a client method
|
|
83 *
|
|
84 * @param string Method to call
|
|
85 * @param ... Additional arguments
|
|
86 */
|
|
87 abstract function command();
|
|
88
|
|
89 /**
|
|
90 * Add a localized label to the client environment
|
|
91 */
|
|
92 abstract function add_label();
|
|
93
|
|
94 /**
|
|
95 * Register a template object handler
|
|
96 *
|
|
97 * @param string $name Object name
|
|
98 * @param string $func Function name to call
|
|
99 *
|
|
100 * @return void
|
|
101 */
|
|
102 public function add_handler($name, $func)
|
|
103 {
|
|
104 $this->object_handlers[$name] = $func;
|
|
105 }
|
|
106
|
|
107 /**
|
|
108 * Register a list of template object handlers
|
|
109 *
|
|
110 * @param array $handlers Hash array with object=>handler pairs
|
|
111 *
|
|
112 * @return void
|
|
113 */
|
|
114 public function add_handlers($handlers)
|
|
115 {
|
|
116 $this->object_handlers = array_merge($this->object_handlers, $handlers);
|
|
117 }
|
|
118 }
|