1 | <?php |
||
13 | class manager |
||
14 | { |
||
15 | /** |
||
16 | * Array that contains all available template location types which are passed |
||
17 | * via the service container |
||
18 | * @var array |
||
19 | */ |
||
20 | protected $template_locations; |
||
21 | |||
22 | /** |
||
23 | * Construct an template locations manager object |
||
24 | * |
||
25 | * @param array $template_locations Template location types passed via the service container |
||
26 | */ |
||
27 | 32 | public function __construct($template_locations) |
|
31 | |||
32 | /** |
||
33 | * Get a list of all template location types |
||
34 | * |
||
35 | * If $with_categories is true, returns a composite associated array |
||
36 | * of location category, ID, name and desc: |
||
37 | * array( |
||
38 | * location_category => array( |
||
39 | * location_id => array( |
||
40 | * 'name' => location_name |
||
41 | * 'desc' => location_description |
||
42 | * ), |
||
43 | * ... |
||
44 | * ), |
||
45 | * ... |
||
46 | * ) |
||
47 | * |
||
48 | * Otherwise returns only location ID, name and desc: |
||
49 | * array( |
||
50 | * location_id => array( |
||
51 | * 'name' => location_name |
||
52 | * 'desc' => location_description |
||
53 | * ), |
||
54 | * ... |
||
55 | * ) |
||
56 | * |
||
57 | * @param bool $with_categories Should we organize locations into categories? |
||
58 | * |
||
59 | * @return array Array containing a list of all template locations sorted by categories |
||
60 | */ |
||
61 | 8 | public function get_all_locations($with_categories = true) |
|
87 | |||
88 | /** |
||
89 | * Get a list of all template location IDs for display |
||
90 | * |
||
91 | * @return array Array containing a list of all template location IDs |
||
92 | */ |
||
93 | 8 | public function get_all_location_ids() |
|
110 | |||
111 | /** |
||
112 | * Register template locations |
||
113 | * |
||
114 | * @param array $template_locations Template location types passed via the service container |
||
115 | */ |
||
116 | 32 | protected function register_template_locations($template_locations) |
|
137 | } |
||
138 |