mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 20:00:37 +02:00
Merge pull request #3387 from SimSync/fix_3377
fixes #3377 Enabled "preview" button on forum post edit
This commit is contained in:
@@ -155,6 +155,7 @@ class forum_post_handler
|
||||
$forumInfo = $this->forumObj->forumGet($postInfo['post_forum']);
|
||||
$data = array_merge($postInfo ,$forumInfo);
|
||||
$data['action'] = $this->action;
|
||||
$data['initial_post'] = $this->forumObj->threadDetermineInitialPost($this->post);
|
||||
$this->setPageTitle($data);
|
||||
return $data;
|
||||
break;
|
||||
@@ -1026,6 +1027,11 @@ class forum_post_handler
|
||||
$tsubject = $tp->post_toHTML($_POST['subject'], true);
|
||||
$tpost = $tp->post_toHTML($_POST['post'], true);
|
||||
|
||||
if (empty($tsubject))
|
||||
{
|
||||
$tsubject = $this->data['thread_name'];
|
||||
}
|
||||
|
||||
if ($_POST['poll_title'] != '' && check_class($this->forumObj->prefs->get('poll')))
|
||||
{
|
||||
require_once(e_PLUGIN."poll/poll_class.php");
|
||||
|
@@ -122,7 +122,7 @@ class plugin_forum_post_shortcodes extends e_shortcode
|
||||
elseif($this->var['action'] == 'edit')
|
||||
{
|
||||
$_POST['subject'] = $this->var['thread_name'];
|
||||
if($this->var['thread_user'] != USERID && !deftrue('MODERATOR'))
|
||||
if($this->var['thread_user'] != USERID && !deftrue('MODERATOR') || !$this->var['initial_post'])
|
||||
{
|
||||
$opts['disabled'] = 1;
|
||||
}
|
||||
@@ -196,11 +196,11 @@ class plugin_forum_post_shortcodes extends e_shortcode
|
||||
// This user created the thread and is editing the original post.
|
||||
if($this->var['thread_datestamp'] == $this->var['post_datestamp'] && $this->var['thread_user'] == $this->var['post_user'])
|
||||
{
|
||||
return "<input class='btn btn-primary button' type='submit' name='update_thread' value='".LAN_FORUM_3023."' />";
|
||||
return $ret . "<input class='btn btn-primary button' type='submit' name='update_thread' value='".LAN_FORUM_3023."' />";
|
||||
}
|
||||
else // editing a reply.
|
||||
{
|
||||
return "<input class='btn btn-primary button' type='submit' name='update_reply' value='".LAN_FORUM_3024."' />";
|
||||
return $ret . "<input class='btn btn-primary button' type='submit' name='update_reply' value='".LAN_FORUM_3024."' />";
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -27,8 +27,9 @@ $FORUM_PREVIEW = "<div>
|
||||
|
||||
//v2.x Bootstrap
|
||||
$FORUM_PREVIEW_TEMPLATE['item'] = "<div class='alert alert-warning alert-block'>
|
||||
<div><b>{PREVIEW_SUBJECT}</b></div>
|
||||
{PREVIEW_POST}
|
||||
<div><h4>{PREVIEW_SUBJECT}</h4></div>
|
||||
<br>
|
||||
{PREVIEW_POST}
|
||||
</div>";
|
||||
|
||||
?>
|
Reference in New Issue
Block a user