"Fixes #3675, View/ThemeView::renderElement() should reset plugin paths after rendering"

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6111 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2007-12-03 00:27:50 +00:00
parent 063faf5a9c
commit 1c8577ed34

View file

@ -102,6 +102,9 @@ class ThemeView extends View {
function renderElement($name, $params = array(), $loadHelpers = false) {
if (isset($params['plugin'])) {
$reset = array('plugin' => $this->plugin,
'pluginPath' => $this->pluginPath,
'pluginPaths' => $this->pluginPaths);
$this->plugin = $params['plugin'];
$this->pluginPath = 'plugins' . DS . $this->plugin . DS;
$this->pluginPaths = array(
@ -136,9 +139,8 @@ class ThemeView extends View {
if ($file) {
$params = array_merge_recursive($params, $this->loaded);
return $this->_render($file, array_merge($this->viewVars, $params), $loadHelpers);
}
$return = $this->_render($file, array_merge($this->viewVars, $params), $loadHelpers);
} else {
if (!is_null($this->pluginPath)) {
$file = APP . $this->pluginPath . $this->themeElement . $name . $this->ext;
} else {
@ -146,10 +148,19 @@ class ThemeView extends View {
}
if (Configure::read() > 0) {
return "Not Found: " . $file;
$return = 'Not Found: ' . $file;
}
}
if (isset($params['plugin'])) {
$this->plugin = $reset['plugin'];
$this->pluginPath = $reset['pluginPath'];
$this->pluginPaths = $reset['pluginPaths'];
}
return $return;
}
/**
* Enter description here...
*
@ -257,5 +268,4 @@ class ThemeView extends View {
return $layoutFileName;
}
}
?>