forked from cynial/STBlog
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwrite_post.php
More file actions
174 lines (165 loc) · 10.7 KB
/
Copy pathwrite_post.php
File metadata and controls
174 lines (165 loc) · 10.7 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
$this->load->view('admin/header');
$this->load->view('admin/menu');
?>
<div class="main">
<div class="body body-950">
<?php $this->load->view('admin/notify'); ?>
<div class="container typecho-page-title">
<div class="column-24 start-01">
<h2><?php echo $page_title;?></h2>
<p><?php echo anchor(site_url(),'查看我的站点');?></p>
</div>
</div>
<div class="container typecho-page-main typecho-post-option typecho-post-area">
<form action="" method="post" name="write_post">
<div class="column-18 suffix" id="test">
<div class="column-18">
<label for="title" class="typecho-label">标题</label>
<?php echo form_error('title', '<p class="message error">', '</p>'); ?>
<p class="title"><input type="text" id="title" name="title" value="<?php echo set_value('title',(isset($title))? htmlspecialchars_decode($title):''); ?>" class="text title" /></p>
<label for="text" class="typecho-label">内容
<!-- 使用wysiwyg编辑器时必需实现此方法 -->
<?php $this->plugin->trigger(ST_CORE_HOOK_EDITOR_INSERT_MORE);?>
</label>
<?php echo form_error('text', '<p class="message error">', '</p>'); ?>
<p><textarea style="height: 350px" id="text" name="text"><?php echo set_value('text',(isset($text))?$text:''); ?></textarea></p>
<label for="tags" class="typecho-label">标签</label>
<p><input id="tags" name="tags" type="text" value="<?php echo set_value('tags',(isset($tags))?htmlspecialchars_decode($tags):''); ?>" class="text" /></p>
<p class="submit">
<span class="left">
<span class="advance close">展开高级选项</span>
<span class="attach">展开附件</span>
</span>
<span class="right">
<input type="hidden" name="draft" value="0" />
<button type="button" id="btn-save">保存并继续编辑</button>
<button type="submit" id="btn-submit">更新这篇文章 »</button>
</span>
</p>
</div>
<ul id="advance-panel" class="typecho-post-option column-18">
<li class="column-18">
<div class="column-12">
<label for="trackback" class="typecho-label">引用通告</label>
<textarea id="trackback" name="trackback"></textarea>
<p class="description">每一行一个引用地址, 用回车隔开</p>
</div>
<div class="column-06">
<label class="typecho-label">权限控制</label>
<ul>
<li><input id="allowComment" name="allowComment" type="checkbox" value="1" <?php echo set_checkbox('allowComment', '1', (1 == $allow_comment)?TRUE:FALSE); ?> />
<label for="allowComment">允许评论</label></li>
<li><input id="allowPing" name="allowPing" type="checkbox" value="1" <?php echo set_checkbox('allowPing', '1',(1 == $allow_ping)?TRUE:FALSE); ?> />
<label for="allowPing">允许被引用</label></li>
<li><input id="allowFeed" name="allowFeed" type="checkbox" value="1" <?php echo set_checkbox('allowFeed', '1',(1 == $allow_feed)?TRUE:FALSE); ?> />
<label for="allowFeed">允许在聚合中出现</label></li>
</ul>
</div>
</li>
</ul>
<ul id="upload-panel" class="column-18">
<li class="column-18">
<?php $this->load->view('admin/file_upload'); ?>
</li>
</ul>
</div>
<div class="column-06">
<ul class="typecho-post-option">
<li>
<label for="date" class="typecho-label">日期</label>
<p>
<select name="month" id="month">
<option value="1" <?php if (1 == $this->form_validation->month): ?>selected="true"<?php endif; ?>>一月</option>
<option value="2" <?php if (2 == $this->form_validation->month): ?>selected="true"<?php endif; ?>>二月</option>
<option value="3" <?php if (3 == $this->form_validation->month): ?>selected="true"<?php endif; ?>>三月</option>
<option value="4" <?php if (4 == $this->form_validation->month): ?>selected="true"<?php endif; ?>>四月</option>
<option value="5" <?php if (5 == $this->form_validation->month): ?>selected="true"<?php endif; ?>>五月</option>
<option value="6" <?php if (6 == $this->form_validation->month): ?>selected="true"<?php endif; ?>>六月</option>
<option value="7" <?php if (7 == $this->form_validation->month): ?>selected="true"<?php endif; ?>>七月</option>
<option value="8" <?php if (8 == $this->form_validation->month): ?>selected="true"<?php endif; ?>>八月</option>
<option value="9" <?php if (9 == $this->form_validation->month): ?>selected="true"<?php endif; ?>>九月</option>
<option value="10" <?php if (10 == $this->form_validation->month): ?>selected="true"<?php endif; ?>>十月</option>
<option value="11" <?php if (11 == $this->form_validation->month): ?>selected="true"<?php endif; ?>>十一月</option>
<option value="12" <?php if (12 == $this->form_validation->month): ?>selected="true"<?php endif; ?>>十二月</option>
</select>
<input size="4" maxlength="4" type="text" name="day" id="day" value="<?php echo $this->form_validation->day;?>" />
,
<input size="4" maxlength="4" type="text" name="year" id="year" value="<?php echo $this->form_validation->year;?>" />
@
<input size="2" maxlength="2" type="text" name="hour" id="hour" value="<?php echo $this->form_validation->hour;?>" />
:
<input size="2" maxlength="2" type="text" name="min" id="min" value="<?php echo $this->form_validation->minute;?>" />
</p>
<p class="description">请选择一个发布日期</p>
</li>
<li>
<label class="typecho-label">分类</label>
<?php echo form_error('category[]', '<p class="message error">', '</p>'); ?>
<ul>
<?php if($all_categories->num_rows() > 0):?>
<?php foreach($all_categories -> result() as $category):?>
<li>
<input type="checkbox" id="category-<?php echo $category->mid;?>" value="<?php echo $category->mid;?>" name="category[]" <?php echo set_checkbox('category[]', $category->mid,(isset($post_category) && in_array($category->mid, $post_category))?TRUE:FALSE); ?>/>
<label for="category-<?php echo $category->mid;?>"><?php echo $category->name;?></label>
</li>
<?php endforeach;?>
<?php else:?>
你尚未添加任何分类
<?php endif;?>
</ul>
</li>
<li>
<label for="slug" class="typecho-label">缩略名</label>
<?php echo form_error('slug', '<p class="message error">', '</p>'); ?>
<p><input type="text" id="slug" name="slug" value="<?php echo set_value('slug',(isset($slug))?htmlspecialchars_decode($slug):''); ?>" class="mini" /></p>
<p class="description">为这篇日志自定义链接地址, 有利于搜索引擎收录</p>
</li>
</ul>
</div>
</form>
</div>
</div>
</div>
<?php
$this->load->view('admin/copyright');
$this->load->view('admin/common-js');
?>
<script type="text/javascript">
(function () {
window.addEvent('domready', function() {
/** 绑定按钮 */
$(document).getElement('span.advance').addEvent('click', function () {
Typecho.toggle('#advance-panel', this,
'收起高级选项', '展开高级选项');
});
$(document).getElement('span.attach').addEvent('click', function () {
Typecho.toggle('#upload-panel', this,
'收起附件', '展开附件');
});
$('btn-save').removeProperty('disabled');
$('btn-submit').removeProperty('disabled');
$('btn-save').addEvent('click', function (e) {
this.getParent('span').addClass('loading');
this.setProperty('disabled', true);
$(document).getElement('input[name=draft]').set('value', 1);
$(document).getElement('form[name=write_post]').submit();
});
$('btn-submit').addEvent('click', function (e) {
this.getParent('span').addClass('loading');
this.setProperty('disabled', true);
$(document).getElement('input[name=draft]').set('value', 0);
});
/** 标签自动完成 */
var _tags = [<?php if(!empty($all_tags)){$auto_tags = array();foreach($all_tags->result() as $tag){$auto_tags[] = '\''.$tag->name.'\'';}echo implode(',',$auto_tags);}?>];
/** 自动完成 */
Typecho.autoComplete('#tags', _tags);
});
})();
</script>
<?php
/** 挂载一个编辑器插件 */
$this->plugin->trigger(ST_CORE_HOOK_EDITOR);
$this->load->view('admin/file_upload_js');
$this->load->view('admin/footer');
?>