Skip to content

Commit

Permalink
Revert "Adding bake skeleton's view directory to view paths list to a…
Browse files Browse the repository at this point in the history
…void promlems with existing installation due to file moving done in earlier commit."

This reverts commit 5c792aa.
  • Loading branch information
lorenzo committed Feb 20, 2012
1 parent ee54dae commit cec9d2e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
3 changes: 1 addition & 2 deletions lib/Cake/Core/App.php
Expand Up @@ -838,8 +838,7 @@ protected static function _packageFormat() {
'%s' . 'Controller' . DS . 'Component' . DS . 'Acl' . DS
),
'View' => array(
'%s' . 'View' . DS,
CAKE . 'Console' . DS . 'Templates' . DS . 'skel' . DS . 'View' . DS
'%s' . 'View' . DS
),
'View/Helper' => array(
'%s' . 'View' . DS . 'Helper' . DS
Expand Down
3 changes: 1 addition & 2 deletions lib/Cake/Test/Case/Core/AppTest.php
Expand Up @@ -156,8 +156,7 @@ public function testCompatibleBuild() {
App::build(array('views' => array('/path/to/views/')));
$expected = array(
'/path/to/views/',
APP . 'View' . DS,
CAKE . 'Console' . DS . 'Templates' . DS . 'skel' . DS . 'View' . DS
APP . 'View' . DS
);
$result = App::path('views');
$this->assertEquals($expected, $result);
Expand Down
1 change: 0 additions & 1 deletion lib/Cake/Test/Case/View/ViewTest.php
Expand Up @@ -403,7 +403,6 @@ public function testPluginPathGeneration() {
$expected = array(
CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Plugin' . DS . 'TestPlugin' . DS,
$pluginPath . 'View' . DS,
CAKE . 'Console' . DS . 'Templates' . DS . 'skel' . DS . 'View' . DS,
CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS,
CAKE . 'View' . DS
);
Expand Down
15 changes: 8 additions & 7 deletions lib/Cake/View/View.php
Expand Up @@ -1096,14 +1096,15 @@ protected function _paths($plugin = null, $cached = true) {
$paths = array_unique(array_merge($paths, $viewPaths, array_keys($corePaths)));
if (!empty($this->theme)) {
$themePaths = array();
foreach ($paths as $path) {
if (strpos($path, DS . 'Plugin' . DS) === false
&& strpos($path, DS . 'Cake' . DS . 'View') === false) {
if ($plugin) {
$themePaths[] = $path . 'Themed'. DS . $this->theme . DS . 'Plugin' . DS . $plugin . DS;
$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) {
if ($plugin) {
$themePaths[] = $paths[$i] . '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);
}
Expand Down

0 comments on commit cec9d2e

Please sign in to comment.