maj syntaxe accolades, maj jQuery, correction layout contact
[mtweb] / web / app / env / mw_env.php
1 <?php
2
3   class mw_env extends empty_class{
4
5     function app_file_exists($file, $PRIORITE = "ASC"){
6       $app_file = $this->_app_file($file, $PRIORITE);
7       return $app_file ? true : false;
8     }
9
10     function app_file($file, $PRIORITE = "ASC"){
11       $app_file = $this->_app_file($file, $PRIORITE);
12       return $app_file ? $app_file : $file;
13     }
14
15     function _app_file($file, $PRIORITE = "ASC"){
16       $app_file = false;
17       if($PRIORITE == "ASC" && file_exists($this->path("app").$file)) return $this->path("app").$file;
18       if(($plugins = $this->plugins($PRIORITE)) !== false){
19         foreach($plugins as $plugin_name => $plugin){
20           if($file && $plugin["installed"] && $plugin["enabled"] && file_exists($this->path("plugins").$plugin_name."/app/".$file)){
21             $app_file = $this->path("plugins").$plugin_name."/app/".$file;
22             break;
23           }
24         }
25         if($PRIORITE == "DESC" && !$app_file){
26           if(file_exists($this->path("app").$file)) $app_file = $this->path("app").$file;
27         }
28       }
29       return $app_file;
30     }
31
32   }
33
34 ?>