Merging fixes and enhancements into trunk

Revision: [1917]
Adding fix to pass args when using plugins.
Adding fix to allow plugin elements to be rendered properly

Revision: [1916]
Adding plugin layouts to search path if a plugin is being accessed.
If no layout is found then the app/views/layouts/*.thtml will be used.

git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1918 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2006-02-03 06:06:15 +00:00
parent 50a71fa777
commit 3229567cbd
3 changed files with 23 additions and 1 deletions

View file

@ -6,4 +6,4 @@
// +---------------------------------------------------------------------------------------------------+ //
///////////////////////////////////////////////////////////////////////////////////////////////////////////
0.10.8.1915 RC 4
0.10.8.1918 RC 4

View file

@ -407,6 +407,7 @@ class Dispatcher extends Object
if(isset($params['pass'][0]))
{
$params['action'] = $params['pass'][0];
array_shift($params['pass']);
}
else
{

View file

@ -401,10 +401,21 @@ class View extends Object
{
$fn = ELEMENTS.$name.$this->ext;
if(!is_null($this->plugin))
{
if(file_exists(APP.'plugins'.DS.$this->plugin.'views'.DS.'elements'.DS.$name.$this->ext))
{
$fn = APP.'plugins'.DS.$this->plugin.'views'.DS.'elements'.DS.$name.$this->ext;
$params = array_merge_recursive($params, $this->loaded);
return $this->_render($fn, array_merge($this->_viewVars, $params), true, false);
}
}
if (!file_exists($fn))
{
return "(Error rendering {$name})";
}
$params = array_merge_recursive($params, $this->loaded);
return $this->_render($fn, array_merge($this->_viewVars, $params), true, false);
}
@ -556,6 +567,16 @@ class View extends Object
{
$type = null;
}
if(!is_null($this->plugin))
{
if(file_exists(APP.'plugins'.DS.$this->plugin.'views'.DS.'layouts'.DS.$this->layout.$this->ext))
{
$layoutFileName = APP.'plugins'.DS.$this->plugin.'views'.DS.'layouts'.DS.$this->layout.$this->ext;
return $layoutFileName;
}
}
$layoutFileName = LAYOUTS.$type."{$this->layout}$this->ext";
if(file_exists(LAYOUTS.$this->subDir.$type."{$this->layout}$this->ext"))