source: Dev/branches/cakephp/cake/libs/view/scaffolds/edit.ctp @ 126

Last change on this file since 126 was 126, checked in by fpvanagthoven, 14 years ago

Cakephp branch.

File size: 2.0 KB
Line 
1<?php
2/**
3 *
4 * PHP versions 4 and 5
5 *
6 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
7 * Copyright 2005-2011, 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-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
13 * @link          http://cakephp.org CakePHP(tm) Project
14 * @package       cake
15 * @subpackage    cake.cake.libs.view.templates.scaffolds
16 * @since         CakePHP(tm) v 0.10.0.1076
17 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
18 */
19?>
20<div class="<?php echo $pluralVar;?> form">
21<?php
22        echo $this->Form->create();
23        echo $this->Form->inputs($scaffoldFields, array('created', 'modified', 'updated'));
24        echo $this->Form->end(__('Submit', true));
25?>
26</div>
27<div class="actions">
28        <h3><?php __('Actions'); ?></h3>
29        <ul>
30<?php if ($this->action != 'add'):?>
31                <li><?php echo $this->Html->link(__('Delete', true), array('action' => 'delete', $this->Form->value($modelClass.'.'.$primaryKey)), null, __('Are you sure you want to delete', true).' #' . $this->Form->value($modelClass.'.'.$primaryKey)); ?></li>
32<?php endif;?>
33                <li><?php echo $this->Html->link(__('List', true).' '.$pluralHumanName, array('action' => 'index'));?></li>
34<?php
35                $done = array();
36                foreach ($associations as $_type => $_data) {
37                        foreach ($_data as $_alias => $_details) {
38                                if ($_details['controller'] != $this->name && !in_array($_details['controller'], $done)) {
39                                        echo "\t\t<li>" . $this->Html->link(sprintf(__('List %s', true), Inflector::humanize($_details['controller'])), array('controller' => $_details['controller'], 'action' =>'index')) . "</li>\n";
40                                        echo "\t\t<li>" . $this->Html->link(sprintf(__('New %s', true), Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' =>'add')) . "</li>\n";
41                                        $done[] = $_details['controller'];
42                                }
43                        }
44                }
45?>
46        </ul>
47</div>
Note: See TracBrowser for help on using the repository browser.