forked from featherbb/featherbb
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathedit.php
More file actions
119 lines (111 loc) · 5.6 KB
/
Copy pathedit.php
File metadata and controls
119 lines (111 loc) · 5.6 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
<?php
/**
* Copyright (C) 2015-2016 FeatherBB
* based on code by (C) 2008-2015 FluxBB
* and Rickard Andersson (C) 2002-2008 PunBB
* License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
*/
use FeatherBB\Core\Url;
use FeatherBB\Core\Utils;
// Make sure no one attempts to run this script "directly"
if (!isset($feather)) {
exit;
}
$cur_index = 1;
Container::get('hooks')->fire('view.edit.start');
?>
<div class="linkst">
<div class="inbox">
<ul class="crumbs">
<li><a href="<?= Url::base() ?>"><?php _e('Index') ?></a></li>
<li><span>» </span><a href="<?= Router::pathFor('Forum', ['id' => $cur_post['fid'], 'name' => Url::url_friendly($cur_post['forum_name'])]) ?>"><?= Utils::escape($cur_post['forum_name']) ?></a></li>
<li><span>» </span><a href="<?= Router::pathFor('Topic', ['id' => $cur_post['tid'], 'name' => Url::url_friendly($cur_post['subject'])]) ?>"><?= Utils::escape($cur_post['subject']) ?></a></li>
<li><span>» </span><strong><?php _e('Edit post') ?></strong></li>
</ul>
</div>
</div>
<?php
// If there are errors, we display them
if (!empty($errors)) :
?>
<div id="posterror" class="block">
<h2><span><?php _e('Post errors') ?></span></h2>
<div class="box">
<div class="inbox error-info">
<p><?php _e('Post errors info') ?></p>
<ul class="error-list">
<?php
foreach ($errors as $cur_error) {
echo "\t\t\t\t".'<li><strong>'.$cur_error.'</strong></li>'."\n";
}
?>
</ul>
</div>
</div>
</div>
<?php
elseif (Input::post('preview')):
?>
<div id="postpreview" class="blockpost">
<h2><span><?php _e('Post preview') ?></span></h2>
<div class="box">
<div class="inbox">
<div class="postbody">
<div class="postright">
<div class="postmsg">
<?= $preview_message."\n" ?>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
endif;
?>
<div id="editform" class="blockform">
<h2><span><?php _e('Edit post') ?></span></h2>
<div class="box">
<form id="edit" method="post" action="<?= Router::pathFor('editPost', ['id' => $id]) ?>" onsubmit="return process_form(this)">
<input type="hidden" name="csrf_name" value="<?= $csrf_name; ?>"><input type="hidden" name="csrf_value" value="<?= $csrf_value; ?>">
<div class="inform">
<fieldset>
<legend><?php _e('Edit post legend') ?></legend>
<input type="hidden" name="form_sent" value="1" />
<div class="infldset txtarea">
<?php if ($can_edit_subject): ?> <label class="required"><strong><?php _e('Subject') ?> <span><?php _e('Required') ?></span></strong><br />
<input class="longinput" type="text" name="req_subject" size="80" maxlength="70" tabindex="<?= $cur_index++ ?>" value="<?= Utils::escape(Input::post('req_subject') ? Input::post('req_subject') : $cur_post['subject']) ?>" /><br /></label>
<?php endif; ?> <label class="required"><strong><?php _e('Message') ?> <span><?php _e('Required') ?></span></strong><br />
<script>postEditorToolbar('req_message');</script>
<textarea name="req_message" id="req_message" rows="20" cols="95" tabindex="<?= $cur_index++ ?>"><?= Utils::escape(Input::post('req_message') ? $post['message'] : $cur_post['message']) ?></textarea><br /></label>
<ul class="bblinks">
<li><span><a href="<?= Router::pathFor('help').'#bbcode' ?>" onclick="window.open(this.href); return false;"><?php _e('BBCode') ?></a> <?php echo(ForumSettings::get('p_message_bbcode') == '1') ? __('on') : __('off'); ?></span></li>
<li><span><a href="<?= Router::pathFor('help').'#url' ?>" onclick="window.open(this.href); return false;"><?php _e('url tag') ?></a> <?php echo(ForumSettings::get('p_message_bbcode') == '1' && User::get()->g_post_links == '1') ? __('on') : __('off'); ?></span></li>
<li><span><a href="<?= Router::pathFor('help').'#img' ?>" onclick="window.open(this.href); return false;"><?php _e('img tag') ?></a> <?php echo(ForumSettings::get('p_message_bbcode') == '1' && ForumSettings::get('p_message_img_tag') == '1') ? __('on') : __('off'); ?></span></li>
<li><span><a href="<?= Router::pathFor('help').'#smilies' ?>" onclick="window.open(this.href); return false;"><?php _e('Smilies') ?></a> <?php echo(ForumSettings::get('o_smilies') == '1') ? __('on') : __('off'); ?></span></li>
</ul>
</div>
</fieldset>
</div>
<?php
if (!empty($checkboxes)):
?>
<div class="inform">
<fieldset>
<legend><?php _e('Options') ?></legend>
<div class="infldset">
<div class="rbox">
<?= implode("\n\t\t\t\t\t\t\t", $checkboxes)."\n" ?>
</div>
</div>
</fieldset>
</div>
<?php
endif;
?>
<p class="buttons"><input type="submit" name="submit" value="<?php _e('Submit') ?>" tabindex="<?= $cur_index++ ?>" accesskey="s" /> <input type="submit" name="preview" value="<?php _e('Preview') ?>" tabindex="<?= $cur_index++ ?>" accesskey="p" /> <a href="javascript:history.go(-1)"><?php _e('Go back') ?></a></p>
</form>
</div>
</div>
<?php
Container::get('hooks')->fire('view.edit.end');