2005-07-21 04:02:32 +00:00
|
|
|
<?php
|
2005-08-21 06:49:02 +00:00
|
|
|
uses('helpers/form');
|
2005-07-21 04:02:32 +00:00
|
|
|
|
2005-08-21 06:49:02 +00:00
|
|
|
$form = new FormHelper();
|
2005-07-21 04:02:32 +00:00
|
|
|
|
2005-09-17 02:22:07 +00:00
|
|
|
echo $html->formTag('/'.Inflector::underscore($this->name).'/update');
|
2005-07-21 04:02:32 +00:00
|
|
|
|
2005-08-21 06:49:02 +00:00
|
|
|
echo $form->generateFields( $html, $fieldNames );
|
2005-08-21 20:01:32 +00:00
|
|
|
|
2005-08-21 06:49:02 +00:00
|
|
|
echo $form->generateSubmitDiv( $html, 'Save' )
|
|
|
|
|
|
|
|
?>
|
|
|
|
<ul class='actions'>
|
2005-07-21 04:02:32 +00:00
|
|
|
<?php
|
2005-08-21 06:49:02 +00:00
|
|
|
$modelName = Inflector::singularize($this->name);
|
2005-09-17 02:22:07 +00:00
|
|
|
$modelKey = Inflector::underscore($modelName);
|
|
|
|
echo "<li>".$html->linkTo('Delete '.Inflector::humanize($modelName), '/'.$this->viewPath.'/destroy/'.$data[$modelKey]['id'])."</li>";
|
2005-07-21 04:02:32 +00:00
|
|
|
|
2005-09-17 02:22:07 +00:00
|
|
|
foreach( $fieldNames as $field => $value ) {
|
2005-08-21 06:49:02 +00:00
|
|
|
if( isset( $value['foreignKey'] ) )
|
|
|
|
{
|
|
|
|
echo "<li>".$html->linkTo( "View ".Inflector::humanize($value['controller']), "/".Inflector::underscore($value['controller'])."/show/".$data[Inflector::singularize($params['controller'])][$field] )."</li>";
|
|
|
|
}
|
|
|
|
}
|
2005-07-21 04:02:32 +00:00
|
|
|
?>
|
2005-08-21 06:49:02 +00:00
|
|
|
</ul>
|