PluginProbe
Responsive Menu – Create Mobile-Friendly Menu / 3.0.12
Responsive Menu – Create Mobile-Friendly Menu v3.0.12
4.7.3 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.1.0 4.1.1 4.1.10 4.1.11 4.1.12 4.1.2 4.1.3 4.1.4 4.1.5 4.1.6 4.1.7 4.1.8 4.1.9 4.2.0 All 90 releases
responsive-menu / src / app / Collections / OptionsCollection.php

OptionsCollection.php in Responsive Menu – Create Mobile-Friendly Menu 3.0.12, at src/app/Collections/OptionsCollection.php

84 lines 2.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace ResponsiveMenu\Collections;
4 use ResponsiveMenu\Models\Option;
5
6 class OptionsCollection implements \ArrayAccess {
7
8 private $options;
9
10 public function add(Option $option) {
11 $this->options[$option->getName()] = $option;
12 }
13
14 public function get($name) {
15 return $this->options[$name];
16 }
17
18 public function all() {
19 return $this->options;
20 }
21
22 public function usesFontIcons() {
23 return false;
24 }
25
26 public function getActiveArrow() {
27 if($this->options['active_arrow_image'] && $this->options['active_arrow_image']->getValue())
28 return '<img alt="' . $this->options['active_arrow_image_alt'] .'" src="' . $this->options['active_arrow_image'] .'" />';
29 else
30 return $this->options['active_arrow_shape'];
31
32 }
33
34 public function getInActiveArrow() {
35 if($this->options['inactive_arrow_image'] && $this->options['inactive_arrow_image']->getValue())
36 return '<img alt="' . $this->options['inactive_arrow_image_alt'] .'" src="' . $this->options['inactive_arrow_image'] .'" />';
37 else
38 return $this->options['inactive_arrow_shape'];
39
40 }
41
42 public function getTitleImage() {
43 if($this->options['menu_title_image'] && $this->options['menu_title_image']->getValue())
44 return '<img alt="' . $this->options['menu_title_image_alt'] .'" src="' . $this->options['menu_title_image'] .'" />';
45 else
46 return null;
47
48 }
49
50 public function getButtonIcon() {
51 if($this->options['button_image'] && $this->options['button_image']->getValue())
52 return '<img alt="' . $this->options['button_image_alt'] .'" src="' . $this->options['button_image'] .'" class="responsive-menu-button-icon responsive-menu-button-icon-active" />';
53 else
54 return '<span class="responsive-menu-inner"></span>';
55 }
56
57 public function getButtonIconActive() {
58 if($this->options['button_image'] && $this->options['button_image']->getValue())
59 return '<img alt="' . $this->options['button_image_alt_when_clicked'] .'" src="' . $this->options['button_image_when_clicked'] .'" class="responsive-menu-button-icon responsive-menu-button-icon-inactive" />';
60 }
61
62 public function offsetExists($offset) {
63 return array_key_exists($offset, $this->options);
64 }
65
66 public function offsetGet($offset) {
67 return isset($this->options[$offset]) ? $this->options[$offset] : null;
68 }
69
70 public function offsetSet($offset, $value) {
71 $this->options[$offset] = $value;
72 }
73
74 public function offsetUnset($offset) {
75 if(isset($this->options[$offset]))
76 unset($this->options[$offset]);
77 }
78
79 public function isEmpty() {
80 return isset($this->options) && count($this->options) > 0 ? false : true;
81 }
82
83 }
84