Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
13532 anikendra 1
<?php
2
/**
3
 *
4
 *
5
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
6
 * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
7
 *
8
 * Licensed under The MIT License
9
 * For full copyright and license information, please see the LICENSE.txt
10
 * Redistributions of files must retain the above copyright notice.
11
 *
12
 * @copyright     Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
13
 * @link          http://cakephp.org CakePHP(tm) Project
14
 * @package       Cake.Console.Templates.default.views
15
 * @since         CakePHP(tm) v 1.2.0.5234
16
 * @license       http://www.opensource.org/licenses/mit-license.php MIT License
17
 */
18
?>
19
<div class="<?php echo $pluralVar; ?> form">
20
<?php echo "<?php echo \$this->Form->create('{$modelClass}'); ?>\n"; ?>
21
	<fieldset>
22
		<legend><?php printf("<?php echo __('%s %s'); ?>", Inflector::humanize($action), $singularHumanName); ?></legend>
23
<?php
24
		echo "\t<?php\n";
25
		foreach ($fields as $field) {
26
			if (strpos($action, 'add') !== false && $field == $primaryKey) {
27
				continue;
28
			} elseif (!in_array($field, array('created', 'modified', 'updated'))) {
29
				echo "\t\techo \$this->Form->input('{$field}');\n";
30
			}
31
		}
32
		if (!empty($associations['hasAndBelongsToMany'])) {
33
			foreach ($associations['hasAndBelongsToMany'] as $assocName => $assocData) {
34
				echo "\t\techo \$this->Form->input('{$assocName}');\n";
35
			}
36
		}
37
		echo "\t?>\n";
38
?>
39
	</fieldset>
40
<?php
41
	echo "<?php echo \$this->Form->end(__('Submit')); ?>\n";
42
?>
43
</div>
44
<div class="actions">
45
	<h3><?php echo "<?php echo __('Actions'); ?>"; ?></h3>
46
	<ul>
47
 
48
<?php if (strpos($action, 'add') === false): ?>
49
		<li><?php echo "<?php echo \$this->Form->postLink(__('Delete'), array('action' => 'delete', \$this->Form->value('{$modelClass}.{$primaryKey}')), null, __('Are you sure you want to delete # %s?', \$this->Form->value('{$modelClass}.{$primaryKey}'))); ?>"; ?></li>
50
<?php endif; ?>
51
		<li><?php echo "<?php echo \$this->Html->link(__('List " . $pluralHumanName . "'), array('action' => 'index')); ?>"; ?></li>
52
<?php
53
		$done = array();
54
		foreach ($associations as $type => $data) {
55
			foreach ($data as $alias => $details) {
56
				if ($details['controller'] != $this->name && !in_array($details['controller'], $done)) {
57
					echo "\t\t<li><?php echo \$this->Html->link(__('List " . Inflector::humanize($details['controller']) . "'), array('controller' => '{$details['controller']}', 'action' => 'index')); ?> </li>\n";
58
					echo "\t\t<li><?php echo \$this->Html->link(__('New " . Inflector::humanize(Inflector::underscore($alias)) . "'), array('controller' => '{$details['controller']}', 'action' => 'add')); ?> </li>\n";
59
					$done[] = $details['controller'];
60
				}
61
			}
62
		}
63
?>
64
	</ul>
65
</div>