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-10-28 04:18:18 +00:00
|
|
|
<legend><?php echo "<?php echo __('".Inflector::humanize($action)." {$singularHumanName}', true);?>";?></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) {
|
2007-10-28 04:18:18 +00:00
|
|
|
if ($action == 'add' && $field == $primaryKey) {
|
2007-06-03 23:56:56 +00:00
|
|
|
continue;
|
2007-10-28 04:18:18 +00:00
|
|
|
} elseif (!in_array($field, array('created', 'modified', 'updated'))) {
|
|
|
|
echo "\t\techo \$form->input('{$field}');\n";
|
2007-06-03 23:56:56 +00:00
|
|
|
}
|
|
|
|
}
|
2007-06-20 06:15:35 +00:00
|
|
|
foreach ($hasAndBelongsToMany as $assocName => $assocData) {
|
2007-10-28 04:18:18 +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-10-06 06:46:45 +00:00
|
|
|
<li><?php echo "<?php echo \$html->link(__('Delete', true), array('action'=>'delete', \$form->value('{$modelClass}.{$primaryKey}')), null, sprintf(__('Are you sure you want to delete # %s?', true), \$form->value('{$modelClass}.{$primaryKey}'))); ?>";?></li>
|
2007-06-03 23:56:56 +00:00
|
|
|
<?php endif;?>
|
2007-10-28 04:18:18 +00:00
|
|
|
<li><?php echo "<?php echo \$html->link(__('List {$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-10-28 04:18:18 +00:00
|
|
|
echo "\t\t<li><?php echo \$html->link(__('List {$otherPluralHumanName}', true), array('controller'=> '{$otherControllerPath}', 'action'=>'index')); ?> </li>\n";
|
|
|
|
echo "\t\t<li><?php echo \$html->link(sprintf(__('New {$otherSingularHumanName}', true), array('controller'=> '{$otherControllerPath}', 'action'=>'add')); ?> </li>\n";
|
2007-06-03 23:56:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</ul>
|
2007-10-06 06:46:45 +00:00
|
|
|
</div>
|