2005-07-04 01:07:14 +00:00
|
|
|
<?php
|
2005-08-21 06:49:02 +00:00
|
|
|
/* SVN FILE: $Id$ */
|
2005-06-19 23:30:36 +00:00
|
|
|
|
|
|
|
/**
|
2005-08-25 03:45:14 +00:00
|
|
|
* Base controller class.
|
2005-06-19 23:30:36 +00:00
|
|
|
*
|
2005-08-21 06:49:02 +00:00
|
|
|
* PHP versions 4 and 5
|
2005-06-19 23:30:36 +00:00
|
|
|
*
|
2005-08-21 06:49:02 +00:00
|
|
|
* CakePHP : Rapid Development Framework <http://www.cakephp.org/>
|
2005-12-23 21:57:26 +00:00
|
|
|
* Copyright (c) 2005, Cake Software Foundation, Inc.
|
|
|
|
* 1785 E. Sahara Avenue, Suite 490-204
|
|
|
|
* Las Vegas, Nevada 89104
|
2005-07-10 05:08:19 +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-07-10 05:08:19 +00:00
|
|
|
*
|
2005-08-25 03:45:14 +00:00
|
|
|
* @filesource
|
2005-12-23 21:57:26 +00:00
|
|
|
* @copyright Copyright (c) 2005, Cake Software Foundation, Inc.
|
|
|
|
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project
|
2005-08-21 06:49:02 +00:00
|
|
|
* @package cake
|
2005-10-09 01:56:21 +00:00
|
|
|
* @subpackage cake.cake.libs.controller
|
2005-08-21 06:49:02 +00:00
|
|
|
* @since CakePHP v 0.2.9
|
|
|
|
* @version $Revision$
|
|
|
|
* @modifiedby $LastChangedBy$
|
|
|
|
* @lastmodified $Date$
|
|
|
|
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
2005-07-10 05:08:19 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2005-08-25 03:45:14 +00:00
|
|
|
* Include files
|
2005-07-10 05:08:19 +00:00
|
|
|
*/
|
2005-10-09 01:56:21 +00:00
|
|
|
uses(DS.'controller'.DS.'component',DS.'model'.DS.'model', 'inflector', 'folder', DS.'view'.DS.'view');
|
2005-07-10 05:08:19 +00:00
|
|
|
|
|
|
|
/**
|
2005-08-21 06:49:02 +00:00
|
|
|
* Controller
|
2005-07-10 05:08:19 +00:00
|
|
|
*
|
2005-08-25 03:45:14 +00:00
|
|
|
* Application controller (controllers are where you put all the actual code)
|
2005-08-21 06:49:02 +00:00
|
|
|
* Provides basic functionality, such as rendering views (aka displaying templates).
|
2005-08-25 03:45:14 +00:00
|
|
|
* Automatically selects model name from on singularized object class name
|
2005-08-21 06:49:02 +00:00
|
|
|
* and creates the model object if proper class exists.
|
2005-07-10 05:08:19 +00:00
|
|
|
*
|
2005-08-21 06:49:02 +00:00
|
|
|
* @package cake
|
2005-10-09 01:56:21 +00:00
|
|
|
* @subpackage cake.cake.libs.controller
|
2005-08-21 06:49:02 +00:00
|
|
|
* @since CakePHP v 0.2.9
|
2005-07-10 05:08:19 +00:00
|
|
|
*
|
|
|
|
*/
|
2005-08-21 06:49:02 +00:00
|
|
|
class Controller extends Object
|
|
|
|
{
|
[1285]
Author: phpnut
Date: 10:09:03 PM, Monday, October 31, 2005
Message:
Removed references in the Session class
[1283]
Author: phpnut
Date: 8:47:37 PM, Monday, October 31, 2005
Message:
Added fix to the Controller::constructClassess().
The database should have an instance available if a component will use it.
[1282]
Author: phpnut
Date: 8:36:07 PM, Monday, October 31, 2005
Message:
Updated the Model association methods to correct and error I introduced when reactoring last week.
Added a return from each of the settings in Security::inactiveMins(); This class is not fully implemented.
Updated scaffold and dipatcher with changes to the session class.
Fixed problem with session not working properly.
Added a regenrate id for sessions.
When CAKE_SECURITY is set to high this will regenrate a new session key on each request.
The old session file will be removed from the file system. This is a added security measure.
[1270]
Author: phpnut
Date: 1:55:28 PM, Sunday, October 30, 2005
Message:
Updated Session class to regenrate a new session key on each request when security level set to high.
Updated doc comments in some classes
[1269]
Author: phpnut
Date: 9:49:43 AM, Sunday, October 30, 2005
Message:
Added a fix for Ticket #105
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1286 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-11-01 04:20:28 +00:00
|
|
|
/**
|
|
|
|
* Name of the controller.
|
|
|
|
*
|
|
|
|
* @var unknown_type
|
|
|
|
* @access public
|
|
|
|
*/
|
2005-08-21 06:49:02 +00:00
|
|
|
var $name = null;
|
|
|
|
|
[1285]
Author: phpnut
Date: 10:09:03 PM, Monday, October 31, 2005
Message:
Removed references in the Session class
[1283]
Author: phpnut
Date: 8:47:37 PM, Monday, October 31, 2005
Message:
Added fix to the Controller::constructClassess().
The database should have an instance available if a component will use it.
[1282]
Author: phpnut
Date: 8:36:07 PM, Monday, October 31, 2005
Message:
Updated the Model association methods to correct and error I introduced when reactoring last week.
Added a return from each of the settings in Security::inactiveMins(); This class is not fully implemented.
Updated scaffold and dipatcher with changes to the session class.
Fixed problem with session not working properly.
Added a regenrate id for sessions.
When CAKE_SECURITY is set to high this will regenrate a new session key on each request.
The old session file will be removed from the file system. This is a added security measure.
[1270]
Author: phpnut
Date: 1:55:28 PM, Sunday, October 30, 2005
Message:
Updated Session class to regenrate a new session key on each request when security level set to high.
Updated doc comments in some classes
[1269]
Author: phpnut
Date: 9:49:43 AM, Sunday, October 30, 2005
Message:
Added a fix for Ticket #105
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1286 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-11-01 04:20:28 +00:00
|
|
|
/**
|
|
|
|
* Stores the current URL (for links etc.)
|
|
|
|
*
|
|
|
|
* @var string Current URL
|
|
|
|
*/
|
2005-08-21 06:49:02 +00:00
|
|
|
var $here = null;
|
|
|
|
|
[1285]
Author: phpnut
Date: 10:09:03 PM, Monday, October 31, 2005
Message:
Removed references in the Session class
[1283]
Author: phpnut
Date: 8:47:37 PM, Monday, October 31, 2005
Message:
Added fix to the Controller::constructClassess().
The database should have an instance available if a component will use it.
[1282]
Author: phpnut
Date: 8:36:07 PM, Monday, October 31, 2005
Message:
Updated the Model association methods to correct and error I introduced when reactoring last week.
Added a return from each of the settings in Security::inactiveMins(); This class is not fully implemented.
Updated scaffold and dipatcher with changes to the session class.
Fixed problem with session not working properly.
Added a regenrate id for sessions.
When CAKE_SECURITY is set to high this will regenrate a new session key on each request.
The old session file will be removed from the file system. This is a added security measure.
[1270]
Author: phpnut
Date: 1:55:28 PM, Sunday, October 30, 2005
Message:
Updated Session class to regenrate a new session key on each request when security level set to high.
Updated doc comments in some classes
[1269]
Author: phpnut
Date: 9:49:43 AM, Sunday, October 30, 2005
Message:
Added a fix for Ticket #105
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1286 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-11-01 04:20:28 +00:00
|
|
|
/**
|
|
|
|
* Action to be performed.
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
* @access public
|
|
|
|
*/
|
2005-08-21 06:49:02 +00:00
|
|
|
var $action = null;
|
|
|
|
|
[1285]
Author: phpnut
Date: 10:09:03 PM, Monday, October 31, 2005
Message:
Removed references in the Session class
[1283]
Author: phpnut
Date: 8:47:37 PM, Monday, October 31, 2005
Message:
Added fix to the Controller::constructClassess().
The database should have an instance available if a component will use it.
[1282]
Author: phpnut
Date: 8:36:07 PM, Monday, October 31, 2005
Message:
Updated the Model association methods to correct and error I introduced when reactoring last week.
Added a return from each of the settings in Security::inactiveMins(); This class is not fully implemented.
Updated scaffold and dipatcher with changes to the session class.
Fixed problem with session not working properly.
Added a regenrate id for sessions.
When CAKE_SECURITY is set to high this will regenrate a new session key on each request.
The old session file will be removed from the file system. This is a added security measure.
[1270]
Author: phpnut
Date: 1:55:28 PM, Sunday, October 30, 2005
Message:
Updated Session class to regenrate a new session key on each request when security level set to high.
Updated doc comments in some classes
[1269]
Author: phpnut
Date: 9:49:43 AM, Sunday, October 30, 2005
Message:
Added a fix for Ticket #105
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1286 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-11-01 04:20:28 +00:00
|
|
|
/**
|
|
|
|
* An array of names of models the particular controller wants to use.
|
|
|
|
*
|
|
|
|
* @var mixed A single name as a string or a list of names as an array.
|
|
|
|
* @access protected
|
|
|
|
*/
|
2005-08-21 06:49:02 +00:00
|
|
|
var $uses = false;
|
|
|
|
|
[1285]
Author: phpnut
Date: 10:09:03 PM, Monday, October 31, 2005
Message:
Removed references in the Session class
[1283]
Author: phpnut
Date: 8:47:37 PM, Monday, October 31, 2005
Message:
Added fix to the Controller::constructClassess().
The database should have an instance available if a component will use it.
[1282]
Author: phpnut
Date: 8:36:07 PM, Monday, October 31, 2005
Message:
Updated the Model association methods to correct and error I introduced when reactoring last week.
Added a return from each of the settings in Security::inactiveMins(); This class is not fully implemented.
Updated scaffold and dipatcher with changes to the session class.
Fixed problem with session not working properly.
Added a regenrate id for sessions.
When CAKE_SECURITY is set to high this will regenrate a new session key on each request.
The old session file will be removed from the file system. This is a added security measure.
[1270]
Author: phpnut
Date: 1:55:28 PM, Sunday, October 30, 2005
Message:
Updated Session class to regenrate a new session key on each request when security level set to high.
Updated doc comments in some classes
[1269]
Author: phpnut
Date: 9:49:43 AM, Sunday, October 30, 2005
Message:
Added a fix for Ticket #105
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1286 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-11-01 04:20:28 +00:00
|
|
|
/**
|
|
|
|
* An array of names of built-in helpers to include.
|
|
|
|
*
|
|
|
|
* @var mixed A single name as a string or a list of names as an array.
|
|
|
|
* @access protected
|
|
|
|
*/
|
[1210]
Author: phpnut
Date: 4:44:45 AM, Wednesday, October 26, 2005
Message:
AJAX is now available as a by default in the $html variable in the templates.
You access it like this:
$html->Ajax->xxx();
Updated default templates.
[1208]
Author: phpnut
Date: 6:49:26 PM, Tuesday, October 25, 2005
Message:
Adding fix in Controller::generateFieldNames();
[1203]
Author: phpnut
Date: 10:40:28 AM, Tuesday, October 25, 2005
Message:
Changes made to core templates and css.
Fixed added for Ticket #60
[1202]
Author: phpnut
Date: 2:30:58 AM, Tuesday, October 25, 2005
Message:
Fix for cake error templates
Fixed a key for tables that are underscored in scaffolded code.
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1211 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-26 10:55:44 +00:00
|
|
|
var $helpers = array('Html');
|
2005-08-21 06:49:02 +00:00
|
|
|
|
[1285]
Author: phpnut
Date: 10:09:03 PM, Monday, October 31, 2005
Message:
Removed references in the Session class
[1283]
Author: phpnut
Date: 8:47:37 PM, Monday, October 31, 2005
Message:
Added fix to the Controller::constructClassess().
The database should have an instance available if a component will use it.
[1282]
Author: phpnut
Date: 8:36:07 PM, Monday, October 31, 2005
Message:
Updated the Model association methods to correct and error I introduced when reactoring last week.
Added a return from each of the settings in Security::inactiveMins(); This class is not fully implemented.
Updated scaffold and dipatcher with changes to the session class.
Fixed problem with session not working properly.
Added a regenrate id for sessions.
When CAKE_SECURITY is set to high this will regenrate a new session key on each request.
The old session file will be removed from the file system. This is a added security measure.
[1270]
Author: phpnut
Date: 1:55:28 PM, Sunday, October 30, 2005
Message:
Updated Session class to regenrate a new session key on each request when security level set to high.
Updated doc comments in some classes
[1269]
Author: phpnut
Date: 9:49:43 AM, Sunday, October 30, 2005
Message:
Added a fix for Ticket #105
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1286 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-11-01 04:20:28 +00:00
|
|
|
/**
|
|
|
|
* Enter description here...
|
|
|
|
*
|
|
|
|
* @var unknown_type
|
|
|
|
*/
|
2005-08-21 06:49:02 +00:00
|
|
|
var $viewPath;
|
|
|
|
|
[1285]
Author: phpnut
Date: 10:09:03 PM, Monday, October 31, 2005
Message:
Removed references in the Session class
[1283]
Author: phpnut
Date: 8:47:37 PM, Monday, October 31, 2005
Message:
Added fix to the Controller::constructClassess().
The database should have an instance available if a component will use it.
[1282]
Author: phpnut
Date: 8:36:07 PM, Monday, October 31, 2005
Message:
Updated the Model association methods to correct and error I introduced when reactoring last week.
Added a return from each of the settings in Security::inactiveMins(); This class is not fully implemented.
Updated scaffold and dipatcher with changes to the session class.
Fixed problem with session not working properly.
Added a regenrate id for sessions.
When CAKE_SECURITY is set to high this will regenrate a new session key on each request.
The old session file will be removed from the file system. This is a added security measure.
[1270]
Author: phpnut
Date: 1:55:28 PM, Sunday, October 30, 2005
Message:
Updated Session class to regenrate a new session key on each request when security level set to high.
Updated doc comments in some classes
[1269]
Author: phpnut
Date: 9:49:43 AM, Sunday, October 30, 2005
Message:
Added a fix for Ticket #105
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1286 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-11-01 04:20:28 +00:00
|
|
|
/**
|
|
|
|
* Variables for the view
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
* @access private
|
|
|
|
*/
|
2005-08-21 06:49:02 +00:00
|
|
|
var $_viewVars = array();
|
|
|
|
|
[1285]
Author: phpnut
Date: 10:09:03 PM, Monday, October 31, 2005
Message:
Removed references in the Session class
[1283]
Author: phpnut
Date: 8:47:37 PM, Monday, October 31, 2005
Message:
Added fix to the Controller::constructClassess().
The database should have an instance available if a component will use it.
[1282]
Author: phpnut
Date: 8:36:07 PM, Monday, October 31, 2005
Message:
Updated the Model association methods to correct and error I introduced when reactoring last week.
Added a return from each of the settings in Security::inactiveMins(); This class is not fully implemented.
Updated scaffold and dipatcher with changes to the session class.
Fixed problem with session not working properly.
Added a regenrate id for sessions.
When CAKE_SECURITY is set to high this will regenrate a new session key on each request.
The old session file will be removed from the file system. This is a added security measure.
[1270]
Author: phpnut
Date: 1:55:28 PM, Sunday, October 30, 2005
Message:
Updated Session class to regenrate a new session key on each request when security level set to high.
Updated doc comments in some classes
[1269]
Author: phpnut
Date: 9:49:43 AM, Sunday, October 30, 2005
Message:
Added a fix for Ticket #105
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1286 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-11-01 04:20:28 +00:00
|
|
|
/**
|
|
|
|
* Web page title
|
|
|
|
*
|
|
|
|
* @var boolean
|
|
|
|
* @access private
|
|
|
|
*/
|
2005-08-21 06:49:02 +00:00
|
|
|
var $pageTitle = false;
|
|
|
|
|
[1285]
Author: phpnut
Date: 10:09:03 PM, Monday, October 31, 2005
Message:
Removed references in the Session class
[1283]
Author: phpnut
Date: 8:47:37 PM, Monday, October 31, 2005
Message:
Added fix to the Controller::constructClassess().
The database should have an instance available if a component will use it.
[1282]
Author: phpnut
Date: 8:36:07 PM, Monday, October 31, 2005
Message:
Updated the Model association methods to correct and error I introduced when reactoring last week.
Added a return from each of the settings in Security::inactiveMins(); This class is not fully implemented.
Updated scaffold and dipatcher with changes to the session class.
Fixed problem with session not working properly.
Added a regenrate id for sessions.
When CAKE_SECURITY is set to high this will regenrate a new session key on each request.
The old session file will be removed from the file system. This is a added security measure.
[1270]
Author: phpnut
Date: 1:55:28 PM, Sunday, October 30, 2005
Message:
Updated Session class to regenrate a new session key on each request when security level set to high.
Updated doc comments in some classes
[1269]
Author: phpnut
Date: 9:49:43 AM, Sunday, October 30, 2005
Message:
Added a fix for Ticket #105
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1286 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-11-01 04:20:28 +00:00
|
|
|
/**
|
|
|
|
* An array of model objects.
|
|
|
|
*
|
|
|
|
* @var array Array of model objects.
|
|
|
|
* @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
|
|
|
var $modelNames = array();
|
2005-08-21 06:49:02 +00:00
|
|
|
|
|
|
|
|
[1285]
Author: phpnut
Date: 10:09:03 PM, Monday, October 31, 2005
Message:
Removed references in the Session class
[1283]
Author: phpnut
Date: 8:47:37 PM, Monday, October 31, 2005
Message:
Added fix to the Controller::constructClassess().
The database should have an instance available if a component will use it.
[1282]
Author: phpnut
Date: 8:36:07 PM, Monday, October 31, 2005
Message:
Updated the Model association methods to correct and error I introduced when reactoring last week.
Added a return from each of the settings in Security::inactiveMins(); This class is not fully implemented.
Updated scaffold and dipatcher with changes to the session class.
Fixed problem with session not working properly.
Added a regenrate id for sessions.
When CAKE_SECURITY is set to high this will regenrate a new session key on each request.
The old session file will be removed from the file system. This is a added security measure.
[1270]
Author: phpnut
Date: 1:55:28 PM, Sunday, October 30, 2005
Message:
Updated Session class to regenrate a new session key on each request when security level set to high.
Updated doc comments in some classes
[1269]
Author: phpnut
Date: 9:49:43 AM, Sunday, October 30, 2005
Message:
Added a fix for Ticket #105
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1286 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-11-01 04:20:28 +00:00
|
|
|
/**
|
|
|
|
* Enter description here...
|
|
|
|
*
|
|
|
|
* @var unknown_type
|
|
|
|
* @access public
|
|
|
|
*/
|
2005-08-21 06:49:02 +00:00
|
|
|
var $base = null;
|
|
|
|
|
[1285]
Author: phpnut
Date: 10:09:03 PM, Monday, October 31, 2005
Message:
Removed references in the Session class
[1283]
Author: phpnut
Date: 8:47:37 PM, Monday, October 31, 2005
Message:
Added fix to the Controller::constructClassess().
The database should have an instance available if a component will use it.
[1282]
Author: phpnut
Date: 8:36:07 PM, Monday, October 31, 2005
Message:
Updated the Model association methods to correct and error I introduced when reactoring last week.
Added a return from each of the settings in Security::inactiveMins(); This class is not fully implemented.
Updated scaffold and dipatcher with changes to the session class.
Fixed problem with session not working properly.
Added a regenrate id for sessions.
When CAKE_SECURITY is set to high this will regenrate a new session key on each request.
The old session file will be removed from the file system. This is a added security measure.
[1270]
Author: phpnut
Date: 1:55:28 PM, Sunday, October 30, 2005
Message:
Updated Session class to regenrate a new session key on each request when security level set to high.
Updated doc comments in some classes
[1269]
Author: phpnut
Date: 9:49:43 AM, Sunday, October 30, 2005
Message:
Added a fix for Ticket #105
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1286 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-11-01 04:20:28 +00:00
|
|
|
/**
|
|
|
|
* Layout file to use (see /app/views/layouts/default.thtml)
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
* @access public
|
|
|
|
*/
|
2005-08-21 06:49:02 +00:00
|
|
|
var $layout = 'default';
|
|
|
|
|
[1285]
Author: phpnut
Date: 10:09:03 PM, Monday, October 31, 2005
Message:
Removed references in the Session class
[1283]
Author: phpnut
Date: 8:47:37 PM, Monday, October 31, 2005
Message:
Added fix to the Controller::constructClassess().
The database should have an instance available if a component will use it.
[1282]
Author: phpnut
Date: 8:36:07 PM, Monday, October 31, 2005
Message:
Updated the Model association methods to correct and error I introduced when reactoring last week.
Added a return from each of the settings in Security::inactiveMins(); This class is not fully implemented.
Updated scaffold and dipatcher with changes to the session class.
Fixed problem with session not working properly.
Added a regenrate id for sessions.
When CAKE_SECURITY is set to high this will regenrate a new session key on each request.
The old session file will be removed from the file system. This is a added security measure.
[1270]
Author: phpnut
Date: 1:55:28 PM, Sunday, October 30, 2005
Message:
Updated Session class to regenrate a new session key on each request when security level set to high.
Updated doc comments in some classes
[1269]
Author: phpnut
Date: 9:49:43 AM, Sunday, October 30, 2005
Message:
Added a fix for Ticket #105
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1286 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-11-01 04:20:28 +00:00
|
|
|
/**
|
|
|
|
* Automatically render the view (the dispatcher checks for this variable before running render())
|
|
|
|
*
|
|
|
|
* @var boolean
|
|
|
|
* @access public
|
|
|
|
*/
|
2005-08-21 06:49:02 +00:00
|
|
|
var $autoRender = true;
|
|
|
|
|
[1285]
Author: phpnut
Date: 10:09:03 PM, Monday, October 31, 2005
Message:
Removed references in the Session class
[1283]
Author: phpnut
Date: 8:47:37 PM, Monday, October 31, 2005
Message:
Added fix to the Controller::constructClassess().
The database should have an instance available if a component will use it.
[1282]
Author: phpnut
Date: 8:36:07 PM, Monday, October 31, 2005
Message:
Updated the Model association methods to correct and error I introduced when reactoring last week.
Added a return from each of the settings in Security::inactiveMins(); This class is not fully implemented.
Updated scaffold and dipatcher with changes to the session class.
Fixed problem with session not working properly.
Added a regenrate id for sessions.
When CAKE_SECURITY is set to high this will regenrate a new session key on each request.
The old session file will be removed from the file system. This is a added security measure.
[1270]
Author: phpnut
Date: 1:55:28 PM, Sunday, October 30, 2005
Message:
Updated Session class to regenrate a new session key on each request when security level set to high.
Updated doc comments in some classes
[1269]
Author: phpnut
Date: 9:49:43 AM, Sunday, October 30, 2005
Message:
Added a fix for Ticket #105
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1286 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-11-01 04:20:28 +00:00
|
|
|
/**
|
|
|
|
* Enter description here...
|
|
|
|
*
|
|
|
|
* @var boolean
|
|
|
|
* @access public
|
|
|
|
*/
|
2005-08-21 06:49:02 +00:00
|
|
|
var $autoLayout = true;
|
|
|
|
|
[1285]
Author: phpnut
Date: 10:09:03 PM, Monday, October 31, 2005
Message:
Removed references in the Session class
[1283]
Author: phpnut
Date: 8:47:37 PM, Monday, October 31, 2005
Message:
Added fix to the Controller::constructClassess().
The database should have an instance available if a component will use it.
[1282]
Author: phpnut
Date: 8:36:07 PM, Monday, October 31, 2005
Message:
Updated the Model association methods to correct and error I introduced when reactoring last week.
Added a return from each of the settings in Security::inactiveMins(); This class is not fully implemented.
Updated scaffold and dipatcher with changes to the session class.
Fixed problem with session not working properly.
Added a regenrate id for sessions.
When CAKE_SECURITY is set to high this will regenrate a new session key on each request.
The old session file will be removed from the file system. This is a added security measure.
[1270]
Author: phpnut
Date: 1:55:28 PM, Sunday, October 30, 2005
Message:
Updated Session class to regenrate a new session key on each request when security level set to high.
Updated doc comments in some classes
[1269]
Author: phpnut
Date: 9:49:43 AM, Sunday, October 30, 2005
Message:
Added a fix for Ticket #105
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1286 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-11-01 04:20:28 +00:00
|
|
|
/**
|
|
|
|
* Database configuration to use (see /config/database.php)
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
* @access public
|
|
|
|
*/
|
2005-08-21 06:49:02 +00:00
|
|
|
var $useDbConfig = 'default';
|
2005-08-25 03:45:14 +00:00
|
|
|
|
[1285]
Author: phpnut
Date: 10:09:03 PM, Monday, October 31, 2005
Message:
Removed references in the Session class
[1283]
Author: phpnut
Date: 8:47:37 PM, Monday, October 31, 2005
Message:
Added fix to the Controller::constructClassess().
The database should have an instance available if a component will use it.
[1282]
Author: phpnut
Date: 8:36:07 PM, Monday, October 31, 2005
Message:
Updated the Model association methods to correct and error I introduced when reactoring last week.
Added a return from each of the settings in Security::inactiveMins(); This class is not fully implemented.
Updated scaffold and dipatcher with changes to the session class.
Fixed problem with session not working properly.
Added a regenrate id for sessions.
When CAKE_SECURITY is set to high this will regenrate a new session key on each request.
The old session file will be removed from the file system. This is a added security measure.
[1270]
Author: phpnut
Date: 1:55:28 PM, Sunday, October 30, 2005
Message:
Updated Session class to regenrate a new session key on each request when security level set to high.
Updated doc comments in some classes
[1269]
Author: phpnut
Date: 9:49:43 AM, Sunday, October 30, 2005
Message:
Added a fix for Ticket #105
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1286 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-11-01 04:20:28 +00:00
|
|
|
/**
|
|
|
|
* Enter description here...
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
* @access public
|
|
|
|
*/
|
2005-08-21 06:49:02 +00:00
|
|
|
var $beforeFilter = null;
|
2005-12-22 01:07:28 +00:00
|
|
|
|
[1285]
Author: phpnut
Date: 10:09:03 PM, Monday, October 31, 2005
Message:
Removed references in the Session class
[1283]
Author: phpnut
Date: 8:47:37 PM, Monday, October 31, 2005
Message:
Added fix to the Controller::constructClassess().
The database should have an instance available if a component will use it.
[1282]
Author: phpnut
Date: 8:36:07 PM, Monday, October 31, 2005
Message:
Updated the Model association methods to correct and error I introduced when reactoring last week.
Added a return from each of the settings in Security::inactiveMins(); This class is not fully implemented.
Updated scaffold and dipatcher with changes to the session class.
Fixed problem with session not working properly.
Added a regenrate id for sessions.
When CAKE_SECURITY is set to high this will regenrate a new session key on each request.
The old session file will be removed from the file system. This is a added security measure.
[1270]
Author: phpnut
Date: 1:55:28 PM, Sunday, October 30, 2005
Message:
Updated Session class to regenrate a new session key on each request when security level set to high.
Updated doc comments in some classes
[1269]
Author: phpnut
Date: 9:49:43 AM, Sunday, October 30, 2005
Message:
Added a fix for Ticket #105
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1286 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-11-01 04:20:28 +00:00
|
|
|
/**
|
|
|
|
* Enter description here...
|
|
|
|
*
|
|
|
|
* @var unknown_type
|
|
|
|
*/
|
2005-10-09 01:56:21 +00:00
|
|
|
var $components = array();
|
2005-08-21 06:49:02 +00:00
|
|
|
|
[1285]
Author: phpnut
Date: 10:09:03 PM, Monday, October 31, 2005
Message:
Removed references in the Session class
[1283]
Author: phpnut
Date: 8:47:37 PM, Monday, October 31, 2005
Message:
Added fix to the Controller::constructClassess().
The database should have an instance available if a component will use it.
[1282]
Author: phpnut
Date: 8:36:07 PM, Monday, October 31, 2005
Message:
Updated the Model association methods to correct and error I introduced when reactoring last week.
Added a return from each of the settings in Security::inactiveMins(); This class is not fully implemented.
Updated scaffold and dipatcher with changes to the session class.
Fixed problem with session not working properly.
Added a regenrate id for sessions.
When CAKE_SECURITY is set to high this will regenrate a new session key on each request.
The old session file will be removed from the file system. This is a added security measure.
[1270]
Author: phpnut
Date: 1:55:28 PM, Sunday, October 30, 2005
Message:
Updated Session class to regenrate a new session key on each request when security level set to high.
Updated doc comments in some classes
[1269]
Author: phpnut
Date: 9:49:43 AM, Sunday, October 30, 2005
Message:
Added a fix for Ticket #105
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1286 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-11-01 04:20:28 +00:00
|
|
|
/**
|
|
|
|
* Constructor.
|
|
|
|
*
|
|
|
|
*/
|
2005-09-17 02:22:07 +00:00
|
|
|
function __construct ()
|
2005-08-21 06:49:02 +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
|
|
|
if($this->name === null)
|
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
|
|
|
$r = null;
|
|
|
|
if (!preg_match('/(.*)Controller/i', get_class($this), $r))
|
|
|
|
{
|
|
|
|
die("Controller::__construct() : Can't get or parse my own class name, exiting.");
|
|
|
|
}
|
2005-09-19 22:59:06 +00:00
|
|
|
$this->name = $r[1];
|
|
|
|
}
|
2005-12-22 01:07:28 +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->viewPath = Inflector::underscore($this->name);
|
[1183]
Author: phpnut
Date: 10:42:06 PM, Sunday, October 23, 2005
Message:
Fixed errors created with change I have been making.
Controller::generateFields(); was not setting the tagName properly.
[1182]
Author: phpnut
Date: 10:13:33 PM, Sunday, October 23, 2005
Message:
Removing the need to set hasMany and hasAndBelongsToMany to plural.
All associations should be created as CamelCase associations now.
[1181]
Author: phpnut
Date: 9:38:50 PM, Sunday, October 23, 2005
Message:
Forgot dispatcher.php in last commit
[1180]
Author: phpnut
Date: 9:37:06 PM, Sunday, October 23, 2005
Message:
refactoring and removing unneeded calls to Inflector
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1184 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 03:44:54 +00:00
|
|
|
$this->modelClass = Inflector::singularize($this->name);
|
|
|
|
$this->modelKey = Inflector::underscore($this->modelClass);
|
2005-12-22 01:07:28 +00:00
|
|
|
if(!defined('AUTO_SESSION') || AUTO_SESSION == true)
|
|
|
|
{
|
|
|
|
array_push($this->components, 'Session');
|
|
|
|
}
|
[1183]
Author: phpnut
Date: 10:42:06 PM, Sunday, October 23, 2005
Message:
Fixed errors created with change I have been making.
Controller::generateFields(); was not setting the tagName properly.
[1182]
Author: phpnut
Date: 10:13:33 PM, Sunday, October 23, 2005
Message:
Removing the need to set hasMany and hasAndBelongsToMany to plural.
All associations should be created as CamelCase associations now.
[1181]
Author: phpnut
Date: 9:38:50 PM, Sunday, October 23, 2005
Message:
Forgot dispatcher.php in last commit
[1180]
Author: phpnut
Date: 9:37:06 PM, Sunday, October 23, 2005
Message:
refactoring and removing unneeded calls to Inflector
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1184 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 03:44:54 +00:00
|
|
|
parent::__construct();
|
2005-08-21 06:49:02 +00:00
|
|
|
}
|
|
|
|
|
[1285]
Author: phpnut
Date: 10:09:03 PM, Monday, October 31, 2005
Message:
Removed references in the Session class
[1283]
Author: phpnut
Date: 8:47:37 PM, Monday, October 31, 2005
Message:
Added fix to the Controller::constructClassess().
The database should have an instance available if a component will use it.
[1282]
Author: phpnut
Date: 8:36:07 PM, Monday, October 31, 2005
Message:
Updated the Model association methods to correct and error I introduced when reactoring last week.
Added a return from each of the settings in Security::inactiveMins(); This class is not fully implemented.
Updated scaffold and dipatcher with changes to the session class.
Fixed problem with session not working properly.
Added a regenrate id for sessions.
When CAKE_SECURITY is set to high this will regenrate a new session key on each request.
The old session file will be removed from the file system. This is a added security measure.
[1270]
Author: phpnut
Date: 1:55:28 PM, Sunday, October 30, 2005
Message:
Updated Session class to regenrate a new session key on each request when security level set to high.
Updated doc comments in some classes
[1269]
Author: phpnut
Date: 9:49:43 AM, Sunday, October 30, 2005
Message:
Added a fix for Ticket #105
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1286 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-11-01 04:20:28 +00:00
|
|
|
/**
|
|
|
|
* Enter description here...
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
function constructClasses()
|
|
|
|
{
|
|
|
|
$dboFactory = DboFactory::getInstance($this->useDbConfig);
|
|
|
|
$this->db =& $dboFactory;
|
2005-12-22 01:07:28 +00:00
|
|
|
|
2005-10-09 01:56:21 +00:00
|
|
|
if (!empty($this->components))
|
|
|
|
{
|
|
|
|
$component =& new Component($this);
|
|
|
|
}
|
2005-12-22 01:07:28 +00:00
|
|
|
|
2005-09-21 05:48:09 +00:00
|
|
|
if (!empty($this->beforeFilter))
|
|
|
|
{
|
|
|
|
if(is_array($this->beforeFilter))
|
|
|
|
{
|
|
|
|
foreach($this->beforeFilter as $filter)
|
|
|
|
{
|
2005-10-18 22:27:39 +00:00
|
|
|
if(is_callable(array($this,$filter)))
|
|
|
|
{
|
|
|
|
$this->$filter();
|
|
|
|
}
|
2005-09-21 05:48:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2005-10-18 22:27:39 +00:00
|
|
|
if(is_callable(array($this,$this->beforeFilter)))
|
|
|
|
{
|
|
|
|
$this->{$this->beforeFilter}();
|
|
|
|
}
|
2005-09-21 05:48:09 +00:00
|
|
|
}
|
|
|
|
}
|
2005-12-22 01:07:28 +00:00
|
|
|
|
2005-08-21 06:49:02 +00:00
|
|
|
if(empty($this->params['pass']))
|
|
|
|
{
|
|
|
|
$id = false;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$id = $this->params['pass'];
|
|
|
|
}
|
|
|
|
|
[1183]
Author: phpnut
Date: 10:42:06 PM, Sunday, October 23, 2005
Message:
Fixed errors created with change I have been making.
Controller::generateFields(); was not setting the tagName properly.
[1182]
Author: phpnut
Date: 10:13:33 PM, Sunday, October 23, 2005
Message:
Removing the need to set hasMany and hasAndBelongsToMany to plural.
All associations should be created as CamelCase associations now.
[1181]
Author: phpnut
Date: 9:38:50 PM, Sunday, October 23, 2005
Message:
Forgot dispatcher.php in last commit
[1180]
Author: phpnut
Date: 9:37:06 PM, Sunday, October 23, 2005
Message:
refactoring and removing unneeded calls to Inflector
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1184 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 03:44:54 +00:00
|
|
|
if (class_exists($this->modelClass) && ($this->uses === false))
|
2005-08-21 06:49:02 +00:00
|
|
|
{
|
[1183]
Author: phpnut
Date: 10:42:06 PM, Sunday, October 23, 2005
Message:
Fixed errors created with change I have been making.
Controller::generateFields(); was not setting the tagName properly.
[1182]
Author: phpnut
Date: 10:13:33 PM, Sunday, October 23, 2005
Message:
Removing the need to set hasMany and hasAndBelongsToMany to plural.
All associations should be created as CamelCase associations now.
[1181]
Author: phpnut
Date: 9:38:50 PM, Sunday, October 23, 2005
Message:
Forgot dispatcher.php in last commit
[1180]
Author: phpnut
Date: 9:37:06 PM, Sunday, October 23, 2005
Message:
refactoring and removing unneeded calls to Inflector
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1184 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 03:44:54 +00:00
|
|
|
$this->{$this->modelClass} =& new $this->modelClass($id);
|
|
|
|
$this->modelNames[] = $this->modelClass;
|
2005-08-21 06:49:02 +00:00
|
|
|
}
|
|
|
|
elseif ($this->uses)
|
|
|
|
{
|
|
|
|
if (!$this->db)
|
2005-07-10 05:08:19 +00:00
|
|
|
{
|
2005-08-21 06:49:02 +00:00
|
|
|
die("Controller::__construct() : ".$this->name." controller needs database access, exiting.");
|
2005-07-10 05:08:19 +00:00
|
|
|
}
|
|
|
|
|
2005-08-21 06:49:02 +00:00
|
|
|
$uses = is_array($this->uses)? $this->uses: array($this->uses);
|
2005-07-10 05:08:19 +00:00
|
|
|
|
[1183]
Author: phpnut
Date: 10:42:06 PM, Sunday, October 23, 2005
Message:
Fixed errors created with change I have been making.
Controller::generateFields(); was not setting the tagName properly.
[1182]
Author: phpnut
Date: 10:13:33 PM, Sunday, October 23, 2005
Message:
Removing the need to set hasMany and hasAndBelongsToMany to plural.
All associations should be created as CamelCase associations now.
[1181]
Author: phpnut
Date: 9:38:50 PM, Sunday, October 23, 2005
Message:
Forgot dispatcher.php in last commit
[1180]
Author: phpnut
Date: 9:37:06 PM, Sunday, October 23, 2005
Message:
refactoring and removing unneeded calls to Inflector
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1184 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 03:44:54 +00:00
|
|
|
foreach ($uses as $modelClass)
|
2005-07-10 05:08:19 +00:00
|
|
|
{
|
[1183]
Author: phpnut
Date: 10:42:06 PM, Sunday, October 23, 2005
Message:
Fixed errors created with change I have been making.
Controller::generateFields(); was not setting the tagName properly.
[1182]
Author: phpnut
Date: 10:13:33 PM, Sunday, October 23, 2005
Message:
Removing the need to set hasMany and hasAndBelongsToMany to plural.
All associations should be created as CamelCase associations now.
[1181]
Author: phpnut
Date: 9:38:50 PM, Sunday, October 23, 2005
Message:
Forgot dispatcher.php in last commit
[1180]
Author: phpnut
Date: 9:37:06 PM, Sunday, October 23, 2005
Message:
refactoring and removing unneeded calls to Inflector
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1184 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 03:44:54 +00:00
|
|
|
$modelKey = Inflector::underscore($modelClass);
|
2005-08-21 06:49:02 +00:00
|
|
|
|
2005-09-19 22:59:06 +00:00
|
|
|
if (class_exists($modelClass))
|
2005-08-21 06:49:02 +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->{$modelClass} =& new $modelClass($id);
|
|
|
|
$this->modelNames[] = $modelClass;
|
2005-08-21 06:49:02 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2005-09-19 22:59:06 +00:00
|
|
|
die("Controller::__construct() : ".ucfirst($this->name)." requires missing model {$modelClass}, exiting.");
|
2005-08-21 06:49:02 +00:00
|
|
|
}
|
2005-07-10 05:08:19 +00:00
|
|
|
}
|
2005-08-21 06:49:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-12-22 01:07:28 +00:00
|
|
|
/**
|
|
|
|
* Redirects to given $url, after turning off $this->autoRender.
|
|
|
|
*
|
|
|
|
* @param unknown_type $url
|
|
|
|
*/
|
2005-08-21 06:49:02 +00:00
|
|
|
function redirect ($url)
|
|
|
|
{
|
|
|
|
$this->autoRender = false;
|
|
|
|
header ('Location: '.$this->base.$url);
|
|
|
|
}
|
|
|
|
|
2005-12-22 01:07:28 +00:00
|
|
|
/**
|
|
|
|
* Saves a variable to use inside a template.
|
|
|
|
*
|
|
|
|
* @param mixed $one A string or an array of data.
|
|
|
|
* @param string $two Value in case $one is a string (which then works as the key), otherwise unused.
|
|
|
|
* @return unknown
|
|
|
|
*/
|
2005-08-21 06:49:02 +00:00
|
|
|
function set($one, $two=null)
|
|
|
|
{
|
|
|
|
return $this->_setArray(is_array($one)? $one: array($one=>$two));
|
|
|
|
}
|
|
|
|
|
2005-12-22 01:07:28 +00:00
|
|
|
/**
|
|
|
|
* Enter description here...
|
|
|
|
*
|
|
|
|
* @param unknown_type $action
|
|
|
|
*/
|
2005-08-21 06:49:02 +00:00
|
|
|
function setAction ($action)
|
|
|
|
{
|
|
|
|
$this->action = $action;
|
|
|
|
|
|
|
|
$args = func_get_args();
|
|
|
|
call_user_func_array(array(&$this, $action), $args);
|
|
|
|
}
|
|
|
|
|
2005-12-22 01:07:28 +00:00
|
|
|
/**
|
|
|
|
* Returns number of errors in a submitted FORM.
|
|
|
|
*
|
|
|
|
* @return int Number of errors
|
|
|
|
*/
|
2005-08-21 06:49:02 +00:00
|
|
|
function validate ()
|
|
|
|
{
|
|
|
|
$args = func_get_args();
|
|
|
|
$errors = call_user_func_array(array(&$this, 'validateErrors'), $args);
|
|
|
|
|
|
|
|
return count($errors);
|
|
|
|
}
|
|
|
|
|
2005-12-22 01:07:28 +00:00
|
|
|
/**
|
|
|
|
* Validates a FORM according to the rules set up in the Model.
|
|
|
|
*
|
|
|
|
* @return int Number of errors
|
|
|
|
*/
|
2005-08-21 06:49:02 +00:00
|
|
|
function validateErrors ()
|
|
|
|
{
|
|
|
|
$objects = func_get_args();
|
|
|
|
if (!count($objects)) return false;
|
|
|
|
|
|
|
|
$errors = array();
|
|
|
|
foreach ($objects as $object)
|
|
|
|
{
|
|
|
|
$errors = array_merge($errors, $object->invalidFields($object->data));
|
|
|
|
}
|
|
|
|
|
|
|
|
return $this->validationErrors = (count($errors)? $errors: false);
|
|
|
|
}
|
|
|
|
|
2005-12-22 01:07:28 +00:00
|
|
|
/**
|
|
|
|
* Gets an instance of the view object & prepares it for rendering the output, then
|
|
|
|
* asks the view to actualy do the job.
|
|
|
|
*
|
|
|
|
* @param unknown_type $action
|
|
|
|
* @param unknown_type $layout
|
|
|
|
* @param unknown_type $file
|
|
|
|
* @return unknown
|
|
|
|
*/
|
2005-08-21 06:49:02 +00:00
|
|
|
function render($action=null, $layout=null, $file=null)
|
|
|
|
{
|
2005-09-17 07:56:32 +00:00
|
|
|
$view =& new View($this);
|
2005-08-21 06:49:02 +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
|
|
|
if(!empty($this->modelNames))
|
2005-08-21 06:49:02 +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
|
|
|
foreach ($this->modelNames as $model)
|
2005-08-21 06:49:02 +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
|
|
|
if(!empty($this->{$model}->validationErrors))
|
2005-08-21 06:49:02 +00:00
|
|
|
{
|
2005-10-27 00:32:37 +00:00
|
|
|
$view->validationErrors[$model] =& $this->{$model}->validationErrors;
|
2005-08-21 06:49:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return $view->render($action, $layout, $file);
|
|
|
|
}
|
|
|
|
|
2005-09-17 12:37:05 +00:00
|
|
|
/**
|
2005-12-22 01:07:28 +00:00
|
|
|
* Sets data for this view. Will set title if the key "title" is in given $data array.
|
2005-09-17 12:37:05 +00:00
|
|
|
*
|
2005-12-22 01:07:28 +00:00
|
|
|
* @param array $data Array of
|
|
|
|
* @access private
|
2005-09-17 12:37:05 +00:00
|
|
|
*/
|
2005-08-21 06:49:02 +00:00
|
|
|
function _setArray($data)
|
|
|
|
{
|
|
|
|
foreach ($data as $name => $value)
|
|
|
|
{
|
|
|
|
if ($name == 'title')
|
|
|
|
$this->_setTitle($value);
|
|
|
|
else
|
|
|
|
$this->_viewVars[$name] = $value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-12-22 01:07:28 +00:00
|
|
|
/**
|
|
|
|
* Set the title element of the page.
|
|
|
|
*
|
|
|
|
* @param string $pageTitle Text for the title
|
|
|
|
* @access private
|
|
|
|
*/
|
2005-08-21 06:49:02 +00:00
|
|
|
function _setTitle($pageTitle)
|
|
|
|
{
|
|
|
|
$this->pageTitle = $pageTitle;
|
|
|
|
}
|
|
|
|
|
2005-12-22 01:07:28 +00:00
|
|
|
/**
|
|
|
|
* Shows a message to the user $time seconds, then redirects to $url
|
|
|
|
* Uses flash.thtml as a layout for the messages
|
|
|
|
*
|
|
|
|
* @param string $message Message to display to the user
|
|
|
|
* @param string $url Relative URL to redirect to after the time expires
|
|
|
|
* @param int $time Time to show the message
|
|
|
|
*/
|
2005-09-17 02:22:07 +00:00
|
|
|
function flash($message, $url, $pause=1)
|
2005-08-21 06:49:02 +00:00
|
|
|
{
|
|
|
|
$this->autoRender = false;
|
|
|
|
$this->autoLayout = false;
|
|
|
|
|
|
|
|
$this->set('url', $this->base.$url);
|
|
|
|
$this->set('message', $message);
|
2005-09-17 02:22:07 +00:00
|
|
|
$this->set('pause', $pause);
|
|
|
|
$this->set('page_title', $message);
|
2005-08-21 06:49:02 +00:00
|
|
|
|
2005-10-03 04:48:00 +00:00
|
|
|
if(file_exists(VIEWS.'layouts'.DS.'flash.thtml'))
|
|
|
|
{
|
|
|
|
$flash = VIEWS.'layouts'.DS.'flash.thtml';
|
|
|
|
}
|
|
|
|
else if(file_exists(LIBS.'view'.DS.'templates'.DS."layouts".DS.'flash.thtml'))
|
|
|
|
{
|
|
|
|
$flash = LIBS.'view'.DS.'templates'.DS."layouts".DS.'flash.thtml';
|
|
|
|
}
|
2005-12-22 01:07:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2005-10-03 04:48:00 +00:00
|
|
|
$this->render(null,false,$flash);
|
2005-08-21 06:49:02 +00:00
|
|
|
}
|
2005-08-25 03:45:14 +00:00
|
|
|
|
2005-12-22 01:07:28 +00:00
|
|
|
/**
|
|
|
|
* Shows a message to the user $time seconds, then redirects to $url
|
|
|
|
* Uses flash.thtml as a layout for the messages
|
|
|
|
*
|
|
|
|
* @param string $message Message to display to the user
|
|
|
|
* @param string $url URL to redirect to after the time expires
|
|
|
|
* @param int $time Time to show the message
|
|
|
|
*
|
|
|
|
* @param unknown_type $message
|
|
|
|
* @param unknown_type $url
|
|
|
|
* @param unknown_type $time
|
|
|
|
*/
|
2005-08-21 06:49:02 +00:00
|
|
|
function flashOut($message, $url, $time=1)
|
|
|
|
{
|
|
|
|
$this->autoRender = false;
|
|
|
|
$this->autoLayout = false;
|
|
|
|
|
|
|
|
$this->set('url', $url);
|
|
|
|
$this->set('message', $message);
|
|
|
|
$this->set('time', $time);
|
|
|
|
|
|
|
|
$this->render(null,false,VIEWS.'layouts'.DS.'flash.thtml');
|
|
|
|
}
|
2005-08-25 03:45:14 +00:00
|
|
|
|
2005-12-22 01:07:28 +00:00
|
|
|
/**
|
|
|
|
* This function creates a $fieldNames array for the view to use.
|
|
|
|
* @todo Map more database field types to html form fields.
|
|
|
|
* @todo View the database field types from all the supported databases.
|
|
|
|
*
|
|
|
|
*/
|
2005-08-25 03:45:14 +00:00
|
|
|
function generateFieldNames( $data = null, $doCreateOptions = true )
|
2005-08-21 06:49:02 +00:00
|
|
|
{
|
|
|
|
$fieldNames = array();
|
2005-12-22 01:07:28 +00:00
|
|
|
|
[1183]
Author: phpnut
Date: 10:42:06 PM, Sunday, October 23, 2005
Message:
Fixed errors created with change I have been making.
Controller::generateFields(); was not setting the tagName properly.
[1182]
Author: phpnut
Date: 10:13:33 PM, Sunday, October 23, 2005
Message:
Removing the need to set hasMany and hasAndBelongsToMany to plural.
All associations should be created as CamelCase associations now.
[1181]
Author: phpnut
Date: 9:38:50 PM, Sunday, October 23, 2005
Message:
Forgot dispatcher.php in last commit
[1180]
Author: phpnut
Date: 9:37:06 PM, Sunday, October 23, 2005
Message:
refactoring and removing unneeded calls to Inflector
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1184 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-24 03:44:54 +00:00
|
|
|
$model = $this->modelClass;
|
|
|
|
$modelKey = $this->modelKey;
|
[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
|
|
|
$table = $this->{$model}->table;
|
[1335]
Author: phpnut
Date: 2:11:57 PM, Saturday, November 05, 2005
Message:
Fixing Controller::generateFieldNames() to work with changes to Model
[1334]
Author: phpnut
Date: 1:18:02 PM, Saturday, November 05, 2005
Message:
More work on changes made in the model to allow association names to be used as an alias.
These changes are being made to update scaffold to work with changes in [1330].
Added var $alias that holds an array with the key value pair of the table name and the association name.
[1330]
Author: phpnut
Date: 10:25:16 PM, Friday, November 04, 2005
Message:
Adding fix for Ticket #127. The query returns properly now but, this breaks scaffold which I will be fixing soon.
Also the save methods for the model have not been tested but I am sure these need to be corrected also.
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1336 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-11-05 20:35:43 +00:00
|
|
|
$association = array_search($table,$this->{$model}->alias);
|
2005-12-22 01:07:28 +00:00
|
|
|
|
2005-08-23 23:21:33 +00:00
|
|
|
$classRegistry =& ClassRegistry::getInstance();
|
[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
|
|
|
$objRegistryModel = $classRegistry->getObject($modelKey);
|
2005-12-22 01:07:28 +00:00
|
|
|
|
2005-09-18 13:25:20 +00:00
|
|
|
foreach ($objRegistryModel->_tableInfo as $tables)
|
2005-08-21 06:49:02 +00:00
|
|
|
{
|
|
|
|
foreach ($tables as $tabl)
|
|
|
|
{
|
[1258]
Author: phpnut
Date: 8:13:45 PM, Friday, October 28, 2005
Message:
adding version text file
[1257]
Author: phpnut
Date: 8:03:24 PM, Friday, October 28, 2005
Message:
small typo in last commit
[1256]
Author: phpnut
Date: 7:16:50 PM, Friday, October 28, 2005
Message:
Added fix for a self join of 1 to 1 associations.
This is automatic and adds Child_ to the joined class for hasOne or belongsTo.
Scaffold is updated to work with this change.
You will have to consider the Child_ prefix when working with self joins.
[1253]
Author: phpnut
Date: 4:07:55 PM, Friday, October 28, 2005
Message:
Fixed problem with session cookies being set for each path in the URL.
Added char to switch in Controller::generateFieldNames()
[1252]
Author: phpnut
Date: 1:59:49 PM, Friday, October 28, 2005
Message:
Updated routes.php.default with change to route case.
Removed debug code I had added to Model::findAll
[1251]
Author: phpnut
Date: 1:51:00 PM, Friday, October 28, 2005
Message:
Added a fix for class already defined error.
Updated core.php docblock with level 3 setting for DEBUG.
Change instances of AppController to Controller for loading error messages.
Updated 404 errors to use default layout
[1250]
Author: phpnut
Date: 1:34:08 PM, Friday, October 28, 2005
Message:
renaming error or error404
[1249]
Author: phpnut
Date: 1:32:51 PM, Friday, October 28, 2005
Message:
moving error.thtml to errors directory
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1259 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-29 01:21:47 +00:00
|
|
|
$alias = null;
|
2005-08-21 06:49:02 +00:00
|
|
|
// set up the prompt
|
2005-08-25 16:40:50 +00:00
|
|
|
if( $objRegistryModel->isForeignKey($tabl['name']) )
|
2005-08-21 06:49:02 +00:00
|
|
|
{
|
|
|
|
$niceName = substr( $tabl['name'], 0, strpos( $tabl['name'], "_id" ) );
|
|
|
|
$fieldNames[ $tabl['name'] ]['prompt'] = Inflector::humanize($niceName);
|
|
|
|
// this is a foreign key, also set up the other controller
|
[1159]
Author: phpnut
Date: 1:39:26 PM, Saturday, October 22, 2005
Message:
Just about done with refactoring the model class.
This should be tested to make sure all changes are working as expected.
[1158]
Author: phpnut
Date: 5:34:41 AM, Saturday, October 22, 2005
Message:
More work on associations.
Adding fields setting, order by and conditions to hasMany and hasAndBelongsToMany
[1157]
Author: phpnut
Date: 3:39:13 AM, Saturday, October 22, 2005
Message:
More cleanup in Model class.
[1156]
Author: phpnut
Date: 2:43:38 AM, Saturday, October 22, 2005
Message:
Removing duplicate code the the associations.
Added Model::_associationSwitch(); to move all association settings to one location and remove duplicate code.
[1155]
Author: phpnut
Date: 1:52:47 AM, Saturday, October 22, 2005
Message:
More cleaning up of the model class
[1154]
Author: phpnut
Date: 1:40:34 AM, Saturday, October 22, 2005
Message:
Cleaning up code layout
[1153]
Author: phpnut
Date: 1:32:05 AM, Saturday, October 22, 2005
Message:
removing temp variables and extra calls to Inflector::underscore();
[1152]
Author: phpnut
Date: 1:22:58 AM, Saturday, October 22, 2005
Message:
More work on associations.
Removing code that is no longer needed.
[1151]
Author: phpnut
Date: 12:02:43 AM, Saturday, October 22, 2005
Message:
more work on associations
[1150]
Author: phpnut
Date: 6:25:45 PM, Friday, October 21, 2005
Message:
more refactoring of associations
[1149]
Author: phpnut
Date: 6:04:18 PM, Friday, October 21, 2005
Message:
refactoring model and adding more association code
[1145]
Author: phpnut
Date: 2:43:05 PM, Thursday, October 20, 2005
Message:
more refactoring on associations
[1143]
Author: phpnut
Date: 1:44:42 PM, Thursday, October 20, 2005
Message:
Refactoring associations code.
Starting work allowing full use of associations array settings
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1160 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-22 19:31:38 +00:00
|
|
|
$fieldNames[ $tabl['name'] ]['table'] = Inflector::pluralize($niceName);
|
[1335]
Author: phpnut
Date: 2:11:57 PM, Saturday, November 05, 2005
Message:
Fixing Controller::generateFieldNames() to work with changes to Model
[1334]
Author: phpnut
Date: 1:18:02 PM, Saturday, November 05, 2005
Message:
More work on changes made in the model to allow association names to be used as an alias.
These changes are being made to update scaffold to work with changes in [1330].
Added var $alias that holds an array with the key value pair of the table name and the association name.
[1330]
Author: phpnut
Date: 10:25:16 PM, Friday, November 04, 2005
Message:
Adding fix for Ticket #127. The query returns properly now but, this breaks scaffold which I will be fixing soon.
Also the save methods for the model have not been tested but I am sure these need to be corrected also.
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1336 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-11-05 20:35:43 +00:00
|
|
|
$association = array_search($fieldNames[ $tabl['name'] ]['table'],$this->{$model}->alias);
|
[1258]
Author: phpnut
Date: 8:13:45 PM, Friday, October 28, 2005
Message:
adding version text file
[1257]
Author: phpnut
Date: 8:03:24 PM, Friday, October 28, 2005
Message:
small typo in last commit
[1256]
Author: phpnut
Date: 7:16:50 PM, Friday, October 28, 2005
Message:
Added fix for a self join of 1 to 1 associations.
This is automatic and adds Child_ to the joined class for hasOne or belongsTo.
Scaffold is updated to work with this change.
You will have to consider the Child_ prefix when working with self joins.
[1253]
Author: phpnut
Date: 4:07:55 PM, Friday, October 28, 2005
Message:
Fixed problem with session cookies being set for each path in the URL.
Added char to switch in Controller::generateFieldNames()
[1252]
Author: phpnut
Date: 1:59:49 PM, Friday, October 28, 2005
Message:
Updated routes.php.default with change to route case.
Removed debug code I had added to Model::findAll
[1251]
Author: phpnut
Date: 1:51:00 PM, Friday, October 28, 2005
Message:
Added a fix for class already defined error.
Updated core.php docblock with level 3 setting for DEBUG.
Change instances of AppController to Controller for loading error messages.
Updated 404 errors to use default layout
[1250]
Author: phpnut
Date: 1:34:08 PM, Friday, October 28, 2005
Message:
renaming error or error404
[1249]
Author: phpnut
Date: 1:32:51 PM, Friday, October 28, 2005
Message:
moving error.thtml to errors directory
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1259 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-29 01:21:47 +00:00
|
|
|
if($this->{$model}->tableToModel[$fieldNames[ $tabl['name'] ]['table']] == $model)
|
|
|
|
{
|
|
|
|
$alias = 'Child_';
|
|
|
|
}
|
|
|
|
$fieldNames[ $tabl['name'] ]['prompt'] = Inflector::humanize($alias.$niceName);
|
[1335]
Author: phpnut
Date: 2:11:57 PM, Saturday, November 05, 2005
Message:
Fixing Controller::generateFieldNames() to work with changes to Model
[1334]
Author: phpnut
Date: 1:18:02 PM, Saturday, November 05, 2005
Message:
More work on changes made in the model to allow association names to be used as an alias.
These changes are being made to update scaffold to work with changes in [1330].
Added var $alias that holds an array with the key value pair of the table name and the association name.
[1330]
Author: phpnut
Date: 10:25:16 PM, Friday, November 04, 2005
Message:
Adding fix for Ticket #127. The query returns properly now but, this breaks scaffold which I will be fixing soon.
Also the save methods for the model have not been tested but I am sure these need to be corrected also.
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1336 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-11-05 20:35:43 +00:00
|
|
|
$fieldNames[ $tabl['name'] ]['model'] = $alias.$association;
|
[1258]
Author: phpnut
Date: 8:13:45 PM, Friday, October 28, 2005
Message:
adding version text file
[1257]
Author: phpnut
Date: 8:03:24 PM, Friday, October 28, 2005
Message:
small typo in last commit
[1256]
Author: phpnut
Date: 7:16:50 PM, Friday, October 28, 2005
Message:
Added fix for a self join of 1 to 1 associations.
This is automatic and adds Child_ to the joined class for hasOne or belongsTo.
Scaffold is updated to work with this change.
You will have to consider the Child_ prefix when working with self joins.
[1253]
Author: phpnut
Date: 4:07:55 PM, Friday, October 28, 2005
Message:
Fixed problem with session cookies being set for each path in the URL.
Added char to switch in Controller::generateFieldNames()
[1252]
Author: phpnut
Date: 1:59:49 PM, Friday, October 28, 2005
Message:
Updated routes.php.default with change to route case.
Removed debug code I had added to Model::findAll
[1251]
Author: phpnut
Date: 1:51:00 PM, Friday, October 28, 2005
Message:
Added a fix for class already defined error.
Updated core.php docblock with level 3 setting for DEBUG.
Change instances of AppController to Controller for loading error messages.
Updated 404 errors to use default layout
[1250]
Author: phpnut
Date: 1:34:08 PM, Friday, October 28, 2005
Message:
renaming error or error404
[1249]
Author: phpnut
Date: 1:32:51 PM, Friday, October 28, 2005
Message:
moving error.thtml to errors directory
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1259 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-29 01:21:47 +00:00
|
|
|
$fieldNames[ $tabl['name'] ]['modelKey'] = $this->{$model}->tableToModel[$fieldNames[ $tabl['name'] ]['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
|
|
|
$fieldNames[ $tabl['name'] ]['controller'] = Inflector::pluralize($this->{$model}->tableToModel[Inflector::pluralize($niceName)]);
|
2005-08-21 06:49:02 +00:00
|
|
|
$fieldNames[ $tabl['name'] ]['foreignKey'] = true;
|
[1258]
Author: phpnut
Date: 8:13:45 PM, Friday, October 28, 2005
Message:
adding version text file
[1257]
Author: phpnut
Date: 8:03:24 PM, Friday, October 28, 2005
Message:
small typo in last commit
[1256]
Author: phpnut
Date: 7:16:50 PM, Friday, October 28, 2005
Message:
Added fix for a self join of 1 to 1 associations.
This is automatic and adds Child_ to the joined class for hasOne or belongsTo.
Scaffold is updated to work with this change.
You will have to consider the Child_ prefix when working with self joins.
[1253]
Author: phpnut
Date: 4:07:55 PM, Friday, October 28, 2005
Message:
Fixed problem with session cookies being set for each path in the URL.
Added char to switch in Controller::generateFieldNames()
[1252]
Author: phpnut
Date: 1:59:49 PM, Friday, October 28, 2005
Message:
Updated routes.php.default with change to route case.
Removed debug code I had added to Model::findAll
[1251]
Author: phpnut
Date: 1:51:00 PM, Friday, October 28, 2005
Message:
Added a fix for class already defined error.
Updated core.php docblock with level 3 setting for DEBUG.
Change instances of AppController to Controller for loading error messages.
Updated 404 errors to use default layout
[1250]
Author: phpnut
Date: 1:34:08 PM, Friday, October 28, 2005
Message:
renaming error or error404
[1249]
Author: phpnut
Date: 1:32:51 PM, Friday, October 28, 2005
Message:
moving error.thtml to errors directory
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1259 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-29 01:21:47 +00:00
|
|
|
}
|
2005-08-21 06:49:02 +00:00
|
|
|
else if( 'created' != $tabl['name'] && 'updated' != $tabl['name'] )
|
|
|
|
{
|
|
|
|
$fieldNames[$tabl['name']]['prompt'] = Inflector::humanize($tabl['name']);
|
|
|
|
}
|
|
|
|
else if( 'created' == $tabl['name'] )
|
|
|
|
{
|
|
|
|
$fieldNames[$tabl['name']]['prompt'] = 'Created';
|
|
|
|
}
|
|
|
|
else if( 'updated' == $tabl['name'] )
|
|
|
|
{
|
|
|
|
$fieldNames[$tabl['name']]['prompt'] = 'Modified';
|
|
|
|
}
|
2005-08-25 03:45:14 +00:00
|
|
|
|
2005-08-21 06:49:02 +00:00
|
|
|
// Now, set up some other attributes that will be useful for auto generating a form.
|
|
|
|
//tagName is in the format table/field "post/title"
|
[1198]
Author: phpnut
Date: 7:29:04 PM, Monday, October 24, 2005
Message:
More work on changes to use CamelCase throughout the system.
[1197]
Author: phpnut
Date: 2:57:08 PM, Monday, October 24, 2005
Message:
Removing unneeded calls to Inflector class
[1196]
Author: phpnut
Date: 2:39:30 PM, Monday, October 24, 2005
Message:
adding fix for Ticket #61
[1195]
Author: phpnut
Date: 11:19:43 AM, Monday, October 24, 2005
Message:
Adding fix for Ticket #47
[1194]
Author: phpnut
Date: 10:10:41 AM, Monday, October 24, 2005
Message:
Adding fix for Ticket #49
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1199 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-25 00:33:08 +00:00
|
|
|
$fieldNames[ $tabl['name']]['tagName'] = $model.'/'.$tabl['name'];
|
2005-08-21 06:49:02 +00:00
|
|
|
|
|
|
|
// Now, find out if this is a required field.
|
2005-08-21 20:01:32 +00:00
|
|
|
//$validationFields = $classRegistry->getObject($table)->validate;
|
|
|
|
$validationFields = $objRegistryModel->validate;
|
2005-08-21 06:49:02 +00:00
|
|
|
if( isset( $validationFields[ $tabl['name'] ] ) )
|
|
|
|
{
|
|
|
|
// Now, we know that this field has some validation set.
|
|
|
|
// find out if it is a required field.
|
2005-08-25 03:45:14 +00:00
|
|
|
if( VALID_NOT_EMPTY == $validationFields[ $tabl['name'] ] )
|
2005-08-21 06:49:02 +00:00
|
|
|
{
|
|
|
|
// this is a required field.
|
|
|
|
$fieldNames[$tabl['name']]['required'] = true;
|
|
|
|
$fieldNames[$tabl['name']]['errorMsg'] = "Required Field";
|
|
|
|
}
|
|
|
|
}
|
2005-08-25 03:45:14 +00:00
|
|
|
|
2005-08-21 06:49:02 +00:00
|
|
|
// now, determine what the input type should be for this database field.
|
|
|
|
$lParenPos = strpos( $tabl['type'], '(');
|
|
|
|
$rParenPos = strpos( $tabl['type'], ')');
|
|
|
|
if( false != $lParenPos )
|
|
|
|
{
|
|
|
|
$type = substr($tabl['type'], 0, $lParenPos );
|
|
|
|
$fieldLength = substr( $tabl['type'], $lParenPos+1, $rParenPos - $lParenPos -1 );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$type = $tabl['type'];
|
|
|
|
}
|
|
|
|
switch( $type )
|
|
|
|
{
|
2005-12-22 01:07:28 +00:00
|
|
|
|
2005-08-21 06:49:02 +00:00
|
|
|
case "text":
|
[1198]
Author: phpnut
Date: 7:29:04 PM, Monday, October 24, 2005
Message:
More work on changes to use CamelCase throughout the system.
[1197]
Author: phpnut
Date: 2:57:08 PM, Monday, October 24, 2005
Message:
Removing unneeded calls to Inflector class
[1196]
Author: phpnut
Date: 2:39:30 PM, Monday, October 24, 2005
Message:
adding fix for Ticket #61
[1195]
Author: phpnut
Date: 11:19:43 AM, Monday, October 24, 2005
Message:
Adding fix for Ticket #47
[1194]
Author: phpnut
Date: 10:10:41 AM, Monday, October 24, 2005
Message:
Adding fix for Ticket #49
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1199 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-25 00:33:08 +00:00
|
|
|
case "mediumtext":
|
2005-08-25 03:45:14 +00:00
|
|
|
{
|
2005-08-21 06:49:02 +00:00
|
|
|
$fieldNames[ $tabl['name']]['type'] = 'area';
|
|
|
|
//$fieldNames[ $tabl['name']]['size'] = $fieldLength;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case "varchar":
|
[1258]
Author: phpnut
Date: 8:13:45 PM, Friday, October 28, 2005
Message:
adding version text file
[1257]
Author: phpnut
Date: 8:03:24 PM, Friday, October 28, 2005
Message:
small typo in last commit
[1256]
Author: phpnut
Date: 7:16:50 PM, Friday, October 28, 2005
Message:
Added fix for a self join of 1 to 1 associations.
This is automatic and adds Child_ to the joined class for hasOne or belongsTo.
Scaffold is updated to work with this change.
You will have to consider the Child_ prefix when working with self joins.
[1253]
Author: phpnut
Date: 4:07:55 PM, Friday, October 28, 2005
Message:
Fixed problem with session cookies being set for each path in the URL.
Added char to switch in Controller::generateFieldNames()
[1252]
Author: phpnut
Date: 1:59:49 PM, Friday, October 28, 2005
Message:
Updated routes.php.default with change to route case.
Removed debug code I had added to Model::findAll
[1251]
Author: phpnut
Date: 1:51:00 PM, Friday, October 28, 2005
Message:
Added a fix for class already defined error.
Updated core.php docblock with level 3 setting for DEBUG.
Change instances of AppController to Controller for loading error messages.
Updated 404 errors to use default layout
[1250]
Author: phpnut
Date: 1:34:08 PM, Friday, October 28, 2005
Message:
renaming error or error404
[1249]
Author: phpnut
Date: 1:32:51 PM, Friday, October 28, 2005
Message:
moving error.thtml to errors directory
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1259 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-29 01:21:47 +00:00
|
|
|
case "char":
|
2005-08-21 06:49:02 +00:00
|
|
|
{
|
|
|
|
if( isset( $fieldNames[ $tabl['name']]['foreignKey'] ) )
|
|
|
|
{
|
|
|
|
$fieldNames[ $tabl['name']]['type'] = 'select';
|
|
|
|
// This is a foreign key select dropdown box. now, we have to add the options.
|
|
|
|
$fieldNames[ $tabl['name']]['options'] = array();
|
2005-08-25 03:45:14 +00:00
|
|
|
|
2005-08-21 06:49:02 +00:00
|
|
|
// get the list of options from the other model.
|
2005-10-24 07:51:09 +00:00
|
|
|
$registry = ClassRegistry::getInstance();
|
[1258]
Author: phpnut
Date: 8:13:45 PM, Friday, October 28, 2005
Message:
adding version text file
[1257]
Author: phpnut
Date: 8:03:24 PM, Friday, October 28, 2005
Message:
small typo in last commit
[1256]
Author: phpnut
Date: 7:16:50 PM, Friday, October 28, 2005
Message:
Added fix for a self join of 1 to 1 associations.
This is automatic and adds Child_ to the joined class for hasOne or belongsTo.
Scaffold is updated to work with this change.
You will have to consider the Child_ prefix when working with self joins.
[1253]
Author: phpnut
Date: 4:07:55 PM, Friday, October 28, 2005
Message:
Fixed problem with session cookies being set for each path in the URL.
Added char to switch in Controller::generateFieldNames()
[1252]
Author: phpnut
Date: 1:59:49 PM, Friday, October 28, 2005
Message:
Updated routes.php.default with change to route case.
Removed debug code I had added to Model::findAll
[1251]
Author: phpnut
Date: 1:51:00 PM, Friday, October 28, 2005
Message:
Added a fix for class already defined error.
Updated core.php docblock with level 3 setting for DEBUG.
Change instances of AppController to Controller for loading error messages.
Updated 404 errors to use default layout
[1250]
Author: phpnut
Date: 1:34:08 PM, Friday, October 28, 2005
Message:
renaming error or error404
[1249]
Author: phpnut
Date: 1:32:51 PM, Friday, October 28, 2005
Message:
moving error.thtml to errors directory
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1259 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-29 01:21:47 +00:00
|
|
|
$otherModel = $registry->getObject(Inflector::underscore($fieldNames[$tabl['name']]['modelKey']));
|
2005-12-22 01:07:28 +00:00
|
|
|
|
2005-08-25 03:45:14 +00:00
|
|
|
if( is_object($otherModel) )
|
2005-08-21 06:49:02 +00:00
|
|
|
{
|
|
|
|
if( $doCreateOptions )
|
|
|
|
{
|
|
|
|
$otherDisplayField = $otherModel->getDisplayField();
|
|
|
|
foreach( $otherModel->findAll() as $pass )
|
|
|
|
{
|
2005-08-25 03:45:14 +00:00
|
|
|
foreach( $pass as $key=>$value )
|
2005-08-21 06:49:02 +00:00
|
|
|
{
|
2005-12-22 01:07:28 +00:00
|
|
|
|
2005-12-23 21:57:26 +00:00
|
|
|
if( $alias.$key == $this->{$model}->tableToModel[$fieldNames[ $tabl['name'] ]['table']] && isset( $value[$otherModel->primaryKey] ) && isset( $value[$otherDisplayField] ) )
|
2005-08-21 06:49:02 +00:00
|
|
|
{
|
2005-12-23 21:57:26 +00:00
|
|
|
$fieldNames[ $tabl['name']]['options'][$value[$otherModel->primaryKey]] = $value[$otherDisplayField];
|
2005-08-21 06:49:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
[1335]
Author: phpnut
Date: 2:11:57 PM, Saturday, November 05, 2005
Message:
Fixing Controller::generateFieldNames() to work with changes to Model
[1334]
Author: phpnut
Date: 1:18:02 PM, Saturday, November 05, 2005
Message:
More work on changes made in the model to allow association names to be used as an alias.
These changes are being made to update scaffold to work with changes in [1330].
Added var $alias that holds an array with the key value pair of the table name and the association name.
[1330]
Author: phpnut
Date: 10:25:16 PM, Friday, November 04, 2005
Message:
Adding fix for Ticket #127. The query returns properly now but, this breaks scaffold which I will be fixing soon.
Also the save methods for the model have not been tested but I am sure these need to be corrected also.
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1336 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-11-05 20:35:43 +00:00
|
|
|
$fieldNames[ $tabl['name']]['selected'] = $data[$association][$tabl['name']];
|
2005-08-21 06:49:02 +00:00
|
|
|
}
|
|
|
|
}
|
2005-08-25 03:45:14 +00:00
|
|
|
else
|
2005-08-21 06:49:02 +00:00
|
|
|
{
|
|
|
|
$fieldNames[ $tabl['name']]['type'] = 'input';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
2005-08-25 03:45:14 +00:00
|
|
|
case "tinyint":
|
|
|
|
{
|
|
|
|
if( $fieldLength > 1 )
|
|
|
|
{
|
|
|
|
$fieldNames[ $tabl['name']]['type'] = 'input';
|
|
|
|
}
|
2005-12-22 01:07:28 +00:00
|
|
|
else
|
2005-08-25 03:45:14 +00:00
|
|
|
{
|
|
|
|
$fieldNames[ $tabl['name']]['type'] = 'checkbox';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
2005-08-21 06:49:02 +00:00
|
|
|
case "int":
|
2005-08-25 16:40:50 +00:00
|
|
|
case "smallint":
|
|
|
|
case "mediumint":
|
|
|
|
case "bigint":
|
2005-08-21 06:49:02 +00:00
|
|
|
case "decimal":
|
2005-08-21 20:01:32 +00:00
|
|
|
case "float":
|
|
|
|
case "double":
|
2005-08-21 06:49:02 +00:00
|
|
|
{
|
|
|
|
//BUGBUG: Need a better way to determine if this field is an auto increment foreign key.
|
|
|
|
// If it is a number, and it is a foreign key, we'll make a HUGE assumption that it is an auto increment field.
|
|
|
|
// for foreign key autonumber fields, we'll set the type to 'key' so that it does not display in the input form.
|
2005-12-23 21:57:26 +00:00
|
|
|
|
|
|
|
$charCount = strlen($this->$model->primaryKey);
|
|
|
|
if( 0 == strncmp($tabl['name'], $this->$model->primaryKey, $charCount) )
|
2005-08-21 06:49:02 +00:00
|
|
|
{
|
|
|
|
$fieldNames[ $tabl['name']]['type'] = 'hidden';
|
|
|
|
}
|
|
|
|
else if( isset( $fieldNames[ $tabl['name']]['foreignKey'] ) )
|
|
|
|
{
|
|
|
|
$fieldNames[ $tabl['name']]['type'] = 'select';
|
|
|
|
// This is a foreign key select dropdown box. now, we have to add the options.
|
|
|
|
$fieldNames[ $tabl['name']]['options'] = array();
|
2005-08-25 03:45:14 +00:00
|
|
|
|
2005-08-21 06:49:02 +00:00
|
|
|
// get the list of options from the other model.
|
2005-10-24 07:51:09 +00:00
|
|
|
$registry = ClassRegistry::getInstance();
|
[1258]
Author: phpnut
Date: 8:13:45 PM, Friday, October 28, 2005
Message:
adding version text file
[1257]
Author: phpnut
Date: 8:03:24 PM, Friday, October 28, 2005
Message:
small typo in last commit
[1256]
Author: phpnut
Date: 7:16:50 PM, Friday, October 28, 2005
Message:
Added fix for a self join of 1 to 1 associations.
This is automatic and adds Child_ to the joined class for hasOne or belongsTo.
Scaffold is updated to work with this change.
You will have to consider the Child_ prefix when working with self joins.
[1253]
Author: phpnut
Date: 4:07:55 PM, Friday, October 28, 2005
Message:
Fixed problem with session cookies being set for each path in the URL.
Added char to switch in Controller::generateFieldNames()
[1252]
Author: phpnut
Date: 1:59:49 PM, Friday, October 28, 2005
Message:
Updated routes.php.default with change to route case.
Removed debug code I had added to Model::findAll
[1251]
Author: phpnut
Date: 1:51:00 PM, Friday, October 28, 2005
Message:
Added a fix for class already defined error.
Updated core.php docblock with level 3 setting for DEBUG.
Change instances of AppController to Controller for loading error messages.
Updated 404 errors to use default layout
[1250]
Author: phpnut
Date: 1:34:08 PM, Friday, October 28, 2005
Message:
renaming error or error404
[1249]
Author: phpnut
Date: 1:32:51 PM, Friday, October 28, 2005
Message:
moving error.thtml to errors directory
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1259 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-29 01:21:47 +00:00
|
|
|
$otherModel = $registry->getObject(Inflector::underscore($fieldNames[$tabl['name']]['modelKey']));
|
2005-12-22 01:07:28 +00:00
|
|
|
|
2005-08-25 03:45:14 +00:00
|
|
|
if( is_object($otherModel) )
|
2005-08-21 06:49:02 +00:00
|
|
|
{
|
2005-08-25 03:45:14 +00:00
|
|
|
if( $doCreateOptions )
|
2005-08-21 06:49:02 +00:00
|
|
|
{
|
|
|
|
$otherDisplayField = $otherModel->getDisplayField();
|
|
|
|
foreach( $otherModel->findAll() as $pass )
|
|
|
|
{
|
2005-08-25 03:45:14 +00:00
|
|
|
foreach( $pass as $key=>$value )
|
2005-08-21 06:49:02 +00:00
|
|
|
{
|
2005-12-23 21:57:26 +00:00
|
|
|
if( $alias.$key == $this->{$model}->tableToModel[$fieldNames[ $tabl['name'] ]['table']] && isset( $value[$otherModel->primaryKey] ) && isset( $value[$otherDisplayField] ) )
|
2005-08-21 06:49:02 +00:00
|
|
|
{
|
2005-12-23 21:57:26 +00:00
|
|
|
$fieldNames[ $tabl['name']]['options'][$value[$otherModel->primaryKey]] = $value[$otherDisplayField];
|
2005-08-21 06:49:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
[1198]
Author: phpnut
Date: 7:29:04 PM, Monday, October 24, 2005
Message:
More work on changes to use CamelCase throughout the system.
[1197]
Author: phpnut
Date: 2:57:08 PM, Monday, October 24, 2005
Message:
Removing unneeded calls to Inflector class
[1196]
Author: phpnut
Date: 2:39:30 PM, Monday, October 24, 2005
Message:
adding fix for Ticket #61
[1195]
Author: phpnut
Date: 11:19:43 AM, Monday, October 24, 2005
Message:
Adding fix for Ticket #47
[1194]
Author: phpnut
Date: 10:10:41 AM, Monday, October 24, 2005
Message:
Adding fix for Ticket #49
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1199 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-25 00:33:08 +00:00
|
|
|
$fieldNames[ $tabl['name']]['selected'] = $data[$model][$tabl['name']];
|
2005-08-21 06:49:02 +00:00
|
|
|
}
|
|
|
|
}
|
2005-08-25 03:45:14 +00:00
|
|
|
else
|
2005-08-21 06:49:02 +00:00
|
|
|
{
|
|
|
|
$fieldNames[ $tabl['name']]['type'] = 'input';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case "enum":
|
|
|
|
{
|
|
|
|
// for enums, the $fieldLength variable is actually the list of enums.
|
|
|
|
$fieldNames[ $tabl['name']]['type'] = 'select';
|
|
|
|
// This is a foreign key select dropdown box. now, we have to add the options.
|
|
|
|
$fieldNames[ $tabl['name']]['options'] = array();
|
2005-08-25 03:45:14 +00:00
|
|
|
|
2005-08-21 06:49:02 +00:00
|
|
|
$enumValues = split(',', $fieldLength );
|
2005-08-25 03:45:14 +00:00
|
|
|
foreach ($enumValues as $enum )
|
2005-08-21 06:49:02 +00:00
|
|
|
{
|
|
|
|
$enum = trim( $enum, "'" );
|
|
|
|
$fieldNames[$tabl['name']]['options'][$enum] = $enum;
|
|
|
|
}
|
[1198]
Author: phpnut
Date: 7:29:04 PM, Monday, October 24, 2005
Message:
More work on changes to use CamelCase throughout the system.
[1197]
Author: phpnut
Date: 2:57:08 PM, Monday, October 24, 2005
Message:
Removing unneeded calls to Inflector class
[1196]
Author: phpnut
Date: 2:39:30 PM, Monday, October 24, 2005
Message:
adding fix for Ticket #61
[1195]
Author: phpnut
Date: 11:19:43 AM, Monday, October 24, 2005
Message:
Adding fix for Ticket #47
[1194]
Author: phpnut
Date: 10:10:41 AM, Monday, October 24, 2005
Message:
Adding fix for Ticket #49
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1199 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-10-25 00:33:08 +00:00
|
|
|
$fieldNames[ $tabl['name']]['selected'] = $data[$model][$tabl['name']];
|
2005-08-21 06:49:02 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case "date":
|
|
|
|
case "datetime":
|
|
|
|
{
|
2005-08-21 20:01:32 +00:00
|
|
|
if( 0 != strncmp( "created", $tabl['name'], 6 ) && 0 != strncmp("modified",$tabl['name'], 8) )
|
2005-08-21 06:49:02 +00:00
|
|
|
$fieldNames[ $tabl['name']]['type'] = $type;
|
2005-08-25 03:45:14 +00:00
|
|
|
}
|
2005-08-21 06:49:02 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
//sorry, this database field type is not yet set up.
|
2005-08-25 03:45:14 +00:00
|
|
|
break;
|
2005-08-21 06:49:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
} // end switch
|
2005-07-10 05:08:19 +00:00
|
|
|
}
|
2005-08-21 20:01:32 +00:00
|
|
|
// now, add any necessary hasAndBelongsToMany list boxes
|
|
|
|
// loop through the many to many relations to make a list box.
|
2005-08-25 03:45:14 +00:00
|
|
|
foreach( $objRegistryModel->_manyToMany as $relation )
|
2005-08-21 20:01:32 +00:00
|
|
|
{
|
[1335]
Author: phpnut
Date: 2:11:57 PM, Saturday, November 05, 2005
Message:
Fixing Controller::generateFieldNames() to work with changes to Model
[1334]
Author: phpnut
Date: 1:18:02 PM, Saturday, November 05, 2005
Message:
More work on changes made in the model to allow association names to be used as an alias.
These changes are being made to update scaffold to work with changes in [1330].
Added var $alias that holds an array with the key value pair of the table name and the association name.
[1330]
Author: phpnut
Date: 10:25:16 PM, Friday, November 04, 2005
Message:
Adding fix for Ticket #127. The query returns properly now but, this breaks scaffold which I will be fixing soon.
Also the save methods for the model have not been tested but I am sure these need to be corrected also.
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1336 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-11-05 20:35:43 +00:00
|
|
|
//list($modelName) = $relation;
|
2005-12-22 01:07:28 +00:00
|
|
|
list($manyAssociation, $modelName, $value) = $relation;
|
[1285]
Author: phpnut
Date: 10:09:03 PM, Monday, October 31, 2005
Message:
Removed references in the Session class
[1283]
Author: phpnut
Date: 8:47:37 PM, Monday, October 31, 2005
Message:
Added fix to the Controller::constructClassess().
The database should have an instance available if a component will use it.
[1282]
Author: phpnut
Date: 8:36:07 PM, Monday, October 31, 2005
Message:
Updated the Model association methods to correct and error I introduced when reactoring last week.
Added a return from each of the settings in Security::inactiveMins(); This class is not fully implemented.
Updated scaffold and dipatcher with changes to the session class.
Fixed problem with session not working properly.
Added a regenrate id for sessions.
When CAKE_SECURITY is set to high this will regenrate a new session key on each request.
The old session file will be removed from the file system. This is a added security measure.
[1270]
Author: phpnut
Date: 1:55:28 PM, Sunday, October 30, 2005
Message:
Updated Session class to regenrate a new session key on each request when security level set to high.
Updated doc comments in some classes
[1269]
Author: phpnut
Date: 9:49:43 AM, Sunday, October 30, 2005
Message:
Added a fix for Ticket #105
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1286 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-11-01 04:20:28 +00:00
|
|
|
$modelKeyM = Inflector::underscore($modelName);
|
2005-10-24 07:51:09 +00:00
|
|
|
$modelObject = new $modelName();
|
2005-08-25 03:45:14 +00:00
|
|
|
|
|
|
|
if( $doCreateOptions )
|
2005-08-21 20:01:32 +00:00
|
|
|
{
|
2005-10-24 07:51:09 +00:00
|
|
|
$otherDisplayField = $modelObject->getDisplayField();
|
[1285]
Author: phpnut
Date: 10:09:03 PM, Monday, October 31, 2005
Message:
Removed references in the Session class
[1283]
Author: phpnut
Date: 8:47:37 PM, Monday, October 31, 2005
Message:
Added fix to the Controller::constructClassess().
The database should have an instance available if a component will use it.
[1282]
Author: phpnut
Date: 8:36:07 PM, Monday, October 31, 2005
Message:
Updated the Model association methods to correct and error I introduced when reactoring last week.
Added a return from each of the settings in Security::inactiveMins(); This class is not fully implemented.
Updated scaffold and dipatcher with changes to the session class.
Fixed problem with session not working properly.
Added a regenrate id for sessions.
When CAKE_SECURITY is set to high this will regenrate a new session key on each request.
The old session file will be removed from the file system. This is a added security measure.
[1270]
Author: phpnut
Date: 1:55:28 PM, Sunday, October 30, 2005
Message:
Updated Session class to regenrate a new session key on each request when security level set to high.
Updated doc comments in some classes
[1269]
Author: phpnut
Date: 9:49:43 AM, Sunday, October 30, 2005
Message:
Added a fix for Ticket #105
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1286 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-11-01 04:20:28 +00:00
|
|
|
$fieldNames[$modelKeyM]['model'] = $modelName;
|
|
|
|
$fieldNames[$modelKeyM]['prompt'] = "Related ".Inflector::humanize(Inflector::pluralize($modelName));
|
|
|
|
$fieldNames[$modelKeyM]['type'] = "selectMultiple";
|
[1335]
Author: phpnut
Date: 2:11:57 PM, Saturday, November 05, 2005
Message:
Fixing Controller::generateFieldNames() to work with changes to Model
[1334]
Author: phpnut
Date: 1:18:02 PM, Saturday, November 05, 2005
Message:
More work on changes made in the model to allow association names to be used as an alias.
These changes are being made to update scaffold to work with changes in [1330].
Added var $alias that holds an array with the key value pair of the table name and the association name.
[1330]
Author: phpnut
Date: 10:25:16 PM, Friday, November 04, 2005
Message:
Adding fix for Ticket #127. The query returns properly now but, this breaks scaffold which I will be fixing soon.
Also the save methods for the model have not been tested but I am sure these need to be corrected also.
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1336 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-11-05 20:35:43 +00:00
|
|
|
$fieldNames[$modelKeyM]['tagName'] = $manyAssociation.'/'.$manyAssociation;
|
2005-08-25 03:45:14 +00:00
|
|
|
|
2005-10-24 07:51:09 +00:00
|
|
|
foreach( $modelObject->findAll() as $pass )
|
2005-08-21 20:01:32 +00:00
|
|
|
{
|
2005-08-25 03:45:14 +00:00
|
|
|
foreach( $pass as $key=>$value )
|
2005-08-21 20:01:32 +00:00
|
|
|
{
|
2005-12-23 21:57:26 +00:00
|
|
|
if( $key == $modelName && isset( $value[$modelObject->primaryKey] ) && isset( $value[$otherDisplayField] ) )
|
2005-08-21 20:01:32 +00:00
|
|
|
{
|
2005-12-23 21:57:26 +00:00
|
|
|
$fieldNames[$modelKeyM]['options'][$value[$modelObject->primaryKey]] = $value[$otherDisplayField];
|
2005-08-21 20:01:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
[1335]
Author: phpnut
Date: 2:11:57 PM, Saturday, November 05, 2005
Message:
Fixing Controller::generateFieldNames() to work with changes to Model
[1334]
Author: phpnut
Date: 1:18:02 PM, Saturday, November 05, 2005
Message:
More work on changes made in the model to allow association names to be used as an alias.
These changes are being made to update scaffold to work with changes in [1330].
Added var $alias that holds an array with the key value pair of the table name and the association name.
[1330]
Author: phpnut
Date: 10:25:16 PM, Friday, November 04, 2005
Message:
Adding fix for Ticket #127. The query returns properly now but, this breaks scaffold which I will be fixing soon.
Also the save methods for the model have not been tested but I am sure these need to be corrected also.
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1336 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-11-05 20:35:43 +00:00
|
|
|
if( isset( $data[$manyAssociation] ) )
|
2005-08-21 20:01:32 +00:00
|
|
|
{
|
[1335]
Author: phpnut
Date: 2:11:57 PM, Saturday, November 05, 2005
Message:
Fixing Controller::generateFieldNames() to work with changes to Model
[1334]
Author: phpnut
Date: 1:18:02 PM, Saturday, November 05, 2005
Message:
More work on changes made in the model to allow association names to be used as an alias.
These changes are being made to update scaffold to work with changes in [1330].
Added var $alias that holds an array with the key value pair of the table name and the association name.
[1330]
Author: phpnut
Date: 10:25:16 PM, Friday, November 04, 2005
Message:
Adding fix for Ticket #127. The query returns properly now but, this breaks scaffold which I will be fixing soon.
Also the save methods for the model have not been tested but I am sure these need to be corrected also.
git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1336 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-11-05 20:35:43 +00:00
|
|
|
foreach( $data[$manyAssociation] as $key => $row )
|
2005-08-21 20:01:32 +00:00
|
|
|
{
|
2005-12-23 21:57:26 +00:00
|
|
|
$fieldNames[$modelKeyM]['selected'][$row[$modelObject->primaryKey]] = $row[$modelObject->primaryKey];
|
2005-08-21 20:01:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} // end loop through manytomany relations.
|
2005-08-21 06:49:02 +00:00
|
|
|
}
|
2005-12-22 01:07:28 +00:00
|
|
|
|
2005-08-21 06:49:02 +00:00
|
|
|
return $fieldNames;
|
2005-08-25 03:45:14 +00:00
|
|
|
}
|
2005-06-19 23:30:36 +00:00
|
|
|
}
|
|
|
|
|
2005-07-03 07:07:47 +00:00
|
|
|
?>
|