Fix issues with sparse arrays in ThemeView.

Fixes #2500
This commit is contained in:
mark_story 2012-01-23 20:22:06 -05:00
parent c877d17f86
commit 354716cf60

View file

@ -57,14 +57,13 @@ class ThemeView extends View {
$themePaths = array();
if (!empty($this->theme)) {
$count = count($paths);
for ($i = 0; $i < $count; $i++) {
if (strpos($paths[$i], DS . 'Plugin' . DS) === false
&& strpos($paths[$i], DS . 'Cake' . DS . 'View') === false) {
foreach ($paths as $path) {
if (strpos($path, DS . 'Plugin' . DS) === false
&& strpos($path, DS . 'Cake' . DS . 'View') === false) {
if ($plugin) {
$themePaths[] = $paths[$i] . 'Themed'. DS . $this->theme . DS . 'Plugin' . DS . $plugin . DS;
$themePaths[] = $path . 'Themed'. DS . $this->theme . DS . 'Plugin' . DS . $plugin . DS;
}
$themePaths[] = $paths[$i] . 'Themed'. DS . $this->theme . DS;
$themePaths[] = $path . 'Themed'. DS . $this->theme . DS;
}
}
$paths = array_merge($themePaths, $paths);