cakephp2-php8/cake/libs/controller/scaffold.php

466 lines
17 KiB
PHP
Raw Normal View History

<?php
/* SVN FILE: $Id$ */
/**
* Scaffold.
*
* Automatic forms and actions generation for rapid web application development.
*
* PHP versions 4 and 5
*
* CakePHP : Rapid Development Framework <http://www.cakephp.org/>
Merging: Revision: [1638] removing php short tags Revision: [1637] Remove renderElememnts loading of helpers also, forgot it in the last commit Revision: [1636] Refactoring after profiling code. Session was creating a new instance of Dispatcher removed the need for it. Added a check to the Component class to pass the base to the SessionComponent class, will refactor that at a later time. Changed View class so it would not load helpers when rending a layout, no need for that. A great performance boost after the change. Change the loadModels method call in app/webroot/index.php. Will only attempt the loadModels call if the AppModel class is not in memory, and the Database class is in memory. Removed all unnecessary calls to basics uses(). Again another big performance increase. Added fix to the Html::guiListTree() after discussing the output that is expected. A ticket was closed on this already. Revision: [1635] Removing calls to basic uses() Revision: [1634] Removing calls to basics uses() that are not needed. Revision: [1633] Removing calls to basics uses() that are not needed. Moved Object class further up in the loading order Revision: [1632] adding fix for Ticket #132 Revision: [1631] Added fix from Ticket #122 Revision: [1630] Scaffold views can now be placed in a view directory. These will override the core. Example (Must have the scaffold dot name): app/views/posts/scaffold.list.thtml app/views/posts/scaffold.new.thtml app/views/posts/scaffold.edit.thtml app/views/posts/scaffold.show.thtml Revision: [1629] Think I fixed the issue with scaffold showing proper dates prior to January 1 1970 00:00:00. Revision: [1628] Added a few more change to allow saving dates prior to January 1 1970 00:00:00. Still a few issues with this, but will get them figured out soon. Changed scaffold to use only one form view. Revision: [1627] Added fix for Ticket #189 Revision: [1626] Added fix for Ticket #120. Revision: [1625] left justified doc blocks Revision: [1624] remove files from uses() that are loaded by default in app/webroot/index.php no reason to attempt to load them again in the classes Revision: [1623] adding check to the loadModels and loadController that will only attempt to load files if the classes are not already in memory Revision: [1622] Adding fix to time helper that was lost in a previous merge Removing all tabs from code Revision: [1621] Addtional model validation fixes Revision: [1620] fixed parse error Revision: [1619] Fixing ticket #102 Revision: [1618] correcting mime types and keywords Revision: [1617] correcting mime types and keywords Revision: [1616] fixed link in footer Revision: [1615] Fixing ticket #207 git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1639 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-12-27 03:33:44 +00:00
* Copyright (c) 2005, Cake Software Foundation, Inc.
* 1785 E. Sahara Avenue, Suite 490-204
* Las Vegas, Nevada 89104
Merging: Revision: [1638] removing php short tags Revision: [1637] Remove renderElememnts loading of helpers also, forgot it in the last commit Revision: [1636] Refactoring after profiling code. Session was creating a new instance of Dispatcher removed the need for it. Added a check to the Component class to pass the base to the SessionComponent class, will refactor that at a later time. Changed View class so it would not load helpers when rending a layout, no need for that. A great performance boost after the change. Change the loadModels method call in app/webroot/index.php. Will only attempt the loadModels call if the AppModel class is not in memory, and the Database class is in memory. Removed all unnecessary calls to basics uses(). Again another big performance increase. Added fix to the Html::guiListTree() after discussing the output that is expected. A ticket was closed on this already. Revision: [1635] Removing calls to basic uses() Revision: [1634] Removing calls to basics uses() that are not needed. Revision: [1633] Removing calls to basics uses() that are not needed. Moved Object class further up in the loading order Revision: [1632] adding fix for Ticket #132 Revision: [1631] Added fix from Ticket #122 Revision: [1630] Scaffold views can now be placed in a view directory. These will override the core. Example (Must have the scaffold dot name): app/views/posts/scaffold.list.thtml app/views/posts/scaffold.new.thtml app/views/posts/scaffold.edit.thtml app/views/posts/scaffold.show.thtml Revision: [1629] Think I fixed the issue with scaffold showing proper dates prior to January 1 1970 00:00:00. Revision: [1628] Added a few more change to allow saving dates prior to January 1 1970 00:00:00. Still a few issues with this, but will get them figured out soon. Changed scaffold to use only one form view. Revision: [1627] Added fix for Ticket #189 Revision: [1626] Added fix for Ticket #120. Revision: [1625] left justified doc blocks Revision: [1624] remove files from uses() that are loaded by default in app/webroot/index.php no reason to attempt to load them again in the classes Revision: [1623] adding check to the loadModels and loadController that will only attempt to load files if the classes are not already in memory Revision: [1622] Adding fix to time helper that was lost in a previous merge Removing all tabs from code Revision: [1621] Addtional model validation fixes Revision: [1620] fixed parse error Revision: [1619] Fixing ticket #102 Revision: [1618] correcting mime types and keywords Revision: [1617] correcting mime types and keywords Revision: [1616] fixed link in footer Revision: [1615] Fixing ticket #207 git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1639 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-12-27 03:33:44 +00:00
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
Merging: Revision: [1638] removing php short tags Revision: [1637] Remove renderElememnts loading of helpers also, forgot it in the last commit Revision: [1636] Refactoring after profiling code. Session was creating a new instance of Dispatcher removed the need for it. Added a check to the Component class to pass the base to the SessionComponent class, will refactor that at a later time. Changed View class so it would not load helpers when rending a layout, no need for that. A great performance boost after the change. Change the loadModels method call in app/webroot/index.php. Will only attempt the loadModels call if the AppModel class is not in memory, and the Database class is in memory. Removed all unnecessary calls to basics uses(). Again another big performance increase. Added fix to the Html::guiListTree() after discussing the output that is expected. A ticket was closed on this already. Revision: [1635] Removing calls to basic uses() Revision: [1634] Removing calls to basics uses() that are not needed. Revision: [1633] Removing calls to basics uses() that are not needed. Moved Object class further up in the loading order Revision: [1632] adding fix for Ticket #132 Revision: [1631] Added fix from Ticket #122 Revision: [1630] Scaffold views can now be placed in a view directory. These will override the core. Example (Must have the scaffold dot name): app/views/posts/scaffold.list.thtml app/views/posts/scaffold.new.thtml app/views/posts/scaffold.edit.thtml app/views/posts/scaffold.show.thtml Revision: [1629] Think I fixed the issue with scaffold showing proper dates prior to January 1 1970 00:00:00. Revision: [1628] Added a few more change to allow saving dates prior to January 1 1970 00:00:00. Still a few issues with this, but will get them figured out soon. Changed scaffold to use only one form view. Revision: [1627] Added fix for Ticket #189 Revision: [1626] Added fix for Ticket #120. Revision: [1625] left justified doc blocks Revision: [1624] remove files from uses() that are loaded by default in app/webroot/index.php no reason to attempt to load them again in the classes Revision: [1623] adding check to the loadModels and loadController that will only attempt to load files if the classes are not already in memory Revision: [1622] Adding fix to time helper that was lost in a previous merge Removing all tabs from code Revision: [1621] Addtional model validation fixes Revision: [1620] fixed parse error Revision: [1619] Fixing ticket #102 Revision: [1618] correcting mime types and keywords Revision: [1617] correcting mime types and keywords Revision: [1616] fixed link in footer Revision: [1615] Fixing ticket #207 git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1639 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-12-27 03:33:44 +00:00
* @filesource
* @copyright Copyright (c) 2005, Cake Software Foundation, Inc.
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project
* @package cake
Merging from sandboxes [1079] Merged [1005] committed by nate but not added to core prior to release. Merged [1078] prior to modifying all developers sandboxes. [1081] adding view and template directories [1082] adding base files for view generator [1083] correcting all package and sub package tags for in doc blocks. Making sure every file in the core has doc block in them [1084] renaming working copy of latest release [1093] Added fix for associations using underscores if var $useTable is set in the associated models. This closes ticket #11. [1094] Fix for Ticket #24. The problem was tracked to a variable in View::_render(); $loadedHelpers was being assigned a reference when it when it should not have been. [1096] Initial work on controller components needs testing. Also added a work around for the basics.php uses(). Using the define DS where the files from the original version are now located in deeper libs directories. [1097] committing a few typos in the code I added [1098] reformatting code in component.php [1104] changed the test route and corrected a regex in inflector. [1111] removing the contructor from dispatcher, it is not needed [1112] Changes made for errors when a file is not present in webroot. Fixed the regex used in Router::parse(). Change the error layout template. [1113] Changes to Folder class to allow setting the permissions mode when constructing. This class needs to be refactored and move everything that is in the contructor out. The constructor should set the vars for use in other Folder::"methods"(). Will work on this at a later time. git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1114 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-09 01:56:21 +00:00
* @subpackage cake.cake.libs.controller
* @since Cake v 0.10.0.1076
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
/**
* Scaffolding is a set of automatic views, forms and controllers for starting web development work faster.
*
* Scaffold inspects your database tables, and making educated guesses, sets up a
* number of pages for each of your Models. These pages have data forms that work,
* and afford the web developer an early look at the data, and the possibility to over-ride
* scaffolded actions with custom-made ones.
*
* @package cake
Merging from sandboxes [1079] Merged [1005] committed by nate but not added to core prior to release. Merged [1078] prior to modifying all developers sandboxes. [1081] adding view and template directories [1082] adding base files for view generator [1083] correcting all package and sub package tags for in doc blocks. Making sure every file in the core has doc block in them [1084] renaming working copy of latest release [1093] Added fix for associations using underscores if var $useTable is set in the associated models. This closes ticket #11. [1094] Fix for Ticket #24. The problem was tracked to a variable in View::_render(); $loadedHelpers was being assigned a reference when it when it should not have been. [1096] Initial work on controller components needs testing. Also added a work around for the basics.php uses(). Using the define DS where the files from the original version are now located in deeper libs directories. [1097] committing a few typos in the code I added [1098] reformatting code in component.php [1104] changed the test route and corrected a regex in inflector. [1111] removing the contructor from dispatcher, it is not needed [1112] Changes made for errors when a file is not present in webroot. Fixed the regex used in Router::parse(). Change the error layout template. [1113] Changes to Folder class to allow setting the permissions mode when constructing. This class needs to be refactored and move everything that is in the contructor out. The constructor should set the vars for use in other Folder::"methods"(). Will work on this at a later time. git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1114 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-09 01:56:21 +00:00
* @subpackage cake.cake.libs.controller
* @since Cake v 0.10.0.1076
*/
class Scaffold extends Object {
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
/**
* Name of view to render
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
*
* @var string
*/
var $actionView = null;
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
/**
* Class name of model
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
*
* @var unknown_type
*/
var $modelKey = null;
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
/**
* Controller object
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
*
* @var Controller
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
*/
var $controllerClass = null;
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
/**
* Name of scaffolded Model
*
* @var string
*/
var $modelName = null;
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
/**
* Title HTML element for current scaffolded view
*
* @var string
*/
var $scaffoldTitle = null;
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
/**
* Base URL
*
* @var string
*/
var $base = false;
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
/**
* Construct and set up given controller with given parameters.
*
* @param string $controller_class Name of controller
* @param array $params
*/
function __construct(&$controller, $params)
{
$this->controllerClass =& $controller;
$this->actionView = $controller->action;
$this->modelKey = Inflector::singularize($controller->name);
$this->scaffoldTitle = Inflector::humanize($this->modelKey);
Merging: Revision: [1638] removing php short tags Revision: [1637] Remove renderElememnts loading of helpers also, forgot it in the last commit Revision: [1636] Refactoring after profiling code. Session was creating a new instance of Dispatcher removed the need for it. Added a check to the Component class to pass the base to the SessionComponent class, will refactor that at a later time. Changed View class so it would not load helpers when rending a layout, no need for that. A great performance boost after the change. Change the loadModels method call in app/webroot/index.php. Will only attempt the loadModels call if the AppModel class is not in memory, and the Database class is in memory. Removed all unnecessary calls to basics uses(). Again another big performance increase. Added fix to the Html::guiListTree() after discussing the output that is expected. A ticket was closed on this already. Revision: [1635] Removing calls to basic uses() Revision: [1634] Removing calls to basics uses() that are not needed. Revision: [1633] Removing calls to basics uses() that are not needed. Moved Object class further up in the loading order Revision: [1632] adding fix for Ticket #132 Revision: [1631] Added fix from Ticket #122 Revision: [1630] Scaffold views can now be placed in a view directory. These will override the core. Example (Must have the scaffold dot name): app/views/posts/scaffold.list.thtml app/views/posts/scaffold.new.thtml app/views/posts/scaffold.edit.thtml app/views/posts/scaffold.show.thtml Revision: [1629] Think I fixed the issue with scaffold showing proper dates prior to January 1 1970 00:00:00. Revision: [1628] Added a few more change to allow saving dates prior to January 1 1970 00:00:00. Still a few issues with this, but will get them figured out soon. Changed scaffold to use only one form view. Revision: [1627] Added fix for Ticket #189 Revision: [1626] Added fix for Ticket #120. Revision: [1625] left justified doc blocks Revision: [1624] remove files from uses() that are loaded by default in app/webroot/index.php no reason to attempt to load them again in the classes Revision: [1623] adding check to the loadModels and loadController that will only attempt to load files if the classes are not already in memory Revision: [1622] Adding fix to time helper that was lost in a previous merge Removing all tabs from code Revision: [1621] Addtional model validation fixes Revision: [1620] fixed parse error Revision: [1619] Fixing ticket #102 Revision: [1618] correcting mime types and keywords Revision: [1617] correcting mime types and keywords Revision: [1616] fixed link in footer Revision: [1615] Fixing ticket #207 git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1639 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-12-27 03:33:44 +00:00
$this->viewPath = Inflector::underscore($controller->name);
$this->controllerClass->pageTitle = $this->scaffoldTitle;
$this->_renderScaffold($params);
}
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
/**
* Private method to render Scaffold.
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
*
* @param array $params
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
* @access private
*/
function _renderScaffold($params)
{
$this->_scaffoldView($params);
}
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
/**
* Renders the List view as the default action (index).
*
* @param array $params
* @return Scaffold::_scaffoldList();
* @access private
*/
function _scaffoldIndex($params)
{
$this->controllerClass->pageTitle = Inflector::humanize(Inflector::pluralize($this->modelKey));
return $this->_scaffoldList($params);
}
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
/**
* Renders a Show view of scaffolded Model.
*
* @param array $params
* @return A rendered view of a row from Models database table
* @access private
*/
function _scaffoldShow($params)
{
$this->controllerClass->params['data'] = $this->controllerClass->{$this->modelKey}->read();
$this->controllerClass->set('data', $this->controllerClass->params['data'] );
$this->controllerClass->set('fieldNames', $this->controllerClass->generateFieldNames( $this->controllerClass->params['data'], false ) );
Merging: Revision: [1638] removing php short tags Revision: [1637] Remove renderElememnts loading of helpers also, forgot it in the last commit Revision: [1636] Refactoring after profiling code. Session was creating a new instance of Dispatcher removed the need for it. Added a check to the Component class to pass the base to the SessionComponent class, will refactor that at a later time. Changed View class so it would not load helpers when rending a layout, no need for that. A great performance boost after the change. Change the loadModels method call in app/webroot/index.php. Will only attempt the loadModels call if the AppModel class is not in memory, and the Database class is in memory. Removed all unnecessary calls to basics uses(). Again another big performance increase. Added fix to the Html::guiListTree() after discussing the output that is expected. A ticket was closed on this already. Revision: [1635] Removing calls to basic uses() Revision: [1634] Removing calls to basics uses() that are not needed. Revision: [1633] Removing calls to basics uses() that are not needed. Moved Object class further up in the loading order Revision: [1632] adding fix for Ticket #132 Revision: [1631] Added fix from Ticket #122 Revision: [1630] Scaffold views can now be placed in a view directory. These will override the core. Example (Must have the scaffold dot name): app/views/posts/scaffold.list.thtml app/views/posts/scaffold.new.thtml app/views/posts/scaffold.edit.thtml app/views/posts/scaffold.show.thtml Revision: [1629] Think I fixed the issue with scaffold showing proper dates prior to January 1 1970 00:00:00. Revision: [1628] Added a few more change to allow saving dates prior to January 1 1970 00:00:00. Still a few issues with this, but will get them figured out soon. Changed scaffold to use only one form view. Revision: [1627] Added fix for Ticket #189 Revision: [1626] Added fix for Ticket #120. Revision: [1625] left justified doc blocks Revision: [1624] remove files from uses() that are loaded by default in app/webroot/index.php no reason to attempt to load them again in the classes Revision: [1623] adding check to the loadModels and loadController that will only attempt to load files if the classes are not already in memory Revision: [1622] Adding fix to time helper that was lost in a previous merge Removing all tabs from code Revision: [1621] Addtional model validation fixes Revision: [1620] fixed parse error Revision: [1619] Fixing ticket #102 Revision: [1618] correcting mime types and keywords Revision: [1617] correcting mime types and keywords Revision: [1616] fixed link in footer Revision: [1615] Fixing ticket #207 git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1639 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-12-27 03:33:44 +00:00
if(file_exists(APP.'views'.DS.$this->viewPath.DS.'scaffold.show.thtml'))
{
return $this->controllerClass->render($this->actionView, '', APP.'views'.DS.$this->viewPath.DS.'scaffold.show.thtml');
}
return $this->controllerClass->render($this->actionView, '', LIBS.'view'.DS.'templates'.DS.'scaffolds'.DS.'show.thtml');
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
}
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
/**
* Renders List view of scaffolded Model.
*
* @param array $params
* @return A rendered view listing rows from Models database table
* @access private
*/
function _scaffoldList($params)
{
$this->controllerClass->set('fieldNames', $this->controllerClass->generateFieldNames(null,false) );
$this->controllerClass->set('data', $this->controllerClass->{$this->modelKey}->findAll());
Merging: Revision: [1638] removing php short tags Revision: [1637] Remove renderElememnts loading of helpers also, forgot it in the last commit Revision: [1636] Refactoring after profiling code. Session was creating a new instance of Dispatcher removed the need for it. Added a check to the Component class to pass the base to the SessionComponent class, will refactor that at a later time. Changed View class so it would not load helpers when rending a layout, no need for that. A great performance boost after the change. Change the loadModels method call in app/webroot/index.php. Will only attempt the loadModels call if the AppModel class is not in memory, and the Database class is in memory. Removed all unnecessary calls to basics uses(). Again another big performance increase. Added fix to the Html::guiListTree() after discussing the output that is expected. A ticket was closed on this already. Revision: [1635] Removing calls to basic uses() Revision: [1634] Removing calls to basics uses() that are not needed. Revision: [1633] Removing calls to basics uses() that are not needed. Moved Object class further up in the loading order Revision: [1632] adding fix for Ticket #132 Revision: [1631] Added fix from Ticket #122 Revision: [1630] Scaffold views can now be placed in a view directory. These will override the core. Example (Must have the scaffold dot name): app/views/posts/scaffold.list.thtml app/views/posts/scaffold.new.thtml app/views/posts/scaffold.edit.thtml app/views/posts/scaffold.show.thtml Revision: [1629] Think I fixed the issue with scaffold showing proper dates prior to January 1 1970 00:00:00. Revision: [1628] Added a few more change to allow saving dates prior to January 1 1970 00:00:00. Still a few issues with this, but will get them figured out soon. Changed scaffold to use only one form view. Revision: [1627] Added fix for Ticket #189 Revision: [1626] Added fix for Ticket #120. Revision: [1625] left justified doc blocks Revision: [1624] remove files from uses() that are loaded by default in app/webroot/index.php no reason to attempt to load them again in the classes Revision: [1623] adding check to the loadModels and loadController that will only attempt to load files if the classes are not already in memory Revision: [1622] Adding fix to time helper that was lost in a previous merge Removing all tabs from code Revision: [1621] Addtional model validation fixes Revision: [1620] fixed parse error Revision: [1619] Fixing ticket #102 Revision: [1618] correcting mime types and keywords Revision: [1617] correcting mime types and keywords Revision: [1616] fixed link in footer Revision: [1615] Fixing ticket #207 git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1639 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-12-27 03:33:44 +00:00
if(file_exists(APP.'views'.DS.$this->viewPath.DS.'scaffold.list.thtml'))
{
return $this->controllerClass->render($this->actionView, '', APP.'views'.DS.$this->viewPath.DS.'scaffold.list.thtml');
}
return $this->controllerClass->render($this->actionView, '', LIBS.'view'.DS.'templates'.DS.'scaffolds'.DS.'list.thtml');
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
}
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
/**
* Creates a new scaffold.
*
* @param array $params
* @return A rendered view with a form to create a new row in the Models database table
* @access private
*/
function _scaffoldNew($params)
{
$this->controllerClass->set('fieldNames', $this->controllerClass->generateFieldNames() );
Merging: Revision: [1638] removing php short tags Revision: [1637] Remove renderElememnts loading of helpers also, forgot it in the last commit Revision: [1636] Refactoring after profiling code. Session was creating a new instance of Dispatcher removed the need for it. Added a check to the Component class to pass the base to the SessionComponent class, will refactor that at a later time. Changed View class so it would not load helpers when rending a layout, no need for that. A great performance boost after the change. Change the loadModels method call in app/webroot/index.php. Will only attempt the loadModels call if the AppModel class is not in memory, and the Database class is in memory. Removed all unnecessary calls to basics uses(). Again another big performance increase. Added fix to the Html::guiListTree() after discussing the output that is expected. A ticket was closed on this already. Revision: [1635] Removing calls to basic uses() Revision: [1634] Removing calls to basics uses() that are not needed. Revision: [1633] Removing calls to basics uses() that are not needed. Moved Object class further up in the loading order Revision: [1632] adding fix for Ticket #132 Revision: [1631] Added fix from Ticket #122 Revision: [1630] Scaffold views can now be placed in a view directory. These will override the core. Example (Must have the scaffold dot name): app/views/posts/scaffold.list.thtml app/views/posts/scaffold.new.thtml app/views/posts/scaffold.edit.thtml app/views/posts/scaffold.show.thtml Revision: [1629] Think I fixed the issue with scaffold showing proper dates prior to January 1 1970 00:00:00. Revision: [1628] Added a few more change to allow saving dates prior to January 1 1970 00:00:00. Still a few issues with this, but will get them figured out soon. Changed scaffold to use only one form view. Revision: [1627] Added fix for Ticket #189 Revision: [1626] Added fix for Ticket #120. Revision: [1625] left justified doc blocks Revision: [1624] remove files from uses() that are loaded by default in app/webroot/index.php no reason to attempt to load them again in the classes Revision: [1623] adding check to the loadModels and loadController that will only attempt to load files if the classes are not already in memory Revision: [1622] Adding fix to time helper that was lost in a previous merge Removing all tabs from code Revision: [1621] Addtional model validation fixes Revision: [1620] fixed parse error Revision: [1619] Fixing ticket #102 Revision: [1618] correcting mime types and keywords Revision: [1617] correcting mime types and keywords Revision: [1616] fixed link in footer Revision: [1615] Fixing ticket #207 git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1639 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-12-27 03:33:44 +00:00
$this->controllerClass->set('type', 'New');
if(file_exists(APP.'views'.DS.$this->viewPath.DS.'scaffold.new.thtml'))
{
return $this->controllerClass->render($this->actionView, '', APP.'views'.DS.$this->viewPath.DS.'scaffold.new.thtml');
}
return $this->controllerClass->render($this->actionView, '', LIBS.'view'.DS.'templates'.DS.'scaffolds'.DS.'edit.thtml');
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
}
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
/**
* Renders an Edit view for scaffolded Model.
*
* @param array $params
* @return A rendered view with a form to edit a record in the Models database table
* @access private
*/
Merging: Revision: [1638] removing php short tags Revision: [1637] Remove renderElememnts loading of helpers also, forgot it in the last commit Revision: [1636] Refactoring after profiling code. Session was creating a new instance of Dispatcher removed the need for it. Added a check to the Component class to pass the base to the SessionComponent class, will refactor that at a later time. Changed View class so it would not load helpers when rending a layout, no need for that. A great performance boost after the change. Change the loadModels method call in app/webroot/index.php. Will only attempt the loadModels call if the AppModel class is not in memory, and the Database class is in memory. Removed all unnecessary calls to basics uses(). Again another big performance increase. Added fix to the Html::guiListTree() after discussing the output that is expected. A ticket was closed on this already. Revision: [1635] Removing calls to basic uses() Revision: [1634] Removing calls to basics uses() that are not needed. Revision: [1633] Removing calls to basics uses() that are not needed. Moved Object class further up in the loading order Revision: [1632] adding fix for Ticket #132 Revision: [1631] Added fix from Ticket #122 Revision: [1630] Scaffold views can now be placed in a view directory. These will override the core. Example (Must have the scaffold dot name): app/views/posts/scaffold.list.thtml app/views/posts/scaffold.new.thtml app/views/posts/scaffold.edit.thtml app/views/posts/scaffold.show.thtml Revision: [1629] Think I fixed the issue with scaffold showing proper dates prior to January 1 1970 00:00:00. Revision: [1628] Added a few more change to allow saving dates prior to January 1 1970 00:00:00. Still a few issues with this, but will get them figured out soon. Changed scaffold to use only one form view. Revision: [1627] Added fix for Ticket #189 Revision: [1626] Added fix for Ticket #120. Revision: [1625] left justified doc blocks Revision: [1624] remove files from uses() that are loaded by default in app/webroot/index.php no reason to attempt to load them again in the classes Revision: [1623] adding check to the loadModels and loadController that will only attempt to load files if the classes are not already in memory Revision: [1622] Adding fix to time helper that was lost in a previous merge Removing all tabs from code Revision: [1621] Addtional model validation fixes Revision: [1620] fixed parse error Revision: [1619] Fixing ticket #102 Revision: [1618] correcting mime types and keywords Revision: [1617] correcting mime types and keywords Revision: [1616] fixed link in footer Revision: [1615] Fixing ticket #207 git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1639 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-12-27 03:33:44 +00:00
function _scaffoldEdit($params=array())
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
{
$this->controllerClass->params['data'] = $this->controllerClass->{$this->modelKey}->read();
$this->controllerClass->set('fieldNames', $this->controllerClass->generateFieldNames($this->controllerClass->params['data']) );
Merging: Revision: [1638] removing php short tags Revision: [1637] Remove renderElememnts loading of helpers also, forgot it in the last commit Revision: [1636] Refactoring after profiling code. Session was creating a new instance of Dispatcher removed the need for it. Added a check to the Component class to pass the base to the SessionComponent class, will refactor that at a later time. Changed View class so it would not load helpers when rending a layout, no need for that. A great performance boost after the change. Change the loadModels method call in app/webroot/index.php. Will only attempt the loadModels call if the AppModel class is not in memory, and the Database class is in memory. Removed all unnecessary calls to basics uses(). Again another big performance increase. Added fix to the Html::guiListTree() after discussing the output that is expected. A ticket was closed on this already. Revision: [1635] Removing calls to basic uses() Revision: [1634] Removing calls to basics uses() that are not needed. Revision: [1633] Removing calls to basics uses() that are not needed. Moved Object class further up in the loading order Revision: [1632] adding fix for Ticket #132 Revision: [1631] Added fix from Ticket #122 Revision: [1630] Scaffold views can now be placed in a view directory. These will override the core. Example (Must have the scaffold dot name): app/views/posts/scaffold.list.thtml app/views/posts/scaffold.new.thtml app/views/posts/scaffold.edit.thtml app/views/posts/scaffold.show.thtml Revision: [1629] Think I fixed the issue with scaffold showing proper dates prior to January 1 1970 00:00:00. Revision: [1628] Added a few more change to allow saving dates prior to January 1 1970 00:00:00. Still a few issues with this, but will get them figured out soon. Changed scaffold to use only one form view. Revision: [1627] Added fix for Ticket #189 Revision: [1626] Added fix for Ticket #120. Revision: [1625] left justified doc blocks Revision: [1624] remove files from uses() that are loaded by default in app/webroot/index.php no reason to attempt to load them again in the classes Revision: [1623] adding check to the loadModels and loadController that will only attempt to load files if the classes are not already in memory Revision: [1622] Adding fix to time helper that was lost in a previous merge Removing all tabs from code Revision: [1621] Addtional model validation fixes Revision: [1620] fixed parse error Revision: [1619] Fixing ticket #102 Revision: [1618] correcting mime types and keywords Revision: [1617] correcting mime types and keywords Revision: [1616] fixed link in footer Revision: [1615] Fixing ticket #207 git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1639 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-12-27 03:33:44 +00:00
$this->controllerClass->set('type', 'Edit');
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
$this->controllerClass->set('data', $this->controllerClass->params['data']);
Merging: Revision: [1638] removing php short tags Revision: [1637] Remove renderElememnts loading of helpers also, forgot it in the last commit Revision: [1636] Refactoring after profiling code. Session was creating a new instance of Dispatcher removed the need for it. Added a check to the Component class to pass the base to the SessionComponent class, will refactor that at a later time. Changed View class so it would not load helpers when rending a layout, no need for that. A great performance boost after the change. Change the loadModels method call in app/webroot/index.php. Will only attempt the loadModels call if the AppModel class is not in memory, and the Database class is in memory. Removed all unnecessary calls to basics uses(). Again another big performance increase. Added fix to the Html::guiListTree() after discussing the output that is expected. A ticket was closed on this already. Revision: [1635] Removing calls to basic uses() Revision: [1634] Removing calls to basics uses() that are not needed. Revision: [1633] Removing calls to basics uses() that are not needed. Moved Object class further up in the loading order Revision: [1632] adding fix for Ticket #132 Revision: [1631] Added fix from Ticket #122 Revision: [1630] Scaffold views can now be placed in a view directory. These will override the core. Example (Must have the scaffold dot name): app/views/posts/scaffold.list.thtml app/views/posts/scaffold.new.thtml app/views/posts/scaffold.edit.thtml app/views/posts/scaffold.show.thtml Revision: [1629] Think I fixed the issue with scaffold showing proper dates prior to January 1 1970 00:00:00. Revision: [1628] Added a few more change to allow saving dates prior to January 1 1970 00:00:00. Still a few issues with this, but will get them figured out soon. Changed scaffold to use only one form view. Revision: [1627] Added fix for Ticket #189 Revision: [1626] Added fix for Ticket #120. Revision: [1625] left justified doc blocks Revision: [1624] remove files from uses() that are loaded by default in app/webroot/index.php no reason to attempt to load them again in the classes Revision: [1623] adding check to the loadModels and loadController that will only attempt to load files if the classes are not already in memory Revision: [1622] Adding fix to time helper that was lost in a previous merge Removing all tabs from code Revision: [1621] Addtional model validation fixes Revision: [1620] fixed parse error Revision: [1619] Fixing ticket #102 Revision: [1618] correcting mime types and keywords Revision: [1617] correcting mime types and keywords Revision: [1616] fixed link in footer Revision: [1615] Fixing ticket #207 git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1639 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-12-27 03:33:44 +00:00
if(file_exists(APP.'views'.DS.$this->viewPath.DS.'scaffold.edit.thtml'))
{
return $this->controllerClass->render($this->actionView, '', APP.'views'.DS.$this->viewPath.DS.'scaffold.edit.thtml');
}
return $this->controllerClass->render($this->actionView, '', LIBS.'view'.DS.'templates'.DS.'scaffolds'.DS.'edit.thtml');
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
}
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
/**
* Renders a "create new" view for scaffolded Model.
*
* @param array $params
* @return success on save new form if data is empty or if data does not validate
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
* @access private
*/
function _scaffoldCreate($params)
{
if(empty($this->controllerClass->params['data']))
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
{
return $this->_scaffoldNew($params);
}
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
$this->controllerClass->set('fieldNames', $this->controllerClass->generateFieldNames() );
$this->_cleanUpFields();
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
if ($this->controllerClass->{$this->modelKey}->save($this->controllerClass->params['data']))
{
if(is_object($this->controllerClass->Session))
{
$this->controllerClass->Session->setFlash('Your '.Inflector::humanize($this->modelKey).' has been saved.');
$this->controllerClass->redirect(Inflector::underscore($this->controllerClass->viewPath));
}
else
{
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
return $this->controllerClass->flash('Your '.Inflector::humanize($this->modelKey).' has been saved.', '/'.
Inflector::underscore($this->controllerClass->viewPath) );
}
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
}
else
{
if(is_object($this->controllerClass->Session))
{
$this->controllerClass->Session->setFlash('Please correct errors below');
}
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
$this->controllerClass->set('data', $this->controllerClass->params['data']);
$this->controllerClass->validateErrors($this->controllerClass->{$this->modelKey});
Merging: Revision: [1638] removing php short tags Revision: [1637] Remove renderElememnts loading of helpers also, forgot it in the last commit Revision: [1636] Refactoring after profiling code. Session was creating a new instance of Dispatcher removed the need for it. Added a check to the Component class to pass the base to the SessionComponent class, will refactor that at a later time. Changed View class so it would not load helpers when rending a layout, no need for that. A great performance boost after the change. Change the loadModels method call in app/webroot/index.php. Will only attempt the loadModels call if the AppModel class is not in memory, and the Database class is in memory. Removed all unnecessary calls to basics uses(). Again another big performance increase. Added fix to the Html::guiListTree() after discussing the output that is expected. A ticket was closed on this already. Revision: [1635] Removing calls to basic uses() Revision: [1634] Removing calls to basics uses() that are not needed. Revision: [1633] Removing calls to basics uses() that are not needed. Moved Object class further up in the loading order Revision: [1632] adding fix for Ticket #132 Revision: [1631] Added fix from Ticket #122 Revision: [1630] Scaffold views can now be placed in a view directory. These will override the core. Example (Must have the scaffold dot name): app/views/posts/scaffold.list.thtml app/views/posts/scaffold.new.thtml app/views/posts/scaffold.edit.thtml app/views/posts/scaffold.show.thtml Revision: [1629] Think I fixed the issue with scaffold showing proper dates prior to January 1 1970 00:00:00. Revision: [1628] Added a few more change to allow saving dates prior to January 1 1970 00:00:00. Still a few issues with this, but will get them figured out soon. Changed scaffold to use only one form view. Revision: [1627] Added fix for Ticket #189 Revision: [1626] Added fix for Ticket #120. Revision: [1625] left justified doc blocks Revision: [1624] remove files from uses() that are loaded by default in app/webroot/index.php no reason to attempt to load them again in the classes Revision: [1623] adding check to the loadModels and loadController that will only attempt to load files if the classes are not already in memory Revision: [1622] Adding fix to time helper that was lost in a previous merge Removing all tabs from code Revision: [1621] Addtional model validation fixes Revision: [1620] fixed parse error Revision: [1619] Fixing ticket #102 Revision: [1618] correcting mime types and keywords Revision: [1617] correcting mime types and keywords Revision: [1616] fixed link in footer Revision: [1615] Fixing ticket #207 git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1639 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-12-27 03:33:44 +00:00
$this->controllerClass->set('type', 'New');
if(file_exists(APP.'views'.DS.$this->viewPath.DS.'scaffolds'.DS.'new.thtml'))
{
return $this->controllerClass->render($this->actionView, '', APP.'views'.DS.$this->viewPath.DS.'scaffolds'.DS.'new.thtml');
}
return $this->controllerClass->render($this->actionView, '', LIBS.'view'.DS.'templates'.DS.'scaffolds'.DS.'edit.thtml');
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
}
}
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
/**
* Renders an update view for scaffolded Model.
*
* @param array $params
* @return success on save new form if data is empty or error if update fails
* @access private
*/
function _scaffoldUpdate($params=array())
{
if(empty($this->controllerClass->params['data']))
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
{
return $this->_scaffoldNew($params);
}
Merging: Revision: [1638] removing php short tags Revision: [1637] Remove renderElememnts loading of helpers also, forgot it in the last commit Revision: [1636] Refactoring after profiling code. Session was creating a new instance of Dispatcher removed the need for it. Added a check to the Component class to pass the base to the SessionComponent class, will refactor that at a later time. Changed View class so it would not load helpers when rending a layout, no need for that. A great performance boost after the change. Change the loadModels method call in app/webroot/index.php. Will only attempt the loadModels call if the AppModel class is not in memory, and the Database class is in memory. Removed all unnecessary calls to basics uses(). Again another big performance increase. Added fix to the Html::guiListTree() after discussing the output that is expected. A ticket was closed on this already. Revision: [1635] Removing calls to basic uses() Revision: [1634] Removing calls to basics uses() that are not needed. Revision: [1633] Removing calls to basics uses() that are not needed. Moved Object class further up in the loading order Revision: [1632] adding fix for Ticket #132 Revision: [1631] Added fix from Ticket #122 Revision: [1630] Scaffold views can now be placed in a view directory. These will override the core. Example (Must have the scaffold dot name): app/views/posts/scaffold.list.thtml app/views/posts/scaffold.new.thtml app/views/posts/scaffold.edit.thtml app/views/posts/scaffold.show.thtml Revision: [1629] Think I fixed the issue with scaffold showing proper dates prior to January 1 1970 00:00:00. Revision: [1628] Added a few more change to allow saving dates prior to January 1 1970 00:00:00. Still a few issues with this, but will get them figured out soon. Changed scaffold to use only one form view. Revision: [1627] Added fix for Ticket #189 Revision: [1626] Added fix for Ticket #120. Revision: [1625] left justified doc blocks Revision: [1624] remove files from uses() that are loaded by default in app/webroot/index.php no reason to attempt to load them again in the classes Revision: [1623] adding check to the loadModels and loadController that will only attempt to load files if the classes are not already in memory Revision: [1622] Adding fix to time helper that was lost in a previous merge Removing all tabs from code Revision: [1621] Addtional model validation fixes Revision: [1620] fixed parse error Revision: [1619] Fixing ticket #102 Revision: [1618] correcting mime types and keywords Revision: [1617] correcting mime types and keywords Revision: [1616] fixed link in footer Revision: [1615] Fixing ticket #207 git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1639 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-12-27 03:33:44 +00:00
$this->controllerClass->set('fieldNames', $this->controllerClass->generateFieldNames() );
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
$this->_cleanUpFields();
Merging: Revision: [1638] removing php short tags Revision: [1637] Remove renderElememnts loading of helpers also, forgot it in the last commit Revision: [1636] Refactoring after profiling code. Session was creating a new instance of Dispatcher removed the need for it. Added a check to the Component class to pass the base to the SessionComponent class, will refactor that at a later time. Changed View class so it would not load helpers when rending a layout, no need for that. A great performance boost after the change. Change the loadModels method call in app/webroot/index.php. Will only attempt the loadModels call if the AppModel class is not in memory, and the Database class is in memory. Removed all unnecessary calls to basics uses(). Again another big performance increase. Added fix to the Html::guiListTree() after discussing the output that is expected. A ticket was closed on this already. Revision: [1635] Removing calls to basic uses() Revision: [1634] Removing calls to basics uses() that are not needed. Revision: [1633] Removing calls to basics uses() that are not needed. Moved Object class further up in the loading order Revision: [1632] adding fix for Ticket #132 Revision: [1631] Added fix from Ticket #122 Revision: [1630] Scaffold views can now be placed in a view directory. These will override the core. Example (Must have the scaffold dot name): app/views/posts/scaffold.list.thtml app/views/posts/scaffold.new.thtml app/views/posts/scaffold.edit.thtml app/views/posts/scaffold.show.thtml Revision: [1629] Think I fixed the issue with scaffold showing proper dates prior to January 1 1970 00:00:00. Revision: [1628] Added a few more change to allow saving dates prior to January 1 1970 00:00:00. Still a few issues with this, but will get them figured out soon. Changed scaffold to use only one form view. Revision: [1627] Added fix for Ticket #189 Revision: [1626] Added fix for Ticket #120. Revision: [1625] left justified doc blocks Revision: [1624] remove files from uses() that are loaded by default in app/webroot/index.php no reason to attempt to load them again in the classes Revision: [1623] adding check to the loadModels and loadController that will only attempt to load files if the classes are not already in memory Revision: [1622] Adding fix to time helper that was lost in a previous merge Removing all tabs from code Revision: [1621] Addtional model validation fixes Revision: [1620] fixed parse error Revision: [1619] Fixing ticket #102 Revision: [1618] correcting mime types and keywords Revision: [1617] correcting mime types and keywords Revision: [1616] fixed link in footer Revision: [1615] Fixing ticket #207 git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1639 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-12-27 03:33:44 +00:00
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
$this->controllerClass->{$this->modelKey}->set($this->controllerClass->params['data']);
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
if ( $this->controllerClass->{$this->modelKey}->save())
{
if(is_object($this->controllerClass->Session))
{
$this->controllerClass->Session->setFlash('Your '.Inflector::humanize($this->modelKey).' has been saved.', '/');
$this->controllerClass->redirect(Inflector::underscore($this->controllerClass->viewPath));
}
else
{
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
return $this->controllerClass->flash('The '.Inflector::humanize($this->modelKey).' has been updated.','/'.
Inflector::underscore($this->controllerClass->viewPath));
}
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
}
else
{
if(is_object($this->controllerClass->Session))
{
Merging: Revision: [1638] removing php short tags Revision: [1637] Remove renderElememnts loading of helpers also, forgot it in the last commit Revision: [1636] Refactoring after profiling code. Session was creating a new instance of Dispatcher removed the need for it. Added a check to the Component class to pass the base to the SessionComponent class, will refactor that at a later time. Changed View class so it would not load helpers when rending a layout, no need for that. A great performance boost after the change. Change the loadModels method call in app/webroot/index.php. Will only attempt the loadModels call if the AppModel class is not in memory, and the Database class is in memory. Removed all unnecessary calls to basics uses(). Again another big performance increase. Added fix to the Html::guiListTree() after discussing the output that is expected. A ticket was closed on this already. Revision: [1635] Removing calls to basic uses() Revision: [1634] Removing calls to basics uses() that are not needed. Revision: [1633] Removing calls to basics uses() that are not needed. Moved Object class further up in the loading order Revision: [1632] adding fix for Ticket #132 Revision: [1631] Added fix from Ticket #122 Revision: [1630] Scaffold views can now be placed in a view directory. These will override the core. Example (Must have the scaffold dot name): app/views/posts/scaffold.list.thtml app/views/posts/scaffold.new.thtml app/views/posts/scaffold.edit.thtml app/views/posts/scaffold.show.thtml Revision: [1629] Think I fixed the issue with scaffold showing proper dates prior to January 1 1970 00:00:00. Revision: [1628] Added a few more change to allow saving dates prior to January 1 1970 00:00:00. Still a few issues with this, but will get them figured out soon. Changed scaffold to use only one form view. Revision: [1627] Added fix for Ticket #189 Revision: [1626] Added fix for Ticket #120. Revision: [1625] left justified doc blocks Revision: [1624] remove files from uses() that are loaded by default in app/webroot/index.php no reason to attempt to load them again in the classes Revision: [1623] adding check to the loadModels and loadController that will only attempt to load files if the classes are not already in memory Revision: [1622] Adding fix to time helper that was lost in a previous merge Removing all tabs from code Revision: [1621] Addtional model validation fixes Revision: [1620] fixed parse error Revision: [1619] Fixing ticket #102 Revision: [1618] correcting mime types and keywords Revision: [1617] correcting mime types and keywords Revision: [1616] fixed link in footer Revision: [1615] Fixing ticket #207 git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1639 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-12-27 03:33:44 +00:00
$this->controllerClass->Session->setFlash('Please correct errors below');
}
Merging: Revision: [1638] removing php short tags Revision: [1637] Remove renderElememnts loading of helpers also, forgot it in the last commit Revision: [1636] Refactoring after profiling code. Session was creating a new instance of Dispatcher removed the need for it. Added a check to the Component class to pass the base to the SessionComponent class, will refactor that at a later time. Changed View class so it would not load helpers when rending a layout, no need for that. A great performance boost after the change. Change the loadModels method call in app/webroot/index.php. Will only attempt the loadModels call if the AppModel class is not in memory, and the Database class is in memory. Removed all unnecessary calls to basics uses(). Again another big performance increase. Added fix to the Html::guiListTree() after discussing the output that is expected. A ticket was closed on this already. Revision: [1635] Removing calls to basic uses() Revision: [1634] Removing calls to basics uses() that are not needed. Revision: [1633] Removing calls to basics uses() that are not needed. Moved Object class further up in the loading order Revision: [1632] adding fix for Ticket #132 Revision: [1631] Added fix from Ticket #122 Revision: [1630] Scaffold views can now be placed in a view directory. These will override the core. Example (Must have the scaffold dot name): app/views/posts/scaffold.list.thtml app/views/posts/scaffold.new.thtml app/views/posts/scaffold.edit.thtml app/views/posts/scaffold.show.thtml Revision: [1629] Think I fixed the issue with scaffold showing proper dates prior to January 1 1970 00:00:00. Revision: [1628] Added a few more change to allow saving dates prior to January 1 1970 00:00:00. Still a few issues with this, but will get them figured out soon. Changed scaffold to use only one form view. Revision: [1627] Added fix for Ticket #189 Revision: [1626] Added fix for Ticket #120. Revision: [1625] left justified doc blocks Revision: [1624] remove files from uses() that are loaded by default in app/webroot/index.php no reason to attempt to load them again in the classes Revision: [1623] adding check to the loadModels and loadController that will only attempt to load files if the classes are not already in memory Revision: [1622] Adding fix to time helper that was lost in a previous merge Removing all tabs from code Revision: [1621] Addtional model validation fixes Revision: [1620] fixed parse error Revision: [1619] Fixing ticket #102 Revision: [1618] correcting mime types and keywords Revision: [1617] correcting mime types and keywords Revision: [1616] fixed link in footer Revision: [1615] Fixing ticket #207 git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1639 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-12-27 03:33:44 +00:00
$this->controllerClass->validateErrors($this->controllerClass->{$this->modelKey});
$this->controllerClass->set('data', $this->controllerClass->params['data']);
$this->controllerClass->set('type', 'Edit');
return $this->controllerClass->render($this->actionView, '', LIBS.'view'.DS.'templates'.DS.'scaffolds'.DS.'edit.thtml');
}
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
}
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
/**
* Performs a delete on given scaffolded Model.
*
* @param array $params
* @return success on delete error if delete fails
* @access private
*/
function _scaffoldDestroy($params=array())
{
$id = $params['pass'][0];
if ($this->controllerClass->{$this->modelKey}->del($id))
{
if(is_object($this->controllerClass->Session))
{
$this->controllerClass->Session->setFlash('The '.Inflector::humanize($this->modelKey).' with id: '.$id.' has been deleted.', '/');
$this->controllerClass->redirect(Inflector::underscore($this->controllerClass->viewPath));
}
else
{
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
return $this->controllerClass->flash('The '.Inflector::humanize($this->modelKey).' with id: '.
$id.' has been deleted.', '/'.Inflector::underscore($this->controllerClass->viewPath));
}
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
}
else
{
if(is_object($this->controllerClass->Session))
{
$this->controllerClass->Session->setFlash('There was an error deleting the '.Inflector::humanize($this->modelKey).' with the id '.$id, '/');
$this->controllerClass->redirect(Inflector::underscore($this->controllerClass->viewPath));
}
else
{
return $this->controllerClass->flash('There was an error deleting the '.Inflector::humanize($this->modelKey).' with the id '.
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
$id, '/'.Inflector::underscore($this->controllerClass->viewPath));
}
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
}
}
/**
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
* When methods are now present in a controller
* scaffoldView is used to call default Scaffold methods if:
* <code>
* var $scaffold;
* </code>
* is placed in the controller's class definition.
*
* @param string $url
* @param string $controller_class
* @param array $params
* @since Cake v 0.10.0.172
* @access private
*/
function _scaffoldView ($params)
{
if(!in_array('Form', $this->controllerClass->helpers))
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
{
$this->controllerClass->helpers[] = 'Form';
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
}
Merging changes to trunk: Revision: [1761] Removing old db_acl.sql Revision: [1759] Removed unneeded calls to uses(). Changed basics.php listClasses() no longer using folder class. Starting corrections in DboPostgres class. Adding missing DboPostgres::query(). Added missing doc blocks to AjaxHelper. Fixed undefined keys in FormHelper::generateFields() Reformatted FormHelper::generateFields() adding open and close brackets where needed Revision: [1758] Fixed typo Revision: [1757] Fixed errors found when using PHP 4. Fixed a scaffold error Revision: [1756] Merging changes to model_php4.php Revision: [1755] Fixed scaffolding for the changes made to the model. Fixed Model::isForeignKey(), replaced array_key_exists with in_array, other function was failing Revision: [1754] Committing changes from bundt model to beta. DataSources will not be in the beta release Revision: [1751] Cleaning up a little more in the code. Removing loading of log.php unless it is really needed. Refactored dispatcher to speed up the stripslashes code if it is called Revision: [1748] removing all references to error_messages and deleting the file Revision: [1747] updated more error messages Revision: [1746] removing all error message defines Revision: [1745] added _() method from 1.0 to basics.php only used to return string right now Revision: [1744] Adding fix for ticket #220 Revision: [1743] More work on ErrorHandler class Revision: [1742] Renaming error view for missing database connection Revision: [1741] More work on ErrorHandler class Revision: [1740] More work on error class Revision: [1739] Replacing all $_SERVER variable check with env() in basics.php Revision: [1738] Adding env() to basic Revision: [1737] Updated session to use env() Revision: [1736] Removing ternary operators from Dispatcher Revision: [1735] Per nates request I am rolling back ACL to [1373] Revision: [1734] Removed the IP in the session class this was not very reliable. Added a time setting that generates current time adding the Security::inactiveMins() to the session Removed code that was added to basics.php to replace gethostbyaddr(). Added CAKE_SESSION_STRING define to core.php which is used in the by the Session class to generate a hashed key. Revision: [1733] Moving errors messages to ErrorHandler class. Updating errors view for use with new class. Updating Scaffold to use new class. Updated Dispatcher to use new class. Removing methods from Object class Revision: [1732] Adding ErrorHandler class Revision: [1731] Adding fix for Ticket #223 git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1762 3807eeeb-6ff5-0310-8944-8be069107fe0
2006-01-12 02:10:47 +00:00
$this->controllerClass->constructClasses();
if(isset($this->controllerClass->{$this->modelKey}->db))
{
if($params['action'] === 'index' || $params['action'] === 'list' ||
$params['action'] === 'show' || $params['action'] === 'add' ||
$params['action'] === 'create' || $params['action'] === 'edit' ||
$params['action'] === 'update' || $params['action'] === 'destroy')
Merging changes to trunk: Revision: [1761] Removing old db_acl.sql Revision: [1759] Removed unneeded calls to uses(). Changed basics.php listClasses() no longer using folder class. Starting corrections in DboPostgres class. Adding missing DboPostgres::query(). Added missing doc blocks to AjaxHelper. Fixed undefined keys in FormHelper::generateFields() Reformatted FormHelper::generateFields() adding open and close brackets where needed Revision: [1758] Fixed typo Revision: [1757] Fixed errors found when using PHP 4. Fixed a scaffold error Revision: [1756] Merging changes to model_php4.php Revision: [1755] Fixed scaffolding for the changes made to the model. Fixed Model::isForeignKey(), replaced array_key_exists with in_array, other function was failing Revision: [1754] Committing changes from bundt model to beta. DataSources will not be in the beta release Revision: [1751] Cleaning up a little more in the code. Removing loading of log.php unless it is really needed. Refactored dispatcher to speed up the stripslashes code if it is called Revision: [1748] removing all references to error_messages and deleting the file Revision: [1747] updated more error messages Revision: [1746] removing all error message defines Revision: [1745] added _() method from 1.0 to basics.php only used to return string right now Revision: [1744] Adding fix for ticket #220 Revision: [1743] More work on ErrorHandler class Revision: [1742] Renaming error view for missing database connection Revision: [1741] More work on ErrorHandler class Revision: [1740] More work on error class Revision: [1739] Replacing all $_SERVER variable check with env() in basics.php Revision: [1738] Adding env() to basic Revision: [1737] Updated session to use env() Revision: [1736] Removing ternary operators from Dispatcher Revision: [1735] Per nates request I am rolling back ACL to [1373] Revision: [1734] Removed the IP in the session class this was not very reliable. Added a time setting that generates current time adding the Security::inactiveMins() to the session Removed code that was added to basics.php to replace gethostbyaddr(). Added CAKE_SESSION_STRING define to core.php which is used in the by the Session class to generate a hashed key. Revision: [1733] Moving errors messages to ErrorHandler class. Updating errors view for use with new class. Updating Scaffold to use new class. Updated Dispatcher to use new class. Removing methods from Object class Revision: [1732] Adding ErrorHandler class Revision: [1731] Adding fix for Ticket #223 git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1762 3807eeeb-6ff5-0310-8944-8be069107fe0
2006-01-12 02:10:47 +00:00
{
switch ($params['action'])
{
case 'index':
$this->_scaffoldIndex($params);
break;
case 'show':
$this->_scaffoldShow($params);
break;
case 'list':
$this->_scaffoldList($params);
break;
case 'add':
$this->_scaffoldNew($params);
break;
case 'edit':
$this->_scaffoldEdit($params);
break;
case 'create':
$this->_scaffoldCreate($params);
break;
case 'update':
$this->_scaffoldUpdate($params);
break;
case 'destroy':
$this->_scaffoldDestroy($params);
break;
}
}
else
{
return $this->cakeError('missingAction',
array(array('className' => Inflector::camelize($params['controller']."Controller"),
'action' => $params['action'],
'webroot' => $this->controllerClass->webroot)));
}
}
else
{
Merging changes to trunk: Revision: [1761] Removing old db_acl.sql Revision: [1759] Removed unneeded calls to uses(). Changed basics.php listClasses() no longer using folder class. Starting corrections in DboPostgres class. Adding missing DboPostgres::query(). Added missing doc blocks to AjaxHelper. Fixed undefined keys in FormHelper::generateFields() Reformatted FormHelper::generateFields() adding open and close brackets where needed Revision: [1758] Fixed typo Revision: [1757] Fixed errors found when using PHP 4. Fixed a scaffold error Revision: [1756] Merging changes to model_php4.php Revision: [1755] Fixed scaffolding for the changes made to the model. Fixed Model::isForeignKey(), replaced array_key_exists with in_array, other function was failing Revision: [1754] Committing changes from bundt model to beta. DataSources will not be in the beta release Revision: [1751] Cleaning up a little more in the code. Removing loading of log.php unless it is really needed. Refactored dispatcher to speed up the stripslashes code if it is called Revision: [1748] removing all references to error_messages and deleting the file Revision: [1747] updated more error messages Revision: [1746] removing all error message defines Revision: [1745] added _() method from 1.0 to basics.php only used to return string right now Revision: [1744] Adding fix for ticket #220 Revision: [1743] More work on ErrorHandler class Revision: [1742] Renaming error view for missing database connection Revision: [1741] More work on ErrorHandler class Revision: [1740] More work on error class Revision: [1739] Replacing all $_SERVER variable check with env() in basics.php Revision: [1738] Adding env() to basic Revision: [1737] Updated session to use env() Revision: [1736] Removing ternary operators from Dispatcher Revision: [1735] Per nates request I am rolling back ACL to [1373] Revision: [1734] Removed the IP in the session class this was not very reliable. Added a time setting that generates current time adding the Security::inactiveMins() to the session Removed code that was added to basics.php to replace gethostbyaddr(). Added CAKE_SESSION_STRING define to core.php which is used in the by the Session class to generate a hashed key. Revision: [1733] Moving errors messages to ErrorHandler class. Updating errors view for use with new class. Updating Scaffold to use new class. Updated Dispatcher to use new class. Removing methods from Object class Revision: [1732] Adding ErrorHandler class Revision: [1731] Adding fix for Ticket #223 git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1762 3807eeeb-6ff5-0310-8944-8be069107fe0
2006-01-12 02:10:47 +00:00
return $this->cakeError('missingDatabase',
array(array('webroot' => $this->controllerClass->webroot)));
}
}
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
/**
* Cleans up the date fields of current Model.
*
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
* @access private
*/
function _cleanUpFields()
{
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
foreach( $this->controllerClass->{$this->modelKey}->_tableInfo as $table )
{
foreach ($table as $field)
{
if('date' == $field['type'] && isset($this->controllerClass->params['data'][$this->modelKey][$field['name'].'_year']))
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
{
Merging: Revision: [1638] removing php short tags Revision: [1637] Remove renderElememnts loading of helpers also, forgot it in the last commit Revision: [1636] Refactoring after profiling code. Session was creating a new instance of Dispatcher removed the need for it. Added a check to the Component class to pass the base to the SessionComponent class, will refactor that at a later time. Changed View class so it would not load helpers when rending a layout, no need for that. A great performance boost after the change. Change the loadModels method call in app/webroot/index.php. Will only attempt the loadModels call if the AppModel class is not in memory, and the Database class is in memory. Removed all unnecessary calls to basics uses(). Again another big performance increase. Added fix to the Html::guiListTree() after discussing the output that is expected. A ticket was closed on this already. Revision: [1635] Removing calls to basic uses() Revision: [1634] Removing calls to basics uses() that are not needed. Revision: [1633] Removing calls to basics uses() that are not needed. Moved Object class further up in the loading order Revision: [1632] adding fix for Ticket #132 Revision: [1631] Added fix from Ticket #122 Revision: [1630] Scaffold views can now be placed in a view directory. These will override the core. Example (Must have the scaffold dot name): app/views/posts/scaffold.list.thtml app/views/posts/scaffold.new.thtml app/views/posts/scaffold.edit.thtml app/views/posts/scaffold.show.thtml Revision: [1629] Think I fixed the issue with scaffold showing proper dates prior to January 1 1970 00:00:00. Revision: [1628] Added a few more change to allow saving dates prior to January 1 1970 00:00:00. Still a few issues with this, but will get them figured out soon. Changed scaffold to use only one form view. Revision: [1627] Added fix for Ticket #189 Revision: [1626] Added fix for Ticket #120. Revision: [1625] left justified doc blocks Revision: [1624] remove files from uses() that are loaded by default in app/webroot/index.php no reason to attempt to load them again in the classes Revision: [1623] adding check to the loadModels and loadController that will only attempt to load files if the classes are not already in memory Revision: [1622] Adding fix to time helper that was lost in a previous merge Removing all tabs from code Revision: [1621] Addtional model validation fixes Revision: [1620] fixed parse error Revision: [1619] Fixing ticket #102 Revision: [1618] correcting mime types and keywords Revision: [1617] correcting mime types and keywords Revision: [1616] fixed link in footer Revision: [1615] Fixing ticket #207 git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1639 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-12-27 03:33:44 +00:00
$newDate = $this->controllerClass->params['data'][$this->modelKey][$field['name'].'_year'].'-';
$newDate .= $this->controllerClass->params['data'][$this->modelKey][$field['name'].'_month'].'-';
$newDate .= $this->controllerClass->params['data'][$this->modelKey][$field['name'].'_day'].' ';
$this->controllerClass->params['data'][$this->modelKey][$field['name']] = $newDate;
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
}
else if( 'datetime' == $field['type'] && isset($this->controllerClass->params['data'][$this->modelKey][$field['name'].'_year'] ) )
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
{
$hour = $this->controllerClass->params['data'][$this->modelKey][$field['name'].'_hour'];
if( $hour != 12 && 'pm' == $this->controllerClass->params['data'][$this->modelKey][$field['name'].'_meridian'] )
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
{
$hour = $hour + 12;
}
Merging: Revision: [1638] removing php short tags Revision: [1637] Remove renderElememnts loading of helpers also, forgot it in the last commit Revision: [1636] Refactoring after profiling code. Session was creating a new instance of Dispatcher removed the need for it. Added a check to the Component class to pass the base to the SessionComponent class, will refactor that at a later time. Changed View class so it would not load helpers when rending a layout, no need for that. A great performance boost after the change. Change the loadModels method call in app/webroot/index.php. Will only attempt the loadModels call if the AppModel class is not in memory, and the Database class is in memory. Removed all unnecessary calls to basics uses(). Again another big performance increase. Added fix to the Html::guiListTree() after discussing the output that is expected. A ticket was closed on this already. Revision: [1635] Removing calls to basic uses() Revision: [1634] Removing calls to basics uses() that are not needed. Revision: [1633] Removing calls to basics uses() that are not needed. Moved Object class further up in the loading order Revision: [1632] adding fix for Ticket #132 Revision: [1631] Added fix from Ticket #122 Revision: [1630] Scaffold views can now be placed in a view directory. These will override the core. Example (Must have the scaffold dot name): app/views/posts/scaffold.list.thtml app/views/posts/scaffold.new.thtml app/views/posts/scaffold.edit.thtml app/views/posts/scaffold.show.thtml Revision: [1629] Think I fixed the issue with scaffold showing proper dates prior to January 1 1970 00:00:00. Revision: [1628] Added a few more change to allow saving dates prior to January 1 1970 00:00:00. Still a few issues with this, but will get them figured out soon. Changed scaffold to use only one form view. Revision: [1627] Added fix for Ticket #189 Revision: [1626] Added fix for Ticket #120. Revision: [1625] left justified doc blocks Revision: [1624] remove files from uses() that are loaded by default in app/webroot/index.php no reason to attempt to load them again in the classes Revision: [1623] adding check to the loadModels and loadController that will only attempt to load files if the classes are not already in memory Revision: [1622] Adding fix to time helper that was lost in a previous merge Removing all tabs from code Revision: [1621] Addtional model validation fixes Revision: [1620] fixed parse error Revision: [1619] Fixing ticket #102 Revision: [1618] correcting mime types and keywords Revision: [1617] correcting mime types and keywords Revision: [1616] fixed link in footer Revision: [1615] Fixing ticket #207 git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1639 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-12-27 03:33:44 +00:00
$newDate = $this->controllerClass->params['data'][$this->modelKey][$field['name'].'_year'].'-';
$newDate .= $this->controllerClass->params['data'][$this->modelKey][$field['name'].'_month'].'-';
$newDate .= $this->controllerClass->params['data'][$this->modelKey][$field['name'].'_day'].' ';
$newDate .= $hour.':'.$this->controllerClass->params['data'][$this->modelKey][$field['name'].'_min'].':00';
$this->controllerClass->params['data'][$this->modelKey][$field['name']] = $newDate;
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
}
else if( 'tinyint(1)' == $field['type'] )
{
if( isset( $this->controllerClass->params['data'][$this->modelKey][$field['name']]) &&
"on" == $this->controllerClass->params['data'][$this->modelKey][$field['name']] )
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
{
$this->controllerClass->params['data'][$this->modelKey][$field['name']] = true;
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
}
else
{
$this->controllerClass->params['data'][$this->modelKey][$field['name']] = false;
[1178] Author: phpnut Date: 8:52:12 PM, Sunday, October 23, 2005 Message: adding cakephp power image [1177] Author: phpnut Date: 8:48:32 PM, Sunday, October 23, 2005 Message: Updated scaffold to use new layout template. [1176] Author: phpnut Date: 7:09:27 PM, Sunday, October 23, 2005 Message: renaming cake/conf to cake/config [1175] Author: phpnut Date: 7:06:04 PM, Sunday, October 23, 2005 Message: moving tags.ini.php to cake/conf/tags.ini.php [1174] Author: phpnut Date: 6:52:19 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1173] Author: phpnut Date: 6:46:07 PM, Sunday, October 23, 2005 Message: updating css/cake.deafult.css and default layout [1172] Author: phpnut Date: 6:42:48 PM, Sunday, October 23, 2005 Message: updating css/cake.scaffold.css [1171] Author: phpnut Date: 6:41:00 PM, Sunday, October 23, 2005 Message: Adding spaces to tags.ini file [1170] Author: phpnut Date: 6:37:17 PM, Sunday, October 23, 2005 Message: Removing code that is no longer used [1169] Author: phpnut Date: 6:34:24 PM, Sunday, October 23, 2005 Message: removing files that are no longer used [1168] Author: phpnut Date: 6:19:46 PM, Sunday, October 23, 2005 Message: Cleaning up Scaffold class. [1167] Author: phpnut Date: 5:26:27 PM, Sunday, October 23, 2005 Message: Changes are added to remove the $this->models array that would hold the instance of the models. Now they are available as $this->ModelName; This should be CamelCased. Added check in the Scaffold to return forms when accessing the actions update, create without a form being submitted. [1166] Author: phpnut Date: 3:53:08 PM, Sunday, October 23, 2005 Message: Making change to allow setting the name of a class camel cased to fix issues with PHP 4. In both the model and the controllers: Model: var $name = 'ModelName'; Controller: var $name = 'ControllerName'; ControllerName not ControllerNameController. [1165] Author: phpnut Date: 1:45:17 PM, Sunday, October 23, 2005 Message: Fix added for problems with key name that was added to the class registry when underscored git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1179 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 01:56:20 +00:00
}
}
}
}
}
}
?>