* Copyright (c) 2006, Cake Software Foundation, Inc.
* 1785 E. Sahara Avenue, Suite 490-204
* Las Vegas, Nevada 89104
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright (c) 2006, Cake Software Foundation, Inc.
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP Project
* @package cake
* @subpackage cake.cake.libs.view.templates.scaffolds
* @since CakePHP v 0.10.0.1076
* @version $Revision$
* @modifiedby $LastChangedBy$
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
?>
name));
$modelKey = Inflector::underscore($modelName);
$objModel =& ClassRegistry::getObject($modelKey);
if(is_null($this->plugin))
{
$path = '/';
}
else
{
$path = '/'.$this->plugin.'/';
}
if(!empty($objModel->alias))
{
foreach ($objModel->alias as $key => $value)
{
$alias[] = $key;
}
$count = 0;
}
?>
View
$value)
{
echo "- ".$value['prompt']."
";
if(isset($value['foreignKey']))
{
$otherModelObject =& ClassRegistry::getObject(Inflector::underscore($objModel->tableToModel[$value['table']]));
$displayField = $otherModelObject->getDisplayField();
$displayText = $data[$alias[$count]][$displayField];
if(!empty($data[$objModel->tableToModel[$objModel->table]][$field]) && (isset($displayText)))
{
echo "- ".$html->link($displayText, $path.Inflector::underscore($value['controller']).'/view/'
.$data[$objModel->tableToModel[$objModel->table]][$field] )."
";
}
else
{
echo "-
";
}
$count++;
}
else
{
if( !empty($data[$objModel->tableToModel[$objModel->table]][$field]))
{
echo "- ".$data[$objModel->tableToModel[$objModel->table]][$field]."
";
}
else
{
echo "-
";
}
}
}
?>
".$html->link('Edit '.Inflector::humanize($objModel->name), $path.$this->viewPath.'/edit/'.$data[$objModel->tableToModel[$objModel->table]][$this->controller->{$modelName}->primaryKey])."";
echo "- ".$html->link('Delete '.Inflector::humanize($objModel->name), $path.$this->viewPath.'/delete/'.$data[$objModel->tableToModel[$objModel->table]][$this->controller->{$modelName}->primaryKey])."
";
echo "- ".$html->link('List '.Inflector::humanize($objModel->name), $path.$this->viewPath.'/index')."
";
echo "- ".$html->link('New '.Inflector::humanize($objModel->name), $path.$this->viewPath.'/add')."
";
foreach( $fieldNames as $field => $value )
{
if( isset( $value['foreignKey'] ) )
{
echo "- ".$html->link( "List ".Inflector::humanize($value['controller']), $path.Inflector::underscore($value['controller'])."/index/")."
";
}
}
?>
hasOne as $association => $relation)
{
$model = $relation['className'];
$otherModelName = $objModel->tableToModel[$objModel->{$model}->table];
$controller = Inflector::pluralize($model);
$new = true;
echo "";
}
else
{
echo "- ".$html->link('New '.Inflector::humanize($association),$path.Inflector::underscore($controller)."/add/{$data[$association][$objModel->{$model}->primaryKey]}")."
";
}
}
}
?>
hasMany, $objModel->hasAndBelongsToMany);
foreach($relations as $association => $relation)
{
$model = $relation['className'];
$count = 0;
$otherModelName = Inflector::singularize($model);
$controller = Inflector::pluralize($model);
echo "