-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathedit_form.ctp
More file actions
48 lines (45 loc) · 1.46 KB
/
edit_form.ctp
File metadata and controls
48 lines (45 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
/**
* ブロック設定のElement
* - $model: モデル名
* - $action: アクションURL
* - $callback: コールバックelement
* - $callbackOptions: コールバックオプション
* - $cancelUrl: キャンセルURL
* - $options: Form->create()のオプション
* - `displayModified` 更新情報を表示するかどうか
*
* @author Noriko Arai <arai@nii.ac.jp>
* @author Shohei Nakajima <nakajimashouhei@gmail.com>
* @link http://www.netcommons.org NetCommons Project
* @license http://www.netcommons.org/license.txt NetCommons License
* @copyright Copyright 2014, NetCommons Project
*/
if (! isset($options)) {
$options = array();
}
if (isset($action)) {
$options['url'] = $action;
}
if (! isset($cancelUrl)) {
$cancelUrl = null;
}
if (! isset($callbackOptions)) {
$callbackOptions = array();
}
if (! isset($displayModified)) {
$displayModified = false;
}
?>
<?php echo $this->NetCommonsForm->create($model, Hash::merge(array(), $options)); ?>
<div class="panel panel-default">
<div class="panel-body">
<?php echo $this->element('Blocks.form_hidden'); ?>
<?php echo $this->element($callback, $callbackOptions); ?>
<?php echo $this->element('Blocks.modifed_info', array('displayModified' => $displayModified)); ?>
</div>
<div class="panel-footer text-center">
<?php echo $this->Button->cancelAndSave(__d('net_commons', 'Cancel'), __d('net_commons', 'OK'), $cancelUrl); ?>
</div>
</div>
<?php echo $this->NetCommonsForm->end();