| @@ 202-222 (lines=21) @@ | ||
| 199 | $j = 0; |
|
| 200 | for ($i = 0, $max = count($all_submenu); $i < $max; $i++) { |
|
| 201 | $access = false; |
|
| 202 | if ($all_submenu[$i]['sub_access'] != '') { |
|
| 203 | $sub = explode(":", $all_submenu[$i]['sub_access']); |
|
| 204 | ||
| 205 | switch ($sub[0]) { |
|
| 206 | case 'sub_access': |
|
| 207 | if ($this->getKernel()->user->hasSubAccess($this->primary_module->module_name, $sub[1])) { |
|
| 208 | $access = true; |
|
| 209 | } |
|
| 210 | break; |
|
| 211 | case 'module': |
|
| 212 | if ($this->getKernel()->user->hasModuleAccess($sub[1])) { |
|
| 213 | $access = true; |
|
| 214 | } |
|
| 215 | break; |
|
| 216 | default: |
|
| 217 | throw new Exception('Der er ikke angivet om submenu skal tjekke efter sub_access eller module adgang, for undermenupunktet i Page->start();'); |
|
| 218 | break; |
|
| 219 | } |
|
| 220 | } else { |
|
| 221 | $access = true; |
|
| 222 | } |
|
| 223 | ||
| 224 | if ($access) { |
|
| 225 | $this->submenu[$j]['name'] = $this->t($all_submenu[$i]['label']); |
|
| @@ 111-133 (lines=23) @@ | ||
| 108 | for ($i = 0, $max = count($all_submenu); $i < $max; $i++) { |
|
| 109 | $access = false; |
|
| 110 | ||
| 111 | if ($all_submenu[$i]['sub_access'] != '') { |
|
| 112 | $sub = explode(":", $all_submenu[$i]['sub_access']); |
|
| 113 | ||
| 114 | switch ($sub[0]) { |
|
| 115 | case 'sub_access': |
|
| 116 | if ($this->kernel->user->hasSubAccess($this->primary_module->module_name, $sub[1])) { |
|
| 117 | $access = true; |
|
| 118 | } |
|
| 119 | break; |
|
| 120 | ||
| 121 | case 'module': |
|
| 122 | if ($this->kernel->user->hasModuleAccess($sub[1])) { |
|
| 123 | $access = true; |
|
| 124 | } |
|
| 125 | break; |
|
| 126 | ||
| 127 | default: |
|
| 128 | throw new Exception('Der er ikke angivet om submenu skal tjekke efter sub_access eller module adgang, for undermenupunktet i Page->start();'); |
|
| 129 | break; |
|
| 130 | } |
|
| 131 | } else { |
|
| 132 | $access = true; |
|
| 133 | } |
|
| 134 | ||
| 135 | if ($access) { |
|
| 136 | $this->submenu[$j]['name'] = $this->t($all_submenu[$i]['label'], $this->primary_module->getName()); |
|