1 | <?php |
||
18 | class Iframe |
||
19 | { |
||
20 | |||
21 | /* |
||
22 | * HTML for notices and ajax gif |
||
23 | * @var string $title |
||
24 | */ |
||
25 | protected $title = ''; |
||
26 | |||
27 | /* |
||
28 | * HTML for the content being displayed |
||
29 | * @var string $content |
||
30 | */ |
||
31 | protected $content = ''; |
||
32 | |||
33 | /* |
||
34 | * whether or not to call wp_head() and wp_footer() |
||
35 | * @var boolean $enqueue_wp_assets |
||
36 | */ |
||
37 | protected $enqueue_wp_assets = false; |
||
38 | |||
39 | /* |
||
40 | * an array of CSS URLs |
||
41 | * @var array $css |
||
42 | */ |
||
43 | protected $css = array(); |
||
44 | |||
45 | /* |
||
46 | * an array of JS URLs to be set in the HTML header. |
||
47 | * @var array $header_js |
||
48 | */ |
||
49 | protected $header_js = array(); |
||
50 | |||
51 | /* |
||
52 | * an array of JS URLs to be displayed before the HTML </body> tag |
||
53 | * @var array $footer_js |
||
54 | */ |
||
55 | protected $footer_js = array(); |
||
56 | |||
57 | /* |
||
58 | * an array of JSON vars to be set in the HTML header. |
||
59 | * @var array $localized_vars |
||
60 | */ |
||
61 | protected $localized_vars = array(); |
||
62 | |||
63 | |||
64 | |||
65 | /** |
||
66 | * Iframe constructor |
||
67 | * |
||
68 | * @param string $title |
||
69 | * @param string $content |
||
70 | * @throws \EE_Error |
||
71 | */ |
||
72 | public function __construct( $title, $content ) |
||
101 | |||
102 | |||
103 | |||
104 | /** |
||
105 | * @param string $title |
||
106 | * @throws \EE_Error |
||
107 | */ |
||
108 | public function setTitle( $title ) |
||
117 | |||
118 | |||
119 | |||
120 | /** |
||
121 | * @param string $content |
||
122 | * @throws \EE_Error |
||
123 | */ |
||
124 | public function setContent( $content ) |
||
133 | |||
134 | |||
135 | |||
136 | /** |
||
137 | * @param boolean $enqueue_wp_assets |
||
138 | */ |
||
139 | public function setEnqueueWpAssets( $enqueue_wp_assets ) |
||
143 | |||
144 | |||
145 | |||
146 | /** |
||
147 | * @param array $stylesheets |
||
148 | * @throws \EE_Error |
||
149 | */ |
||
150 | public function addStylesheets( array $stylesheets ) |
||
164 | |||
165 | |||
166 | |||
167 | /** |
||
168 | * @param array $scripts |
||
169 | * @param bool $add_to_header |
||
170 | * @throws \EE_Error |
||
171 | */ |
||
172 | public function addScripts( array $scripts, $add_to_header = false ) |
||
190 | |||
191 | |||
192 | |||
193 | /** |
||
194 | * @param array $vars |
||
195 | * @param string $var_name |
||
196 | * @throws \EE_Error |
||
197 | */ |
||
198 | public function addLocalizedVars( array $vars, $var_name = 'eei18n' ) |
||
219 | |||
220 | |||
221 | |||
222 | /** |
||
223 | * @return void |
||
224 | * @throws \DomainException |
||
225 | */ |
||
226 | public function display() |
||
233 | |||
234 | |||
235 | |||
236 | /** |
||
237 | * @return string |
||
238 | * @throws \DomainException |
||
239 | */ |
||
240 | public function getTemplate() |
||
291 | |||
292 | |||
293 | |||
294 | /** |
||
295 | * localizeJsonVars |
||
296 | * |
||
297 | * @return string |
||
298 | */ |
||
299 | public function localizeJsonVars() |
||
312 | |||
313 | |||
314 | |||
315 | /** |
||
316 | * @param bool|int|float|string|array $var |
||
317 | * @return array |
||
318 | */ |
||
319 | public function encodeJsonVars( $var ) |
||
332 | |||
333 | |||
334 | |||
335 | } |
||
336 | // End of file Iframe.php |
||
337 | // Location: /Iframe.php |