/
add.ctp
119 lines (111 loc) · 2.46 KB
/
add.ctp
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
<?php $this->pageTitle = __('Add new article', true); ?>
<h2><?php __('Add new article'); ?></h2>
<?php
echo $form->create
(
null,
array
(
'url' => array('controller' => 'articles', 'action' => 'add'),
'id' => 'ArticleAddForm'
)
);
?>
<?php echo $html->div('article-inputbox'); ?>
<div class="article-add-actions">
<?php
echo $html->link
(
__('Markdown Syntax', true),
array
(
'controller' => 'neutrino',
'action' => 'markdown'
),
array
(
'rel' => 'shadowbox;height=600;width=800',
'title' => __('NeutrinoCMS help system', true)
)
);
?>
</div>
<hr />
<?php
echo $form->input
(
'Article.article_category_id',
array
(
'label' => __('Category', true),
'options' => $categories
)
);
echo $form->input('Article.title', array('label' => 'Title'));
echo $form->input('Article.intro', array('type' => 'textarea', 'label' => 'Introduction'));
echo $form->input('Article.content', array('onkeydown' => 'insertTab(event, this);', 'label' => 'Content'));
echo $form->input
(
'Article.content_description',
array
(
'label' => __('Meta content description', true),
'type' => 'textarea',
'rows' => 3
)
);
echo $form->input
(
'Article.content_keywords',
array
(
'label' => __('Meta content keywords (comma separated)', true),
'type' => 'textarea',
'rows' => 3
)
);
echo $form->input
(
'Article.isdraft',
array
(
'style' => 'display:inline; margin-top:15px;',
'label' => array
(
'style' => 'display:inline; margin-bottom:15px; margin-left:5px;',
'text' => __('Draft', true)
)
)
);
$buttonAttr = array('name' => 'data[Submit][type]', 'class' => 'button');
if (isset($disable) && $disable == true)
{
$buttonAttr = array_merge($buttonAttr, array('disabled' => 'disabled'));
}
echo $form->submit(__('Save and continue editing', true), $buttonAttr);
echo $form->submit(__('Save', true), $buttonAttr);
?>
</div>
<?php
echo $form->end();
echo $javascript->codeBlock('Form.focusFirstElement("ArticleAddForm");');
echo $javascript->codeBlock
(
sprintf
(
'document.observe
(
"dom:loaded",
function()
{
var options = {
loadingImage: "%sshadowbox/loading.gif",
keysClose: ["c", 27]
};
Shadowbox.init(options);
}
);',
$this->webroot.IMAGES_URL
)
);
?>