| @@ 125-141 (lines=17) @@ | ||
| 122 | * @param null $position |
|
| 123 | * @return $this |
|
| 124 | */ |
|
| 125 | public function addSectionButton($section, $slug, array $button, $position = null) |
|
| 126 | { |
|
| 127 | $buttons = (array)array_get($this->sections, "{$section}.buttons"); |
|
| 128 | ||
| 129 | if ($position === null) { |
|
| 130 | $position = count($buttons) + 1; |
|
| 131 | } |
|
| 132 | ||
| 133 | $front = array_slice($buttons, 0, $position, true); |
|
| 134 | $back = array_slice($buttons, $position, count($buttons) - $position, true); |
|
| 135 | ||
| 136 | $buttons = $front + [$slug => $button] + $back; |
|
| 137 | ||
| 138 | array_set($this->sections, "{$section}.buttons", $buttons); |
|
| 139 | ||
| 140 | return $this; |
|
| 141 | } |
|
| 142 | ||
| 143 | /** |
|
| 144 | * Get the module's menu. |
|
| @@ 153-169 (lines=17) @@ | ||
| 150 | * @param null $position |
|
| 151 | * @return $this |
|
| 152 | */ |
|
| 153 | public function addSectionButton($section, $slug, array $button, $position = null) |
|
| 154 | { |
|
| 155 | $buttons = (array)array_get($this->sections, "{$section}.buttons"); |
|
| 156 | ||
| 157 | if ($position === null) { |
|
| 158 | $position = count($buttons) + 1; |
|
| 159 | } |
|
| 160 | ||
| 161 | $front = array_slice($buttons, 0, $position, true); |
|
| 162 | $back = array_slice($buttons, $position, count($buttons) - $position, true); |
|
| 163 | ||
| 164 | $buttons = $front + [$slug => $button] + $back; |
|
| 165 | ||
| 166 | array_set($this->sections, "{$section}.buttons", $buttons); |
|
| 167 | ||
| 168 | return $this; |
|
| 169 | } |
|
| 170 | ||
| 171 | /** |
|
| 172 | * Get the module navigation. |
|
| @@ 717-733 (lines=17) @@ | ||
| 714 | * @param null $position |
|
| 715 | * @return $this |
|
| 716 | */ |
|
| 717 | public function addSectionTab($section, $slug, array $tab, $position = null) |
|
| 718 | { |
|
| 719 | $tabs = (array)array_get($this->sections, "{$section}.tabs"); |
|
| 720 | ||
| 721 | if ($position === null) { |
|
| 722 | $position = count($tabs) + 1; |
|
| 723 | } |
|
| 724 | ||
| 725 | $front = array_slice($tabs, 0, $position, true); |
|
| 726 | $back = array_slice($tabs, $position, count($tabs) - $position, true); |
|
| 727 | ||
| 728 | $tabs = $front + [$slug => $tab] + $back; |
|
| 729 | ||
| 730 | array_set($this->sections, "{$section}.tabs", $tabs); |
|
| 731 | ||
| 732 | return $this; |
|
| 733 | } |
|
| 734 | ||
| 735 | /** |
|
| 736 | * Get an option value. |
|