1 <?php
2
3 4 5 6 7 8 9 10
11
12 namespace Icybee\Modules\Pages;
13
14 use Brickrouge\Element;
15
16 class PopTemplate extends Element
17 {
18 public function __construct(array $attributes=array())
19 {
20 parent::__construct('select', $attributes);
21 }
22
23 public function __toString()
24 {
25 global $core;
26
27 $list = $core->site->templates;
28
29 if (!$list)
30 {
31 return '<p class="warn">There is no template available.</p>';
32 }
33
34 $options = array_combine($list, $list);
35
36 $this[self::OPTIONS] = array(null => '<auto>') + $options;
37
38 return parent::__toString();
39 }
40 }