reorganisation des dossiers
[mtweb] / mw / env / modules / mw_env_app_files.php
similarity index 53%
rename from web/app/env/mw_env.php
rename to mw/env/modules/mw_env_app_files.php
index 1b8aaf1..bb5816c 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-  class mw_env extends empty_class{
+  class mw_env_app_files extends mw_env{
 
     function app_file_exists($file, $PRIORITE = "ASC"){
       $app_file = $this->_app_file($file, $PRIORITE);
 
     function _app_file($file, $PRIORITE = "ASC"){
       $app_file = false;
-      if($PRIORITE == "ASC" && file_exists($this->path("app").$file)) return $this->path("app").$file;
+      if($PRIORITE == "ASC" && file_exists($this->path("mw_dir")."app/".$file)) return $this->path("mw_dir")."app/".$file;
       if(($plugins = $this->plugins($PRIORITE)) !== false){
         foreach($plugins as $plugin_name => $plugin){
-          if($file && $plugin["installed"] && $plugin["enabled"] && file_exists($this->path("plugins").$plugin_name."/app/".$file)){
-            $app_file = $this->path("plugins").$plugin_name."/app/".$file;
+          if(
+               $file
+            && $plugin["installed"]
+            && $plugin["enabled"]
+            && file_exists($this->path("mw_dir")."plugins/".$plugin_name."/app/".$file)
+          ){
+            $app_file = $this->path("mw_dir")."plugins/".$plugin_name."/app/".$file;
             break;
           }
         }
         if($PRIORITE == "DESC" && !$app_file){
-          if(file_exists($this->path("app").$file)) $app_file = $this->path("app").$file;
+          if(file_exists($this->path("mw_dir")."app/".$file)) $app_file = $this->path("mw_dir")."app/".$file;
         }
       }
       return $app_file;