static function display($path, $position = "after") { $return = ""; $plugin_view = false; $view_extensions = self::getAll(); $plugins = Plugin::getEnabledPlugins(true); if (isset($view_extensions[$path])) { $extend_paths = $view_extensions[$path]; foreach ($extend_paths as $extend_path) { if ($extend_path['placement'] == $position) { // Check if view exists in plugins first if ($plugins) { foreach ($plugins as $plugin) { $name = $plugin->name; if (file_exists(SITEPATH . "plugins/{$name}/views/{$extend_path['src']}.php")) { $return .= Page::getRenderedHTML(SITEPATH . "plugins/{$name}/views/{$extend_path['src']}.php"); } if (file_exists(SITEPATH . "core_plugins/{$name}/views/{$extend_path['src']}.php")) { $return .= Page::getRenderedHTML(SITEPATH . "core_plugins/{$name}/views/{$extend_path['src']}.php"); } } } $file_path = SITEPATH . "views/" . $extend_path['src'] . ".php"; if (file_exists($file_path)) { $return .= Page::getRenderedHTML($file_path); } } } } return $return; }