mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Bringing theme code up to date with 2.0, cleaning logic a bit
This commit is contained in:
parent
ea933fc58c
commit
715c848577
1 changed files with 6 additions and 11 deletions
|
@ -1094,25 +1094,20 @@ class View extends Object {
|
||||||
$paths = array_merge($paths, App::path('View', $plugin));
|
$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)) {
|
if (!empty($this->theme)) {
|
||||||
$skipPatterns = array(
|
|
||||||
DS . 'Cake' . DS . 'View' . DS,
|
|
||||||
DS . 'Cake' . DS . 'Console' . DS . 'Templates' . DS . 'skel' . DS . 'View' . DS
|
|
||||||
);
|
|
||||||
$themePaths = array();
|
$themePaths = array();
|
||||||
$count = count($paths);
|
foreach ($paths as $path) {
|
||||||
for ($i = 0; $i < $count; $i++) {
|
if (strpos($path, DS . 'Plugin' . DS) === false) {
|
||||||
if (strpos($paths[$i], DS . 'Plugin' . DS) === false
|
|
||||||
&& strpos($paths[$i], $skipPatterns[1]) === false && strpos($paths[$i], $skipPatterns[0]) === false) {
|
|
||||||
if ($plugin) {
|
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($themePaths, $paths);
|
||||||
}
|
}
|
||||||
|
$paths = array_merge($paths, $corePaths);
|
||||||
if ($plugin !== null) {
|
if ($plugin !== null) {
|
||||||
return $paths;
|
return $paths;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue