comparison cake/console/templates/default/views/form.ctp @ 0:261e66bd5a0c

hg init
author Shoshi TAMAKI <shoshi@cr.ie.u-ryukyu.ac.jp>
date Sun, 24 Jul 2011 21:08:31 +0900
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:261e66bd5a0c
1 <?php
2 /**
3 *
4 * PHP versions 4 and 5
5 *
6 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
7 * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
8 *
9 * Licensed under The MIT License
10 * Redistributions of files must retain the above copyright notice.
11 *
12 * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
13 * @link http://cakephp.org CakePHP(tm) Project
14 * @package cake
15 * @subpackage cake.cake.console.libs.templates.views
16 * @since CakePHP(tm) v 1.2.0.5234
17 * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
18 */
19 ?>
20 <div class="<?php echo $pluralVar;?> form">
21 <?php echo "<?php echo \$this->Form->create('{$modelClass}');?>\n";?>
22 <fieldset>
23 <legend><?php printf("<?php __('%s %s'); ?>", Inflector::humanize($action), $singularHumanName); ?></legend>
24 <?php
25 echo "\t<?php\n";
26 foreach ($fields as $field) {
27 if (strpos($action, 'add') !== false && $field == $primaryKey) {
28 continue;
29 } elseif (!in_array($field, array('created', 'modified', 'updated'))) {
30 echo "\t\techo \$this->Form->input('{$field}');\n";
31 }
32 }
33 if (!empty($associations['hasAndBelongsToMany'])) {
34 foreach ($associations['hasAndBelongsToMany'] as $assocName => $assocData) {
35 echo "\t\techo \$this->Form->input('{$assocName}');\n";
36 }
37 }
38 echo "\t?>\n";
39 ?>
40 </fieldset>
41 <?php
42 echo "<?php echo \$this->Form->end(__('Submit', true));?>\n";
43 ?>
44 </div>
45 <div class="actions">
46 <h3><?php echo "<?php __('Actions'); ?>"; ?></h3>
47 <ul>
48
49 <?php if (strpos($action, 'add') === false): ?>
50 <li><?php echo "<?php echo \$this->Html->link(__('Delete', true), array('action' => 'delete', \$this->Form->value('{$modelClass}.{$primaryKey}')), null, sprintf(__('Are you sure you want to delete # %s?', true), \$this->Form->value('{$modelClass}.{$primaryKey}'))); ?>";?></li>
51 <?php endif;?>
52 <li><?php echo "<?php echo \$this->Html->link(__('List " . $pluralHumanName . "', true), array('action' => 'index'));?>";?></li>
53 <?php
54 $done = array();
55 foreach ($associations as $type => $data) {
56 foreach ($data as $alias => $details) {
57 if ($details['controller'] != $this->name && !in_array($details['controller'], $done)) {
58 echo "\t\t<li><?php echo \$this->Html->link(__('List " . Inflector::humanize($details['controller']) . "', true), array('controller' => '{$details['controller']}', 'action' => 'index')); ?> </li>\n";
59 echo "\t\t<li><?php echo \$this->Html->link(__('New " . Inflector::humanize(Inflector::underscore($alias)) . "', true), array('controller' => '{$details['controller']}', 'action' => 'add')); ?> </li>\n";
60 $done[] = $details['controller'];
61 }
62 }
63 }
64 ?>
65 </ul>
66 </div>