3 class mw_env_urls extends mw_env{
5 var $additional_get_params;
7 function init_additional_get_params(){
8 $this->additional_get_params = array();
9 $_params = $_SERVER["QUERY_STRING"];
10 $v_params = explode("&", $_params);
11 foreach($v_params as $param){
13 $key = strpos($param, "=") === false ? $param : substr($param, 0, strpos($param, "="));
14 $value = strpos($param, "=") === false ? "" : substr($param, strpos($param, "=") + 1);
15 if(!$this->is_a_param($key)) $this->additional_get_params[$key] = $value;
20 function is_a_param($key){
21 foreach($this->get_PARAMS() as $_key => $_value) if(strcmp($key, $_value) == 0) return true;
25 function url($action = "", $_params = array(), $script_name = "index.php"){
26 if($action) $_params["e"] = $action;
28 if(isset($this->additional_get_params)) foreach($this->additional_get_params as $key => $value) $get_params .= ($get_params ? "&" : "?").$key."=".$value;
29 foreach($_params as $key => $value) $get_params .= ($get_params ? "&" : "?").$this->param($key)."=".$value;
30 return $this->path("web").$script_name.$get_params;
33 function redirect($url, $message, $wait = 1){
34 $this->set_etat("reponses/html/redirect_javascript", false);
38 "url" => str_replace("&", "&", $url),
39 "message" => $message,