X-Git-Url: http://git.dj3c1t.com/index.cgi?a=blobdiff_plain;f=mw%2Fenv%2Fmodules%2Fmw_env_run.php;h=30d89cf08b062b2a0c0bb1b4dc18148f81a26914;hb=5dfe5e84a7007ddd9737707ce15f0155e6415066;hp=d4b63abf783db282251cb4fcee11d55ba95a0abe;hpb=2ff0191d4033a2e45ca57e478ff81132c132ed1f;p=mtweb diff --git a/mw/env/modules/mw_env_run.php b/mw/env/modules/mw_env_run.php index d4b63ab..30d89cf 100644 --- a/mw/env/modules/mw_env_run.php +++ b/mw/env/modules/mw_env_run.php @@ -152,7 +152,13 @@ } if(($controller_validate = $controller->validate($this)) === true){ if(($controller_prepare_inputs = $controller->prepare_inputs($this)) === true){ + $etat_before = $this->etat; + $this->call_observers("before_action"); $controller->$action_method($this); + $etat_after = $this->etat; + $this->etat = $etat_before; + $this->call_observers("after_action"); + $this->etat = $etat_after; } else $this->erreur($controller_prepare_inputs); } @@ -167,7 +173,18 @@ else $this->erreur("Impossible d'effectuer cette action"); } - function etat($name){ + function is_running($etat){ + if($etat = $this->valid_etat($etat)){ + return + ($etat["mod"] == $this->etat("mod")) + && ($etat["controller"] == $this->etat("controller")) + && ($etat["action"] == $this->etat("action")); + } + return false; + } + + function etat($name = null){ + if(!isset($name)) return $this->etat; return $this->etat[$name]; }