From c542ac20c9940e147e3bd02278e26b8f4c9a75ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jose=CC=81=20Lorenzo=20Rodri=CC=81guez?= Date: Sun, 5 Dec 2010 13:07:01 -0430 Subject: [PATCH] Moving core view to the new folder and allowing the view class to find those views --- lib/Cake/Core/App.php | 4 ++-- lib/Cake/Utility/ClassRegistry.php | 8 ++++---- .../view/scaffold.php => lib/Cake/View/ScaffoldView.php | 0 lib/Cake/View/View.php | 3 ++- .../Cake/View}/elements/email/html/default.ctp | 0 .../Cake/View}/elements/email/text/default.ctp | 0 .../Cake/View}/elements/exception_stack_trace.ctp | 0 {cake/libs/view => lib/Cake/View}/elements/sql_dump.ctp | 0 {cake/libs/view => lib/Cake/View}/errors/error400.ctp | 0 {cake/libs/view => lib/Cake/View}/errors/error500.ctp | 0 .../libs/view => lib/Cake/View}/errors/missing_action.ctp | 0 .../Cake/View}/errors/missing_behavior_class.ctp | 0 .../Cake/View}/errors/missing_behavior_file.ctp | 0 .../Cake/View}/errors/missing_component_class.ctp | 0 .../Cake/View}/errors/missing_component_file.ctp | 0 .../view => lib/Cake/View}/errors/missing_connection.ctp | 0 .../view => lib/Cake/View}/errors/missing_controller.ctp | 0 .../view => lib/Cake/View}/errors/missing_database.ctp | 0 .../Cake/View}/errors/missing_helper_class.ctp | 0 .../view => lib/Cake/View}/errors/missing_helper_file.ctp | 0 .../libs/view => lib/Cake/View}/errors/missing_layout.ctp | 0 .../libs/view => lib/Cake/View}/errors/missing_table.ctp | 0 {cake/libs/view => lib/Cake/View}/errors/missing_view.ctp | 0 .../libs/view => lib/Cake/View}/errors/private_action.ctp | 0 .../libs/view => lib/Cake/View}/errors/scaffold_error.ctp | 0 {cake/libs/view => lib/Cake/View}/layouts/ajax.ctp | 0 {cake/libs/view => lib/Cake/View}/layouts/default.ctp | 0 .../view => lib/Cake/View}/layouts/email/html/default.ctp | 0 .../view => lib/Cake/View}/layouts/email/text/default.ctp | 0 {cake/libs/view => lib/Cake/View}/layouts/flash.ctp | 0 {cake/libs/view => lib/Cake/View}/layouts/js/default.ctp | 0 {cake/libs/view => lib/Cake/View}/layouts/rss/default.ctp | 0 {cake/libs/view => lib/Cake/View}/layouts/xml/default.ctp | 0 {cake/libs/view => lib/Cake/View}/pages/home.ctp | 0 {cake/libs/view => lib/Cake/View}/scaffolds/edit.ctp | 0 {cake/libs/view => lib/Cake/View}/scaffolds/index.ctp | 0 {cake/libs/view => lib/Cake/View}/scaffolds/view.ctp | 0 37 files changed, 8 insertions(+), 7 deletions(-) rename cake/libs/view/scaffold.php => lib/Cake/View/ScaffoldView.php (100%) rename {cake/libs/view => lib/Cake/View}/elements/email/html/default.ctp (100%) rename {cake/libs/view => lib/Cake/View}/elements/email/text/default.ctp (100%) rename {cake/libs/view => lib/Cake/View}/elements/exception_stack_trace.ctp (100%) rename {cake/libs/view => lib/Cake/View}/elements/sql_dump.ctp (100%) rename {cake/libs/view => lib/Cake/View}/errors/error400.ctp (100%) rename {cake/libs/view => lib/Cake/View}/errors/error500.ctp (100%) rename {cake/libs/view => lib/Cake/View}/errors/missing_action.ctp (100%) rename {cake/libs/view => lib/Cake/View}/errors/missing_behavior_class.ctp (100%) rename {cake/libs/view => lib/Cake/View}/errors/missing_behavior_file.ctp (100%) rename {cake/libs/view => lib/Cake/View}/errors/missing_component_class.ctp (100%) rename {cake/libs/view => lib/Cake/View}/errors/missing_component_file.ctp (100%) rename {cake/libs/view => lib/Cake/View}/errors/missing_connection.ctp (100%) rename {cake/libs/view => lib/Cake/View}/errors/missing_controller.ctp (100%) rename {cake/libs/view => lib/Cake/View}/errors/missing_database.ctp (100%) rename {cake/libs/view => lib/Cake/View}/errors/missing_helper_class.ctp (100%) rename {cake/libs/view => lib/Cake/View}/errors/missing_helper_file.ctp (100%) rename {cake/libs/view => lib/Cake/View}/errors/missing_layout.ctp (100%) rename {cake/libs/view => lib/Cake/View}/errors/missing_table.ctp (100%) rename {cake/libs/view => lib/Cake/View}/errors/missing_view.ctp (100%) rename {cake/libs/view => lib/Cake/View}/errors/private_action.ctp (100%) rename {cake/libs/view => lib/Cake/View}/errors/scaffold_error.ctp (100%) rename {cake/libs/view => lib/Cake/View}/layouts/ajax.ctp (100%) rename {cake/libs/view => lib/Cake/View}/layouts/default.ctp (100%) rename {cake/libs/view => lib/Cake/View}/layouts/email/html/default.ctp (100%) rename {cake/libs/view => lib/Cake/View}/layouts/email/text/default.ctp (100%) rename {cake/libs/view => lib/Cake/View}/layouts/flash.ctp (100%) rename {cake/libs/view => lib/Cake/View}/layouts/js/default.ctp (100%) rename {cake/libs/view => lib/Cake/View}/layouts/rss/default.ctp (100%) rename {cake/libs/view => lib/Cake/View}/layouts/xml/default.ctp (100%) rename {cake/libs/view => lib/Cake/View}/pages/home.ctp (100%) rename {cake/libs/view => lib/Cake/View}/scaffolds/edit.ctp (100%) rename {cake/libs/view => lib/Cake/View}/scaffolds/index.ctp (100%) rename {cake/libs/view => lib/Cake/View}/scaffolds/view.ctp (100%) diff --git a/lib/Cake/Core/App.php b/lib/Cake/Core/App.php index fb4bdb9b3..6f04c7798 100644 --- a/lib/Cake/Core/App.php +++ b/lib/Cake/Core/App.php @@ -330,7 +330,7 @@ class App { static $paths = false; if (!$paths) { $paths = array(); - $libs = dirname(__FILE__) . DS; + $libs = LIBS; $cake = dirname($libs) . DS; $path = dirname($cake) . DS; @@ -341,7 +341,7 @@ class App { $paths['behaviors'][] = $libs . 'model' . DS . 'behaviors' . DS; $paths['controllers'][] = $libs . 'controller' . DS; $paths['components'][] = $libs . 'controller' . DS . 'components' . DS; - $paths['views'][] = $libs . 'view' . DS; + $paths['views'][] = $libs . 'View' . DS; $paths['helpers'][] = $libs . 'view' . DS . 'helpers' . DS; $paths['plugins'][] = $path . 'plugins' . DS; $paths['vendors'][] = $path . 'vendors' . DS; diff --git a/lib/Cake/Utility/ClassRegistry.php b/lib/Cake/Utility/ClassRegistry.php index a80abdc98..9762462ea 100644 --- a/lib/Cake/Utility/ClassRegistry.php +++ b/lib/Cake/Utility/ClassRegistry.php @@ -140,11 +140,11 @@ class ClassRegistry { if (class_exists($class)) { ${$class} = new $class($settings); } elseif ($type === 'Model') { - //if ($plugin && class_exists($plugin . 'AppModel')) { - // $appModel = $plugin . 'AppModel'; - //} else { + if ($plugin && class_exists($plugin . 'AppModel')) { + $appModel = $plugin . 'AppModel'; + } else { $appModel = 'AppModel'; - //} + } $settings['name'] = $class; ${$class} = new $appModel($settings); } diff --git a/cake/libs/view/scaffold.php b/lib/Cake/View/ScaffoldView.php similarity index 100% rename from cake/libs/view/scaffold.php rename to lib/Cake/View/ScaffoldView.php diff --git a/lib/Cake/View/View.php b/lib/Cake/View/View.php index c080ccc65..b0676d666 100644 --- a/lib/Cake/View/View.php +++ b/lib/Cake/View/View.php @@ -811,7 +811,8 @@ class View extends Object { } $paths[] = App::pluginPath($plugin) . 'views' . DS; } - $this->__paths = array_merge($paths, $viewPaths); + + $this->__paths = array_merge($paths, $viewPaths, array_flip($corePaths)); return $this->__paths; } } diff --git a/cake/libs/view/elements/email/html/default.ctp b/lib/Cake/View/elements/email/html/default.ctp similarity index 100% rename from cake/libs/view/elements/email/html/default.ctp rename to lib/Cake/View/elements/email/html/default.ctp diff --git a/cake/libs/view/elements/email/text/default.ctp b/lib/Cake/View/elements/email/text/default.ctp similarity index 100% rename from cake/libs/view/elements/email/text/default.ctp rename to lib/Cake/View/elements/email/text/default.ctp diff --git a/cake/libs/view/elements/exception_stack_trace.ctp b/lib/Cake/View/elements/exception_stack_trace.ctp similarity index 100% rename from cake/libs/view/elements/exception_stack_trace.ctp rename to lib/Cake/View/elements/exception_stack_trace.ctp diff --git a/cake/libs/view/elements/sql_dump.ctp b/lib/Cake/View/elements/sql_dump.ctp similarity index 100% rename from cake/libs/view/elements/sql_dump.ctp rename to lib/Cake/View/elements/sql_dump.ctp diff --git a/cake/libs/view/errors/error400.ctp b/lib/Cake/View/errors/error400.ctp similarity index 100% rename from cake/libs/view/errors/error400.ctp rename to lib/Cake/View/errors/error400.ctp diff --git a/cake/libs/view/errors/error500.ctp b/lib/Cake/View/errors/error500.ctp similarity index 100% rename from cake/libs/view/errors/error500.ctp rename to lib/Cake/View/errors/error500.ctp diff --git a/cake/libs/view/errors/missing_action.ctp b/lib/Cake/View/errors/missing_action.ctp similarity index 100% rename from cake/libs/view/errors/missing_action.ctp rename to lib/Cake/View/errors/missing_action.ctp diff --git a/cake/libs/view/errors/missing_behavior_class.ctp b/lib/Cake/View/errors/missing_behavior_class.ctp similarity index 100% rename from cake/libs/view/errors/missing_behavior_class.ctp rename to lib/Cake/View/errors/missing_behavior_class.ctp diff --git a/cake/libs/view/errors/missing_behavior_file.ctp b/lib/Cake/View/errors/missing_behavior_file.ctp similarity index 100% rename from cake/libs/view/errors/missing_behavior_file.ctp rename to lib/Cake/View/errors/missing_behavior_file.ctp diff --git a/cake/libs/view/errors/missing_component_class.ctp b/lib/Cake/View/errors/missing_component_class.ctp similarity index 100% rename from cake/libs/view/errors/missing_component_class.ctp rename to lib/Cake/View/errors/missing_component_class.ctp diff --git a/cake/libs/view/errors/missing_component_file.ctp b/lib/Cake/View/errors/missing_component_file.ctp similarity index 100% rename from cake/libs/view/errors/missing_component_file.ctp rename to lib/Cake/View/errors/missing_component_file.ctp diff --git a/cake/libs/view/errors/missing_connection.ctp b/lib/Cake/View/errors/missing_connection.ctp similarity index 100% rename from cake/libs/view/errors/missing_connection.ctp rename to lib/Cake/View/errors/missing_connection.ctp diff --git a/cake/libs/view/errors/missing_controller.ctp b/lib/Cake/View/errors/missing_controller.ctp similarity index 100% rename from cake/libs/view/errors/missing_controller.ctp rename to lib/Cake/View/errors/missing_controller.ctp diff --git a/cake/libs/view/errors/missing_database.ctp b/lib/Cake/View/errors/missing_database.ctp similarity index 100% rename from cake/libs/view/errors/missing_database.ctp rename to lib/Cake/View/errors/missing_database.ctp diff --git a/cake/libs/view/errors/missing_helper_class.ctp b/lib/Cake/View/errors/missing_helper_class.ctp similarity index 100% rename from cake/libs/view/errors/missing_helper_class.ctp rename to lib/Cake/View/errors/missing_helper_class.ctp diff --git a/cake/libs/view/errors/missing_helper_file.ctp b/lib/Cake/View/errors/missing_helper_file.ctp similarity index 100% rename from cake/libs/view/errors/missing_helper_file.ctp rename to lib/Cake/View/errors/missing_helper_file.ctp diff --git a/cake/libs/view/errors/missing_layout.ctp b/lib/Cake/View/errors/missing_layout.ctp similarity index 100% rename from cake/libs/view/errors/missing_layout.ctp rename to lib/Cake/View/errors/missing_layout.ctp diff --git a/cake/libs/view/errors/missing_table.ctp b/lib/Cake/View/errors/missing_table.ctp similarity index 100% rename from cake/libs/view/errors/missing_table.ctp rename to lib/Cake/View/errors/missing_table.ctp diff --git a/cake/libs/view/errors/missing_view.ctp b/lib/Cake/View/errors/missing_view.ctp similarity index 100% rename from cake/libs/view/errors/missing_view.ctp rename to lib/Cake/View/errors/missing_view.ctp diff --git a/cake/libs/view/errors/private_action.ctp b/lib/Cake/View/errors/private_action.ctp similarity index 100% rename from cake/libs/view/errors/private_action.ctp rename to lib/Cake/View/errors/private_action.ctp diff --git a/cake/libs/view/errors/scaffold_error.ctp b/lib/Cake/View/errors/scaffold_error.ctp similarity index 100% rename from cake/libs/view/errors/scaffold_error.ctp rename to lib/Cake/View/errors/scaffold_error.ctp diff --git a/cake/libs/view/layouts/ajax.ctp b/lib/Cake/View/layouts/ajax.ctp similarity index 100% rename from cake/libs/view/layouts/ajax.ctp rename to lib/Cake/View/layouts/ajax.ctp diff --git a/cake/libs/view/layouts/default.ctp b/lib/Cake/View/layouts/default.ctp similarity index 100% rename from cake/libs/view/layouts/default.ctp rename to lib/Cake/View/layouts/default.ctp diff --git a/cake/libs/view/layouts/email/html/default.ctp b/lib/Cake/View/layouts/email/html/default.ctp similarity index 100% rename from cake/libs/view/layouts/email/html/default.ctp rename to lib/Cake/View/layouts/email/html/default.ctp diff --git a/cake/libs/view/layouts/email/text/default.ctp b/lib/Cake/View/layouts/email/text/default.ctp similarity index 100% rename from cake/libs/view/layouts/email/text/default.ctp rename to lib/Cake/View/layouts/email/text/default.ctp diff --git a/cake/libs/view/layouts/flash.ctp b/lib/Cake/View/layouts/flash.ctp similarity index 100% rename from cake/libs/view/layouts/flash.ctp rename to lib/Cake/View/layouts/flash.ctp diff --git a/cake/libs/view/layouts/js/default.ctp b/lib/Cake/View/layouts/js/default.ctp similarity index 100% rename from cake/libs/view/layouts/js/default.ctp rename to lib/Cake/View/layouts/js/default.ctp diff --git a/cake/libs/view/layouts/rss/default.ctp b/lib/Cake/View/layouts/rss/default.ctp similarity index 100% rename from cake/libs/view/layouts/rss/default.ctp rename to lib/Cake/View/layouts/rss/default.ctp diff --git a/cake/libs/view/layouts/xml/default.ctp b/lib/Cake/View/layouts/xml/default.ctp similarity index 100% rename from cake/libs/view/layouts/xml/default.ctp rename to lib/Cake/View/layouts/xml/default.ctp diff --git a/cake/libs/view/pages/home.ctp b/lib/Cake/View/pages/home.ctp similarity index 100% rename from cake/libs/view/pages/home.ctp rename to lib/Cake/View/pages/home.ctp diff --git a/cake/libs/view/scaffolds/edit.ctp b/lib/Cake/View/scaffolds/edit.ctp similarity index 100% rename from cake/libs/view/scaffolds/edit.ctp rename to lib/Cake/View/scaffolds/edit.ctp diff --git a/cake/libs/view/scaffolds/index.ctp b/lib/Cake/View/scaffolds/index.ctp similarity index 100% rename from cake/libs/view/scaffolds/index.ctp rename to lib/Cake/View/scaffolds/index.ctp diff --git a/cake/libs/view/scaffolds/view.ctp b/lib/Cake/View/scaffolds/view.ctp similarity index 100% rename from cake/libs/view/scaffolds/view.ctp rename to lib/Cake/View/scaffolds/view.ctp