X-Git-Url: http://git.dj3c1t.com/index.cgi?a=blobdiff_plain;f=mw%2Fenv%2Fmodules%2Fmw_env_config.php;fp=mw%2Fenv%2Fmodules%2Fmw_env_config.php;h=a708431712fb7cb3d448437fd2f3f0d483068525;hb=3c17f81e1d2fb68f69cfa620ca00ad63e83cc17c;hp=64da6d33eac1e51e3607f7868a333867efbae7e2;hpb=44c1abaa9a140edaeee8e30dcc557214b9f00903;p=mtweb diff --git a/mw/env/modules/mw_env_config.php b/mw/env/modules/mw_env_config.php index 64da6d3..a708431 100644 --- a/mw/env/modules/mw_env_config.php +++ b/mw/env/modules/mw_env_config.php @@ -8,6 +8,7 @@ var $PARAMS; var $CONFIG; var $bdd; + var $actions; function load_config($bdd, $CONFIG){ if(true){ @@ -54,6 +55,46 @@ ) ); } + if(isset($app_config["subs"]["actions"][0]["subs"]["module"])){ + foreach($app_config["subs"]["actions"][0]["subs"]["module"] as $module_elt){ + $module_name = $module_elt["attrs"]["name"]; + if(!isset($this->actions[$module_name])) $this->actions[$module_name] = array( + "controleurs" => array(), + "module_allowed" => false, + "is_public" => false + ); + if(isset($module_elt["subs"]["controleur"])){ + foreach($module_elt["subs"]["controleur"] as $controleur_elt){ + $controleur_name = $controleur_elt["attrs"]["name"]; + if(!isset($this->actions[$module_name]["controleurs"][$controleur_name])) $this->actions[$module_name]["controleurs"][$controleur_name] = array( + "als" => array(), + "controleur_allowed" => false, + "is_public" => false + ); + if(isset($controleur_elt["subs"]["al"])){ + $al_index = 0; + foreach($controleur_elt["subs"]["al"] as $al_elt){ + $action_title = $al_elt["attrs"]["title"]; + if(isset($al_elt["subs"]["action"])){ + foreach($al_elt["subs"]["action"] as $action_elt){ + if(!isset($this->actions[$module_name]["controleurs"][$controleur_name]["als"][$al_index])){ + $this->actions[$module_name]["controleurs"][$controleur_name]["als"][$al_index] = array( + "title" => $action_title, + "action_allowed" => false, + "is_public" => false, + "actions" => array() + ); + } + $this->actions[$module_name]["controleurs"][$controleur_name]["als"][$al_index]["actions"][] = $action_elt["attrs"]["name"]; + } + } + $al_index++; + } + } + } + } + } + } } function get_config_file(){ @@ -123,6 +164,10 @@ return false; } + function get_actions(){ + return isset($this->actions) ? $this->actions : array(); + } + } ?> \ No newline at end of file