- function run($etat, $valid_status = true, $params = array(), $method = "GET"){
- if($this->set_etat($etat, $valid_status)){
- $controller_file = "mods/".$this->etat("mod")."/".$this->etat("controller").".php";
- if($this->app_file_exists($controller_file = "mods/".$this->etat("mod")."/".$this->etat("controller").".php", "DESC")){
- if(!class_exists("mw_mod")) require $this->app_file("mods/mw_mod.php");
- if(!class_exists($controller_class = "mw_".$this->etat("mod")."_".$this->etat("controller"))){
- require $this->app_file($controller_file, "DESC");
- }
- if(class_exists($controller_class)){
- $controller = new $controller_class();
- $action_method = $this->etat("action");
- if(method_exists($controller, $action_method)){
- foreach($params as $key => $value){
- switch(strtolower($method)){
- case "get": $_GET[$this->param($key)] = $value; break;
- case "post": $_POST[$key] = $value; break;
- default: break;
- }
+ function run($etat, $valid_role = true, $params = array(), $method = "GET"){
+ if($this->set_etat($etat, $valid_role)){
+ if($controller = $this->get_controller($this->etat("mod")."/".$this->etat("controller"))){
+ $action_method = $this->etat("action");
+ if(method_exists($controller, $action_method)){
+ foreach($params as $key => $value){
+ switch(strtolower($method)){
+ case "get": $_GET[$this->param($key)] = $value; break;
+ case "post": $_POST[$key] = $value; break;
+ default: break;