X-Git-Url: http://git.dj3c1t.com/?a=blobdiff_plain;f=web%2Fapp%2Fenv%2Fmw_env.php;h=1b8aaf16283639dd89c82e502c1a62561fadb777;hb=7cf7609a7e236347374c1b21777a9698bcd1726c;hp=83506098ed905cef317c9aeab7cde5cb0a539246;hpb=19b8f3b9263210d9154e7556446e903f84175519;p=mtweb diff --git a/web/app/env/mw_env.php b/web/app/env/mw_env.php index 8350609..1b8aaf1 100644 --- a/web/app/env/mw_env.php +++ b/web/app/env/mw_env.php @@ -1,30 +1,29 @@ _app_file($file, $PRIORITE); + function app_file_exists($file, $PRIORITE = "ASC"){ + $app_file = $this->_app_file($file, $PRIORITE); return $app_file ? true : false; } - function app_file($file, $PRIORITE = "ASC") - { $app_file = $this->_app_file($file, $PRIORITE); + function app_file($file, $PRIORITE = "ASC"){ + $app_file = $this->_app_file($file, $PRIORITE); return $app_file ? $app_file : $file; } - function _app_file($file, $PRIORITE = "ASC") - { $app_file = false; + function _app_file($file, $PRIORITE = "ASC"){ + $app_file = false; if($PRIORITE == "ASC" && file_exists($this->path("app").$file)) return $this->path("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(($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; break; } } - if($PRIORITE == "DESC" && !$app_file) - { if(file_exists($this->path("app").$file)) $app_file = $this->path("app").$file; + if($PRIORITE == "DESC" && !$app_file){ + if(file_exists($this->path("app").$file)) $app_file = $this->path("app").$file; } } return $app_file;