2007-06-03 23:56:56 +00:00
|
|
|
<?php
|
|
|
|
/* SVN FILE: $Id$ */
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* PHP versions 4 and 5
|
|
|
|
*
|
|
|
|
* CakePHP(tm) : Rapid Development Framework <http://www.cakephp.org/>
|
|
|
|
* Copyright 2005-2007, 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 2005-2007, Cake Software Foundation, Inc.
|
|
|
|
* @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
|
|
|
|
* @package cake
|
|
|
|
* @subpackage cake.cake.console.libs.templates.views
|
2007-06-16 02:19:31 +00:00
|
|
|
* @since CakePHP(tm) v 1.2.0.5234
|
2007-06-03 23:56:56 +00:00
|
|
|
* @version $Revision$
|
|
|
|
* @modifiedby $LastChangedBy$
|
|
|
|
* @lastmodified $Date$
|
|
|
|
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
|
|
|
*/
|
|
|
|
?>
|
2007-06-04 19:12:11 +00:00
|
|
|
<div class="<?php echo $singularVar;?>">
|
2007-06-03 23:56:56 +00:00
|
|
|
<?php echo "<?php echo \$form->create('{$modelClass}');?>\n";?>
|
|
|
|
<fieldset>
|
2007-06-27 14:55:13 +00:00
|
|
|
<legend><?php echo "<?php __('".Inflector::humanize($action)."');?> <?php __('{$singularHumanName}');?>";?></legend>
|
2007-06-03 23:56:56 +00:00
|
|
|
<?php
|
|
|
|
echo "\t<?php\n";
|
2007-06-20 06:15:35 +00:00
|
|
|
foreach ($fields as $field) {
|
|
|
|
if ($action == 'add' && $field['name'] == $primaryKey) {
|
2007-06-03 23:56:56 +00:00
|
|
|
continue;
|
2007-06-20 07:51:52 +00:00
|
|
|
} elseif (!in_array($field['name'], array('created', 'modified', 'updated'))) {
|
2007-06-03 23:56:56 +00:00
|
|
|
echo "\t\techo \$form->input('{$field['name']}');\n";
|
|
|
|
}
|
|
|
|
}
|
2007-06-20 06:15:35 +00:00
|
|
|
foreach ($hasAndBelongsToMany as $assocName => $assocData) {
|
2007-06-08 16:30:22 +00:00
|
|
|
echo "\t\techo \$form->input('{$assocName}');\n";
|
2007-06-03 23:56:56 +00:00
|
|
|
}
|
|
|
|
echo "\t?>\n";
|
|
|
|
?>
|
|
|
|
</fieldset>
|
|
|
|
<?php
|
|
|
|
echo "<?php echo \$form->end('Submit');?>\n";
|
|
|
|
?>
|
|
|
|
</div>
|
|
|
|
<div class="actions">
|
|
|
|
<ul>
|
2007-06-20 06:15:35 +00:00
|
|
|
<?php if ($action != 'add'):?>
|
2007-06-16 02:19:31 +00:00
|
|
|
<li><?php echo "<?php echo \$html->link(__('Delete', true), array('action'=>'delete', \$form->value('{$modelClass}.{$primaryKey}')), null, __('Are you sure you want to delete', true).' #' . \$form->value('{$modelClass}.{$primaryKey}')); ?>";?></li>
|
2007-06-03 23:56:56 +00:00
|
|
|
<?php endif;?>
|
2007-06-16 02:19:31 +00:00
|
|
|
<li><?php echo "<?php echo \$html->link(__('List', true).' '.__('{$pluralHumanName}', true), array('action'=>'index'));?>";?></li>
|
2007-06-03 23:56:56 +00:00
|
|
|
<?php
|
2007-06-20 06:15:35 +00:00
|
|
|
foreach ($foreignKeys as $field => $value) {
|
2007-06-03 23:56:56 +00:00
|
|
|
$otherModelClass = $value['1'];
|
2007-06-20 06:15:35 +00:00
|
|
|
if ($otherModelClass != $modelClass) {
|
2007-06-03 23:56:56 +00:00
|
|
|
$otherModelKey = Inflector::underscore($otherModelClass);
|
|
|
|
$otherControllerName = Inflector::pluralize($otherModelClass);
|
|
|
|
$otherControllerPath = Inflector::underscore($otherControllerName);
|
|
|
|
$otherSingularName = Inflector::variable($otherModelClass);
|
|
|
|
$otherPluralHumanName = Inflector::humanize($otherControllerPath);
|
|
|
|
$otherSingularHumanName = Inflector::humanize($otherModelKey);
|
2007-06-16 02:19:31 +00:00
|
|
|
echo "\t\t<li><?php echo \$html->link(__('List', true).' '.__('{$otherPluralHumanName}', true), array('controller'=> '{$otherControllerPath}', 'action'=>'index')); ?> </li>\n";
|
|
|
|
echo "\t\t<li><?php echo \$html->link(__('New', true).' '.__('{$otherSingularHumanName}', true), array('controller'=> '{$otherControllerPath}', 'action'=>'add')); ?> </li>\n";
|
2007-06-03 23:56:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</ul>
|
|
|
|
</div>
|