Skip to content
Permalink
Browse files

Bringing theme code up to date with 2.0, cleaning logic a bit

  • Loading branch information...
lorenzo committed Feb 20, 2012
1 parent ea933fc commit 715c8485771fe7fc3418cd29a24d8ba362efb4aa
Showing with 6 additions and 11 deletions.
  1. +6 −11 lib/Cake/View/View.php
@@ -1094,25 +1094,20 @@ protected function _paths($plugin = null, $cached = true) {
$paths = array_merge($paths, App::path('View', $plugin));
}
$paths = array_unique(array_merge($paths, $viewPaths, $corePaths));
$paths = array_unique(array_merge($paths, $viewPaths));
if (!empty($this->theme)) {
$skipPatterns = array(
DS . 'Cake' . DS . 'View' . DS,
DS . 'Cake' . DS . 'Console' . DS . 'Templates' . DS . 'skel' . DS . 'View' . DS
);
$themePaths = array();
$count = count($paths);
for ($i = 0; $i < $count; $i++) {
if (strpos($paths[$i], DS . 'Plugin' . DS) === false
&& strpos($paths[$i], $skipPatterns[1]) === false && strpos($paths[$i], $skipPatterns[0]) === false) {
foreach ($paths as $path) {
if (strpos($path, DS . 'Plugin' . DS) === 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);
}
$paths = array_merge($paths, $corePaths);
if ($plugin !== null) {
return $paths;
}

0 comments on commit 715c848

Please sign in to comment.
You can’t perform that action at this time.