1 <?php
2
3 4 5 6 7 8 9 10
11
12 namespace Icybee\Modules\Editor;
13
14 use ICanBoogie\I18n;
15
16 use Brickrouge\Element;
17 use Brickrouge\ElementIsEmpty;
18
19 20 21
22 class SelectorElement extends Element
23 {
24 public function __construct(array $attributes=array())
25 {
26 global $core;
27
28 $options = array();
29
30 foreach ($core->editors as $id => $editor)
31 {
32 $options[$id] = I18n\t($id, array(), array('scope' => 'editor_title'));
33 }
34
35 parent::__construct
36 (
37 'select', $attributes + array
38 (
39 Element::OPTIONS => $options
40 )
41 );
42 }
43
44 45 46 47 48
49 protected function render_outer_html()
50 {
51 if (!$this[Element::OPTIONS])
52 {
53 throw new ElementIsEmpty;
54 }
55
56 return parent::render_outer_html();
57 }
58 }
59