path . '/../control.json')) { return json_decode(file_get_contents($menu_file), true); } return false; } public function getPermissions(){ $menus = $this->getMenus(); $permissions = []; if($menus){ $this->getPath($menus,$permissions); } return $permissions; } public function getPath($arr,&$data) { if(isset($arr['path'])){ $data[] = $arr['path']; if(isset($arr['children'])){ $this->getPath($arr['children'],$data); } }else{ foreach ($arr as $key => $value) { if (isset($value['path'])) { $data[] = $value['path']; } if (isset($value['children'])) { $this->getPath($value['children'],$data); } } } } public function getPlugin() { return $this->plugin; } }