-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathform.ctp
More file actions
127 lines (104 loc) · 3.32 KB
/
form.ctp
File metadata and controls
127 lines (104 loc) · 3.32 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<?php echo $this->NetCommonsHtml->script([
'/blogs/js/blogs.js',
'/blogs/js/blogs_entry_edit.js',
'/tags/js/tags.js',
]); ?>
<?php
$dataJson = json_encode(
$this->NetCommonsTime->toUserDatetimeArray($this->request->data, array('BlogEntry.publish_start'))
);
?>
<div class="blogEntries form" ng-controller="Blogs" ng-init="init(<?php echo h($dataJson) ?>)">
<article>
<h1><?php echo h($blog['Blog']['name']) ?></h1>
<div class="panel panel-default">
<?php echo $this->NetCommonsForm->create(
'BlogEntry',
array(
'inputDefaults' => array(
'div' => 'form-group',
'class' => 'form-control',
'error' => false,
),
'div' => 'form-control',
'novalidate' => true
)
);
$this->NetCommonsForm->unlockField('Tag');
?>
<?php echo $this->NetCommonsForm->hidden('key'); ?>
<?php echo $this->NetCommonsForm->hidden('Frame.id', array(
'value' => Current::read('Frame.id'),
)); ?>
<?php echo $this->NetCommonsForm->hidden('Block.id', array(
'value' => Current::read('Block.id'),
)); ?>
<div class="panel-body">
<fieldset>
<?php
echo $this->TitleIcon->inputWithTitleIcon(
'title',
'BlogEntry.title_icon',
array(
'label' => __d('blogs', 'Title'),
'required' => 'required',
)
);
?>
<?php echo $this->NetCommonsForm->wysiwyg('BlogEntry.body1', array(
'label' => __d('blogs', 'Body1'),
'required' => true,
'rows' => 12
));?>
<div>
<label><input type="checkbox" ng-model="writeBody2"/><?php echo __d('blogs', 'Write body2') ?>
</label>
</div>
<div class="form-group" ng-show="writeBody2">
<?php echo $this->NetCommonsForm->wysiwyg('BlogEntry.body2', array(
'label' => __d('blogs', 'Body2'),
'rows' => 12
));?>
</div>
<?php
echo $this->NetCommonsForm->input('publish_start',
array(
'type' => 'datetime',
'required' => 'required',
'label' => __d('blogs', 'Published datetime'),
'childDiv' => ['class' => 'form-inline'],
)
);
?>
<?php echo $this->Category->select('BlogEntry.category_id', array('empty' => true)); ?>
<?php echo $this->element(
'Tags.tag_form',
array(
'tagData' => isset($this->request->data['Tag']) ? $this->request->data['Tag'] : array(),
'modelName' => 'BlogEntry',
)
); ?>
</fieldset>
<hr/>
<?php echo $this->Workflow->inputComment('BlogEntry.status'); ?>
</div>
<?php echo $this->Workflow->buttons('BlogEntry.status'); ?>
<?php echo $this->NetCommonsForm->end() ?>
<?php if ($isEdit && $isDeletable) : ?>
<div class="panel-footer" style="text-align: right;">
<?php echo $this->NetCommonsForm->create('BlogEntry',
array(
'type' => 'delete',
'url' => NetCommonsUrl::blockUrl(
array('controller' => 'blog_entries_edit', 'action' => 'delete', 'frame_id' => Current::read('Frame.id')))
)
) ?>
<?php echo $this->NetCommonsForm->input('key', array('type' => 'hidden')); ?>
<?php echo $this->Button->delete('', __d('net_commons', 'Deleting the %s. Are you sure to proceed?', __d('blogs', 'BlogEntry')));?>
<?php echo $this->NetCommonsForm->end() ?>
</div>
<?php endif ?>
</div>
<?php echo $this->Workflow->comments(); ?>
</article>
</div>