1
0
mirror of https://github.com/monstra-cms/monstra.git synced 2025-08-03 11:47:51 +02:00

Plugin API: Added ability to set view file from current theme folder

This commit is contained in:
Awilum
2012-09-30 22:42:39 +03:00
parent ca4f31a60b
commit 1b1f059f01

View File

@@ -288,7 +288,12 @@
public function __construct($view, array $variables = array()) {
// Set view file
$this->view_file = PLUGINS . DS . $view . '.view.php';
// From current theme folder or from plugin folder
if (File::exists($theme_view_file = THEMES_SITE . DS . Site::theme() . DS . $view . '.view.php') && BACKEND == false) {
$this->view_file = $theme_view_file;
} else {
$this->view_file = PLUGINS . DS . $view . '.view.php';
}
// Is view file exists ?
if (file_exists($this->view_file) === false) {