Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

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