_app_file($file, $PRIORITE); return $app_file ? true : false; } public function app_file($file, $PRIORITE = "ASC"){ $app_file = $this->_app_file($file, $PRIORITE); return $app_file ? $app_file : $file; } public function _app_file($file, $PRIORITE = "ASC"){ $app_file = false; 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("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("mw_dir")."app/".$file)) $app_file = $this->path("mw_dir")."app/".$file; } } return $app_file; } }