mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
"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:
parent
063faf5a9c
commit
1c8577ed34
1 changed files with 19 additions and 9 deletions
|
@ -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,18 +139,26 @@ class ThemeView extends View {
|
|||
|
||||
if ($file) {
|
||||
$params = array_merge_recursive($params, $this->loaded);
|
||||
return $this->_render($file, array_merge($this->viewVars, $params), $loadHelpers);
|
||||
}
|
||||
|
||||
if (!is_null($this->pluginPath)) {
|
||||
$file = APP . $this->pluginPath . $this->themeElement . $name . $this->ext;
|
||||
$return = $this->_render($file, array_merge($this->viewVars, $params), $loadHelpers);
|
||||
} else {
|
||||
$file = VIEWS . $this->themeElement . $name . $this->ext;
|
||||
if (!is_null($this->pluginPath)) {
|
||||
$file = APP . $this->pluginPath . $this->themeElement . $name . $this->ext;
|
||||
} else {
|
||||
$file = VIEWS . $this->themeElement . $name . $this->ext;
|
||||
}
|
||||
|
||||
if (Configure::read() > 0) {
|
||||
$return = 'Not Found: ' . $file;
|
||||
}
|
||||
}
|
||||
|
||||
if (Configure::read() > 0) {
|
||||
return "Not Found: " . $file;
|
||||
if (isset($params['plugin'])) {
|
||||
$this->plugin = $reset['plugin'];
|
||||
$this->pluginPath = $reset['pluginPath'];
|
||||
$this->pluginPaths = $reset['pluginPaths'];
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -257,5 +268,4 @@ class ThemeView extends View {
|
|||
return $layoutFileName;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
Loading…
Reference in a new issue