2005-08-21 06:49:02 +00:00
< ? php
/* SVN FILE: $Id$ */
2005-07-21 04:02:32 +00:00
/**
2005-12-23 22:12:49 +00:00
* Scaffold .
*
* Automatic forms and actions generation for rapid web application development .
2005-08-21 06:49:02 +00:00
*
* PHP versions 4 and 5
*
2007-02-02 10:39:45 +00:00
* CakePHP ( tm ) : Rapid Development Framework < http :// www . cakephp . org />
* Copyright 2005 - 2007 , Cake Software Foundation , Inc .
2006-05-26 05:29:17 +00:00
* 1785 E . Sahara Avenue , Suite 490 - 204
* Las Vegas , Nevada 89104
2005-12-27 03:33:44 +00:00
*
2005-12-23 21:57:26 +00:00
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice .
2005-08-21 06:49:02 +00:00
*
2005-12-27 03:33:44 +00:00
* @ filesource
2007-02-02 10:39:45 +00:00
* @ copyright Copyright 2005 - 2007 , Cake Software Foundation , Inc .
* @ link http :// www . cakefoundation . org / projects / info / cakephp CakePHP ( tm ) Project
2006-05-26 05:29:17 +00:00
* @ package cake
* @ 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
2005-08-21 06:49:02 +00:00
*/
2005-07-21 04:02:32 +00:00
/**
2005-08-25 16:40:50 +00:00
* Scaffolding is a set of automatic views , forms and controllers for starting web development work faster .
2005-08-21 06:49:02 +00:00
*
2005-12-22 01:07:28 +00:00
* Scaffold inspects your database tables , and making educated guesses , sets up a
2005-08-25 16:40:50 +00:00
* 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 .
2005-08-21 06:49:02 +00:00
*
2006-05-26 05:29:17 +00:00
* @ package cake
* @ subpackage cake . cake . libs . controller
2005-08-21 06:49:02 +00:00
*/
2006-11-26 06:15:30 +00:00
class Scaffold extends Object {
/**
* Controller object
*
* @ var Controller
*/
2006-12-01 00:48:00 +00:00
var $controller = null ;
2006-11-26 06:15:30 +00:00
/**
2007-01-10 22:53:52 +00:00
* Name of the controller to scaffold
*
* @ var string Name of controller
* @ access public
*/
var $name = null ;
/**
* Action to be performed .
*
* @ var string Name of action
* @ access public
*/
var $action = null ;
/**
* Name of current model this view context is attached to
2006-11-26 06:15:30 +00:00
*
* @ var string
*/
2007-01-10 22:53:52 +00:00
var $model = null ;
/**
* Path to View .
*
* @ var string Path to View
*/
var $viewPath ;
/**
* Path parts for creating links in views .
*
* @ var string Base URL
* @ access public
*/
var $base = 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
/**
2007-01-10 22:53:52 +00:00
* Name of layout to use with this View .
[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
2007-01-10 22:53:52 +00:00
* @ access public
[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
*/
2007-01-10 22:53:52 +00:00
var $layout = 'default' ;
[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
/**
2007-01-10 22:53:52 +00:00
* Array of parameter 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
*
2007-01-10 22:53:52 +00:00
* @ var array Parameter 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
*/
2007-01-10 22:53:52 +00:00
var $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
/**
2007-01-10 22:53:52 +00:00
* File extension . Defaults to Cake ' s template " .ctp " .
*
* @ var array
*/
var $ext = '.ctp' ;
/**
* Sub - directory for this view file .
[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
*
2006-11-26 06:15:30 +00:00
* @ var string
[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
*/
2007-01-10 22:53:52 +00:00
var $subDir = 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
/**
2007-01-10 22:53:52 +00:00
* Plugin name . A Plugin is a sub - application . New in Cake RC4 .
[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
*
2007-01-10 22:53:52 +00:00
* @ link http :// wiki . cakephp . org / docs : plugins
[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
*/
2007-01-10 22:53:52 +00:00
var $plugin = null ;
/**
* Controller URL - generation data
*
* @ var mixed
*/
var $namedArgs = null ;
/**
* Controller URL - generation data
*
* @ var string
*/
var $argSeparator = null ;
/**
* List of variables to collect from the associated controller
*
* @ var array
* @ access protected
*/
var $__passedVars = array ( 'action' , 'base' , 'webroot' , 'layout' , 'name' , 'viewPath' , 'ext' , 'params' , 'data' , 'webservices' , 'plugin' , 'namedArgs' , 'argSeparator' , 'cacheAction' );
[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
*/
2006-12-01 00:48:00 +00:00
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
/**
* Construct and set up given controller with given parameters .
*
* @ param string $controller_class Name of controller
* @ param array $params
*/
2006-12-01 00:48:00 +00:00
function __construct ( & $controller , $params ) {
2006-11-26 06:15:30 +00:00
$this -> controller = & $controller ;
2007-02-02 03:57:57 +00:00
2007-01-10 22:53:52 +00:00
$count = count ( $this -> __passedVars );
for ( $j = 0 ; $j < $count ; $j ++ ) {
$var = $this -> __passedVars [ $j ];
$this -> { $var } = $controller -> { $var };
}
$this -> redirect = '/' . $this -> viewPath ;
if ( ! is_null ( $this -> plugin )) {
$this -> redirect = '/' . $this -> plugin . '/' . $this -> viewPath ;
}
2006-12-01 00:48:00 +00:00
2006-11-27 05:23:33 +00:00
if ( ! in_array ( 'Form' , $this -> controller -> helpers )) {
$this -> controller -> helpers [] = 'Form' ;
}
2006-12-01 00:48:00 +00:00
2006-11-28 22:05:22 +00:00
if ( $this -> controller -> constructClasses () === false ) {
return $this -> cakeError ( 'missingModel' , array ( array ( 'className' => $this -> modelKey , 'webroot' => '' , 'base' => $this -> controller -> base )));
}
2006-11-27 05:23:33 +00:00
if ( ! empty ( $controller -> uses ) && class_exists ( $controller -> uses [ 0 ])) {
$controller -> modelClass = $controller -> uses [ 0 ];
$controller -> modelKey = Inflector :: underscore ( $controller -> modelClass );
}
$this -> modelClass = $controller -> modelClass ;
$this -> modelKey = $controller -> modelKey ;
2006-11-28 11:18:05 +00:00
2006-11-27 05:23:33 +00:00
if ( ! is_object ( $this -> controller -> { $this -> modelClass })) {
return $this -> cakeError ( 'missingModel' , array ( array ( 'className' => $this -> modelClass , 'webroot' => '' , 'base' => $controller -> base )));
}
2006-11-28 22:05:22 +00:00
$this -> ScaffoldModel =& $this -> controller -> { $this -> modelClass };
2006-11-27 02:31:18 +00:00
$this -> scaffoldTitle = Inflector :: humanize ( $this -> viewPath );
2006-11-27 05:23:33 +00:00
$this -> scaffoldActions = $controller -> scaffold ;
2006-12-23 09:09:06 +00:00
$this -> controller -> pageTitle = __ ( 'Scaffold :: ' , true ) . Inflector :: humanize ( $this -> action ) . ' :: ' . $this -> scaffoldTitle ;
2006-11-27 01:04:19 +00:00
$path = '/' ;
$this -> controller -> set ( 'path' , $path );
2006-11-26 06:15:30 +00:00
$this -> controller -> set ( 'controllerName' , $this -> name );
$this -> controller -> set ( 'controllerAction' , $this -> action );
$this -> controller -> set ( 'modelClass' , $this -> modelClass );
$this -> controller -> set ( 'modelKey' , $this -> modelKey );
$this -> controller -> set ( 'viewPath' , $this -> viewPath );
2006-11-27 02:31:18 +00:00
$this -> controller -> set ( 'humanSingularName' , Inflector :: humanize ( $this -> modelKey ));
$this -> controller -> set ( 'humanPluralName' , Inflector :: humanize ( $this -> viewPath ));
2007-05-11 13:05:55 +00:00
$alias = array ();
2006-11-27 02:31:18 +00:00
if ( ! empty ( $this -> ScaffoldModel -> alias )) {
$alias = array_combine ( array_keys ( $this -> ScaffoldModel -> alias ), array_keys ( $this -> ScaffoldModel -> alias ));
}
2006-11-27 01:04:19 +00:00
$this -> controller -> set ( 'alias' , $alias );
$this -> controller -> set ( 'primaryKey' , $this -> ScaffoldModel -> primaryKey );
$this -> controller -> set ( 'displayField' , $this -> ScaffoldModel -> getDisplayfield ());
2006-11-26 06:15:30 +00:00
$this -> __scaffold ( $params );
2006-05-26 05:29:17 +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
/**
2007-01-10 22:53:52 +00:00
* Renders a view action of scaffolded 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
*
* @ param array $params
* @ return A rendered view of a row from Models database table
* @ access private
*/
2006-12-01 00:48:00 +00:00
function __scaffoldView ( $params ) {
if ( $this -> controller -> _beforeScaffold ( 'view' )) {
2006-11-28 11:18:05 +00:00
if ( isset ( $params [ 'pass' ][ 0 ])){
2006-12-01 00:48:00 +00:00
$this -> ScaffoldModel -> id = $params [ 'pass' ][ 0 ];
2006-11-28 11:18:05 +00:00
} elseif ( isset ( $this -> controller -> Session ) && $this -> controller -> Session -> valid != false ) {
2006-12-23 09:09:06 +00:00
$this -> controller -> Session -> setFlash ( sprintf ( __ ( " No id set for %s::view() " , true ), Inflector :: humanize ( $this -> modelKey )));
2007-01-10 22:53:52 +00:00
$this -> controller -> redirect ( $this -> redirect );
2006-11-28 11:18:05 +00:00
} else {
2006-12-23 09:09:06 +00:00
return $this -> controller -> flash ( sprintf ( __ ( " No id set for %s::view() " , true ), Inflector :: humanize ( $this -> modelKey )),
2006-11-28 11:18:05 +00:00
'/' . Inflector :: underscore ( $this -> controller -> viewPath ));
}
2006-12-01 00:48:00 +00:00
$this -> controller -> data = $this -> ScaffoldModel -> read ();
$this -> controller -> set ( 'data' , $this -> controller -> data );
$this -> controller -> set ( 'fieldNames' , $this -> controller -> generateFieldNames ( $this -> controller -> data , false ));
2007-02-02 03:57:57 +00:00
$this -> controller -> render ( $this -> action , $this -> layout , $this -> __getViewFileName ( $this -> action ));
} elseif ( $this -> controller -> _scaffoldError ( 'view' ) === false ) {
return $this -> __scaffoldError ();
}
}
[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
/**
2007-01-10 22:53:52 +00:00
* Renders index action of scaffolded 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
*
* @ param array $params
* @ return A rendered view listing rows from Models database table
* @ access private
*/
2006-12-01 00:48:00 +00:00
function __scaffoldIndex ( $params ) {
if ( $this -> controller -> _beforeScaffold ( 'index' )) {
$this -> controller -> set ( 'fieldNames' , $this -> controller -> generateFieldNames ( null , false ));
$this -> ScaffoldModel -> recursive = 0 ;
2007-01-10 22:53:52 +00:00
$this -> controller -> set ( 'data' , $this -> controller -> paginate ());
2007-02-02 03:57:57 +00:00
$this -> controller -> render ( $this -> action , $this -> layout , $this -> __getViewFileName ( $this -> action ));
} elseif ( $this -> controller -> _scaffoldError ( 'index' ) === false ) {
return $this -> __scaffoldError ();
}
}
[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
/**
2007-01-10 22:53:52 +00:00
* Renders an add or edit action for scaffolded 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
*
* @ param array $params
2006-07-15 03:36:53 +00:00
* @ param string $params add or edit
2006-02-25 09:36:52 +00:00
* @ return A rendered view with a form to edit or add a record in the Models database table
[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
*/
2006-12-25 11:32:58 +00:00
function __scaffoldForm ( $action = 'edit' ) {
2007-02-02 03:57:57 +00:00
$this -> controller -> render ( $action , $this -> layout , $this -> __getViewFileName ( 'edit' ));
2006-12-25 11:32:58 +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
/**
2007-01-10 22:53:52 +00:00
* Saves or updates the scaffolded 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
*
* @ param array $params
2006-02-25 09:36:52 +00:00
* @ param string $type create or update
2006-07-15 03:36:53 +00:00
* @ return success on save / update , add / edit form if data is empty or error if save or update fails
[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
*/
2006-12-25 11:32:58 +00:00
function __scaffoldSave ( $params = array (), $action = 'edit' ) {
2007-02-02 03:57:57 +00:00
$formName = 'Edit' ;
2006-11-26 06:15:30 +00:00
$formAction = 'edit' ;
$viewFileName = 'edit' ;
2006-12-23 09:09:06 +00:00
$success = __ ( 'updated' , true );
2006-11-26 06:15:30 +00:00
2006-12-25 11:32:58 +00:00
if ( $action === 'add' ) {
2007-02-02 03:57:57 +00:00
$formName = 'New' ;
2006-11-26 06:15:30 +00:00
$formAction = 'add' ;
$viewFileName = 'add' ;
2006-12-23 09:09:06 +00:00
$success = __ ( 'saved' , true );
2006-11-26 06:15:30 +00:00
}
2006-11-28 11:18:05 +00:00
2006-11-26 06:15:30 +00:00
$this -> controller -> set ( 'formName' , $formName );
2006-11-28 11:18:05 +00:00
2006-11-27 01:04:19 +00:00
if ( $this -> controller -> _beforeScaffold ( $action )) {
2006-11-28 11:18:05 +00:00
2006-11-26 06:15:30 +00:00
if ( empty ( $this -> controller -> data )) {
2006-12-25 11:32:58 +00:00
if ( $action == 'edit' ) {
if ( isset ( $params [ 'pass' ][ 0 ])){
$this -> ScaffoldModel -> id = $params [ 'pass' ][ 0 ];
} elseif ( isset ( $this -> controller -> Session ) && $this -> controller -> Session -> valid != false ) {
$this -> controller -> Session -> setFlash ( sprintf ( __ ( " No id set for %s::edit() " , true ), Inflector :: humanize ( $this -> modelKey )));
2007-01-10 22:53:52 +00:00
$this -> controller -> redirect ( $this -> redirect );
2006-12-25 11:32:58 +00:00
} else {
return $this -> controller -> flash ( sprintf ( __ ( " No id set for %s::edit() " , true ), Inflector :: humanize ( $this -> modelKey )),
'/' . Inflector :: underscore ( $this -> controller -> viewPath ));
}
$this -> controller -> data = $this -> ScaffoldModel -> read ();
$this -> controller -> set ( 'fieldNames' , $this -> controller -> generateFieldNames ( $this -> controller -> data ));
$this -> controller -> set ( 'data' , $this -> controller -> data );
} else {
$this -> controller -> set ( 'fieldNames' , $this -> controller -> generateFieldNames ());
}
return $this -> __scaffoldForm ( $formAction );
2006-11-26 06:15:30 +00:00
}
2006-11-28 11:18:05 +00:00
2006-11-26 06:15:30 +00:00
$this -> controller -> set ( 'fieldNames' , $this -> controller -> generateFieldNames ());
$this -> controller -> cleanUpFields ();
2006-11-26 15:24:58 +00:00
if ( $action == 'create' ) {
2006-11-26 06:15:30 +00:00
$this -> ScaffoldModel -> create ();
}
2006-11-28 11:18:05 +00:00
2006-11-26 06:15:30 +00:00
if ( $this -> ScaffoldModel -> save ( $this -> controller -> data )) {
2006-11-26 15:24:58 +00:00
if ( $this -> controller -> _afterScaffoldSave ( $action )) {
2006-11-26 06:15:30 +00:00
if ( isset ( $this -> controller -> Session ) && $this -> controller -> Session -> valid != false ) {
2006-12-23 09:09:06 +00:00
$this -> controller -> Session -> setFlash ( sprintf ( __ ( 'The %1$s has been %2$s' , true ), Inflector :: humanize ( $this -> modelClass ), $success ));
2007-01-10 22:53:52 +00:00
$this -> controller -> redirect ( $this -> redirect );
2006-11-26 06:15:30 +00:00
} else {
2006-12-23 09:09:06 +00:00
return $this -> controller -> flash ( sprintf ( __ ( 'The %1$s has been %2$s' , true ), Inflector :: humanize ( $this -> modelClass ), $success ), '/' . $this -> viewPath );
2006-11-26 06:15:30 +00:00
}
} else {
2006-11-26 15:24:58 +00:00
return $this -> controller -> _afterScaffoldSaveError ( $action );
2006-05-26 05:29:17 +00:00
}
2006-11-26 06:15:30 +00:00
} else {
if ( isset ( $this -> controller -> Session ) && $this -> controller -> Session -> valid != false ) {
2007-02-02 03:57:57 +00:00
$this -> controller -> Session -> setFlash ( __ ( 'Please correct errors below.' , true ));
2006-05-26 05:29:17 +00:00
}
2006-11-26 06:15:30 +00:00
$this -> controller -> set ( 'data' , $this -> controller -> data );
$this -> controller -> set ( 'fieldNames' , $this -> controller -> generateFieldNames ( $this -> __rebuild ( $this -> controller -> data )));
$this -> controller -> validateErrors ( $this -> ScaffoldModel );
2007-02-02 03:57:57 +00:00
$this -> controller -> render ( $formAction , $this -> layout , $this -> __getViewFileName ( 'edit' ));
2006-11-26 06:15:30 +00:00
}
2006-11-27 01:04:19 +00:00
} else if ( $this -> controller -> _scaffoldError ( $action ) === false ) {
2006-11-26 06:15:30 +00:00
return $this -> __scaffoldError ();
}
}
[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
*/
2006-12-01 00:48:00 +00:00
function __scaffoldDelete ( $params = array ()) {
if ( $this -> controller -> _beforeScaffold ( 'delete' )) {
if ( isset ( $params [ 'pass' ][ 0 ])){
2006-11-26 06:15:30 +00:00
$id = $params [ 'pass' ][ 0 ];
2006-12-01 00:48:00 +00:00
} elseif ( isset ( $this -> controller -> Session ) && $this -> controller -> Session -> valid != false ) {
2006-12-23 09:09:06 +00:00
$this -> controller -> Session -> setFlash ( sprintf ( __ ( " No id set for %s::delete() " , true ), Inflector :: humanize ( $this -> modelKey )));
2007-01-10 22:53:52 +00:00
$this -> controller -> redirect ( $this -> redirect );
2006-12-01 00:48:00 +00:00
} else {
2006-12-23 09:09:06 +00:00
return $this -> controller -> flash ( sprintf ( __ ( " No id set for %s::delete() " , true ), Inflector :: humanize ( $this -> modelKey )),
2006-12-01 00:48:00 +00:00
'/' . Inflector :: underscore ( $this -> controller -> viewPath ));
}
2006-05-26 05:29:17 +00:00
2006-12-01 00:48:00 +00:00
if ( $this -> ScaffoldModel -> del ( $id )) {
if ( isset ( $this -> controller -> Session ) && $this -> controller -> Session -> valid != false ) {
2006-12-23 09:09:06 +00:00
$this -> controller -> Session -> setFlash ( sprintf ( __ ( 'The %1$s with id: %2$d has been deleted.' , true ), Inflector :: humanize ( $this -> modelClass ), $id ));
2007-01-10 22:53:52 +00:00
$this -> controller -> redirect ( $this -> redirect );
2006-05-26 05:29:17 +00:00
} else {
2006-12-23 09:09:06 +00:00
return $this -> controller -> flash ( sprintf ( __ ( 'The %1$s with id: %2$d has been deleted.' , true ), Inflector :: humanize ( $this -> modelClass ), $id ), '/' . $this -> viewPath );
2006-05-26 05:29:17 +00:00
}
2006-12-01 00:48:00 +00:00
} else {
if ( isset ( $this -> controller -> Session ) && $this -> controller -> Session -> valid != false ) {
2006-12-23 09:09:06 +00:00
$this -> controller -> Session -> setFlash ( sprintf ( __ ( 'There was an error deleting the %1$s with id: %2$d' , true ), Inflector :: humanize ( $this -> modelClass ), $id ));
2007-01-10 22:53:52 +00:00
$this -> controller -> redirect ( $this -> redirect );
2006-12-01 00:48:00 +00:00
} else {
2006-12-23 09:09:06 +00:00
return $this -> controller -> flash ( sprintf ( __ ( 'There was an error deleting the %1$s with id: %2$d' , true ), Inflector :: humanize ( $this -> modelClass ), $id ), '/' . $this -> viewPath );
2006-12-01 00:48:00 +00:00
}
}
2005-12-22 01:07:28 +00:00
2006-12-01 00:48:00 +00:00
} elseif ( $this -> controller -> _scaffoldError ( 'delete' ) === false ) {
return $this -> __scaffoldError ();
}
}
2006-02-23 11:40:52 +00:00
/**
* Enter description here ...
*
2006-12-01 00:48:00 +00:00
* @ return error
2006-02-23 11:40:52 +00:00
*/
2007-02-02 03:57:57 +00:00
function __scaffoldError () {
2007-05-02 13:38:57 +00:00
$pathToViewFile = '' ;
2007-05-06 03:12:23 +00:00
2007-05-02 13:38:57 +00:00
if ( file_exists ( APP . 'views' . DS . $this -> viewPath . DS . 'scaffolds' . DS . 'scaffold.error.ctp' )) {
$pathToViewFile = APP . 'views' . DS . $this -> viewPath . DS . 'scaffolds' . DS . 'scaffold.error.ctp' ;
} elseif ( file_exists ( APP . 'views' . DS . $this -> viewPath . DS . 'scaffolds' . DS . 'scaffold.error.thtml' )) {
$pathToViewFile = APP . 'views' . DS . $this -> viewPath . DS . 'scaffolds' . DS . 'scaffold.error.thtml' ;
2007-05-06 03:12:23 +00:00
} elseif ( file_exists ( APP . 'views' . DS . 'scaffolds' . DS . 'scaffold.error.ctp' )) {
$pathToViewFile = APP . 'views' . DS . 'scaffolds' . DS . 'scaffold.error.ctp' ;
} elseif ( file_exists ( APP . 'views' . DS . 'scaffolds' . DS . 'scaffold.error.thtml' )) {
$pathToViewFile = APP . 'views' . DS . 'scaffolds' . DS . 'scaffold.error.thtml' ;
2006-12-01 00:48:00 +00:00
} else {
2007-05-02 13:38:57 +00:00
$pathToViewFile = LIBS . 'view' . DS . 'templates' . DS . 'errors' . DS . 'scaffold_error.ctp' ;
2006-12-01 00:48:00 +00:00
}
2007-05-06 03:12:23 +00:00
2007-05-02 13:38:57 +00:00
return $this -> controller -> render ( $this -> action , $this -> layout , $pathToViewFile );
2006-12-01 00:48:00 +00:00
}
2006-02-25 09:36:52 +00:00
/**
* When forms are submited the arrays need to be rebuilt if
* an error occured , here the arrays are rebuilt to structure needed
*
* @ param array $params data passed to forms
* @ return array rebuilds the association arrays to pass back to Controller :: generateFieldNames ()
*/
2006-12-01 00:48:00 +00:00
function __rebuild ( $params ) {
foreach ( $params as $model => $field ) {
if ( ! empty ( $field ) && is_array ( $field )) {
$match = array_keys ( $field );
2006-05-26 05:29:17 +00:00
2006-12-01 00:48:00 +00:00
if ( $model == $match [ 0 ]) {
$count = 0 ;
2006-05-26 05:29:17 +00:00
2006-12-01 00:48:00 +00:00
foreach ( $field [ $model ] as $value ) {
$params [ $model ][ $count ][ $this -> ScaffoldModel -> primaryKey ] = $value ;
$count ++ ;
}
unset ( $params [ $model ][ $model ]);
2006-05-26 05:29:17 +00:00
}
2006-12-01 00:48:00 +00:00
}
}
return $params ;
}
2005-09-19 22:59:06 +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
*/
2006-12-01 00:48:00 +00:00
function __scaffold ( $params ) {
$db = & ConnectionManager :: getDataSource ( $this -> ScaffoldModel -> useDbConfig );
2006-05-26 05:29:17 +00:00
2006-12-01 00:48:00 +00:00
if ( isset ( $db )) {
if ( empty ( $this -> scaffoldActions )) {
$this -> scaffoldActions = array ( 'index' , 'list' , 'view' , 'add' , 'create' , 'edit' , 'update' , 'delete' );
}
2006-05-26 05:29:17 +00:00
2006-12-01 00:48:00 +00:00
if ( in_array ( $params [ 'action' ], $this -> scaffoldActions )) {
switch ( $params [ 'action' ]) {
case 'index' :
$this -> __scaffoldIndex ( $params );
break ;
case 'view' :
$this -> __scaffoldView ( $params );
break ;
case 'list' :
$this -> __scaffoldIndex ( $params );
break ;
case 'add' :
2006-12-25 11:32:58 +00:00
$this -> __scaffoldSave ( $params , 'add' );
2006-12-01 00:48:00 +00:00
break ;
case 'edit' :
2006-12-25 11:32:58 +00:00
$this -> __scaffoldSave ( $params , 'edit' );
2006-12-01 00:48:00 +00:00
break ;
case 'create' :
2006-12-25 11:32:58 +00:00
$this -> __scaffoldSave ( $params , 'add' );
2006-12-01 00:48:00 +00:00
break ;
case 'update' :
2006-12-25 11:32:58 +00:00
$this -> __scaffoldSave ( $params , 'edit' );
2006-12-01 00:48:00 +00:00
break ;
case 'delete' :
$this -> __scaffoldDelete ( $params );
break ;
2006-05-26 05:29:17 +00:00
}
2006-12-01 00:48:00 +00:00
} else {
return $this -> cakeError ( 'missingAction' , array ( array ( 'className' => $this -> controller -> name . " Controller " ,
'base' => $this -> controller -> base ,
'action' => $this -> action ,
'webroot' => $this -> controller -> webroot )));
}
} else {
return $this -> cakeError ( 'missingDatabase' , array ( array ( 'webroot' => $this -> controller -> webroot )));
}
}
2007-01-10 22:53:52 +00:00
/**
* Returns scaffold view filename of given action ' s template file ( . ctp ) as a string .
*
* @ param string $action Controller action to find template filename for
* @ return string Template filename
* @ access private
2007-02-02 03:57:57 +00:00
*/
2007-01-10 22:53:52 +00:00
function __getViewFileName ( $action ) {
$action = Inflector :: underscore ( $action );
$scaffoldAction = 'scaffold.' . $action ;
$paths = Configure :: getInstance ();
if ( ! is_null ( $this -> webservices )) {
$type = strtolower ( $this -> webservices ) . DS ;
} else {
$type = null ;
}
if ( ! is_null ( $this -> plugin )) {
2007-02-02 03:57:57 +00:00
2007-01-10 22:53:52 +00:00
if ( file_exists ( APP . 'views' . DS . 'plugins' . DS . $this -> plugin . DS . $this -> subDir . $type . $scaffoldAction . $this -> ext )) {
2007-04-29 02:03:43 +00:00
return APP . 'views' . DS . 'plugins' . DS . $this -> plugin . DS . $this -> subDir . $type . $scaffoldAction . $this -> ext ;
2007-01-10 22:53:52 +00:00
} elseif ( file_exists ( APP . 'views' . DS . 'plugins' . DS . $this -> plugin . DS . $this -> subDir . $type . $scaffoldAction . $this -> ext )) {
2007-04-29 02:03:43 +00:00
return APP . 'views' . DS . 'plugins' . DS . $this -> plugin . DS . $this -> subDir . $type . $scaffoldAction . $this -> ext ;
2007-01-10 22:53:52 +00:00
} elseif ( file_exists ( APP . 'plugins' . DS . $this -> plugin . DS . 'views' . DS . $this -> viewPath . DS . $scaffoldAction . $this -> ext )) {
return APP . 'plugins' . DS . $this -> plugin . DS . 'views' . DS . $this -> viewPath . DS . $scaffoldAction . $this -> ext ;
2007-05-02 13:38:57 +00:00
} elseif ( file_exists ( APP . 'views' . DS . 'plugins' . DS . $this -> plugin . DS . $this -> subDir . $type . $scaffoldAction . '.ctp' )) {
return APP . 'views' . DS . 'plugins' . DS . $this -> plugin . DS . $this -> subDir . $type . $scaffoldAction . '.ctp' ;
2007-01-10 22:53:52 +00:00
} elseif ( file_exists ( APP . 'views' . DS . 'plugins' . DS . $this -> plugin . DS . $this -> subDir . $type . $scaffoldAction . '.thtml' )) {
return APP . 'views' . DS . 'plugins' . DS . $this -> plugin . DS . $this -> subDir . $type . $scaffoldAction . '.thtml' ;
2007-05-06 03:12:23 +00:00
} elseif ( file_exists ( APP . 'views' . DS . 'plugins' . DS . 'scaffolds' . DS . $this -> subDir . $type . $scaffoldAction . '.ctp' )) {
return APP . 'views' . DS . 'plugins' . DS . 'scaffolds' . DS . $this -> subDir . $type . $scaffoldAction . '.ctp' ;
} elseif ( file_exists ( APP . 'views' . DS . 'plugins' . DS . 'scaffolds' . DS . $this -> subDir . $type . $scaffoldAction . '.thtml' )) {
return APP . 'views' . DS . 'plugins' . DS . 'scaffolds' . DS . $this -> subDir . $type . $scaffoldAction . '.thtml' ;
2007-05-02 13:38:57 +00:00
} elseif ( file_exists ( APP . 'plugins' . DS . $this -> plugin . DS . 'views' . DS . $this -> viewPath . DS . $scaffoldAction . '.ctp' )) {
return APP . 'plugins' . DS . $this -> plugin . DS . 'views' . DS . $this -> viewPath . DS . $scaffoldAction . '.ctp' ;
2007-01-10 22:53:52 +00:00
} elseif ( file_exists ( APP . 'plugins' . DS . $this -> plugin . DS . 'views' . DS . $this -> viewPath . DS . $scaffoldAction . '.thtml' )) {
return APP . 'plugins' . DS . $this -> plugin . DS . 'views' . DS . $this -> viewPath . DS . $scaffoldAction . '.thtml' ;
}
}
2007-02-02 03:57:57 +00:00
2007-01-10 22:53:52 +00:00
foreach ( $paths -> viewPaths as $path ) {
if ( file_exists ( $path . $this -> viewPath . DS . $this -> subDir . $type . $scaffoldAction . $this -> ext )) {
return $path . $this -> viewPath . DS . $this -> subDir . $type . $scaffoldAction . $this -> ext ;
2007-05-06 03:12:23 +00:00
} elseif ( file_exists ( $path . $this -> viewPath . DS . 'scaffolds' . DS . $this -> subDir . $type . $scaffoldAction . $this -> ext )) {
return $path . $this -> viewPath . DS . 'scaffolds' . DS . $this -> subDir . $type . $scaffoldAction . $this -> ext ;
2007-05-02 13:38:57 +00:00
} elseif ( file_exists ( $path . $this -> viewPath . DS . $this -> subDir . $type . $scaffoldAction . '.ctp' )) {
return $path . $this -> viewPath . DS . $this -> subDir . $type . $scaffoldAction . '.ctp' ;
} elseif ( file_exists ( $path . $this -> viewPath . DS . $this -> subDir . $type . $scaffoldAction . '.thtml' )) {
2007-01-10 22:53:52 +00:00
return $path . $this -> viewPath . DS . $this -> subDir . $type . $scaffoldAction . '.thtml' ;
2007-05-06 03:12:23 +00:00
} elseif ( file_exists ( $path . $this -> viewPath . DS . 'scaffolds' . DS . $this -> subDir . $type . $scaffoldAction . '.ctp' )) {
return $path . $this -> viewPath . DS . 'scaffolds' . DS . $this -> subDir . $type . $scaffoldAction . '.ctp' ;
} elseif ( file_exists ( $path . $this -> viewPath . DS . 'scaffolds' . DS . $this -> subDir . $type . $scaffoldAction . '.thtml' )) {
return $path . $this -> viewPath . DS . 'scaffolds' . DS . $this -> subDir . $type . $scaffoldAction . '.thtml' ;
2007-01-10 22:53:52 +00:00
}
}
2007-05-02 13:38:57 +00:00
return LIBS . 'view' . DS . 'templates' . DS . 'scaffolds' . DS . $action . '.ctp' ;
2007-02-02 03:57:57 +00:00
}
2006-05-26 05:29:17 +00:00
}
2005-07-21 04:02:32 +00:00
?>