From 1b1f059f01bbfbf1f807231817393c27c28e0ac0 Mon Sep 17 00:00:00 2001 From: Awilum Date: Sun, 30 Sep 2012 22:42:39 +0300 Subject: [PATCH] Plugin API: Added ability to set view file from current theme folder --- monstra/engine/plugins.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/monstra/engine/plugins.php b/monstra/engine/plugins.php index dc2752e..1747027 100644 --- a/monstra/engine/plugins.php +++ b/monstra/engine/plugins.php @@ -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) {