Commit 9b1e7d63 by Scott

Hide reply buttons for self and deleted users

parent 80e7ee23
...@@ -97,20 +97,24 @@ if ($showOutbox) ...@@ -97,20 +97,24 @@ if ($showOutbox)
foreach ($userMessages as $message) { foreach ($userMessages as $message) {
$msgFormat = qa_message_html_fields($message, $htmlDefaults); $msgFormat = qa_message_html_fields($message, $htmlDefaults);
$replyHandle = $showOutbox ? $message['tohandle'] : $message['fromhandle']; $replyHandle = $showOutbox ? $message['tohandle'] : $message['fromhandle'];
$replyId = $showOutbox ? $message['touserid'] : $message['fromuserid'];
$msgFormat['form'] = array( $msgFormat['form'] = array(
'style' => 'light', 'style' => 'light',
'buttons' => array( 'buttons' => array(),
'reply' => array( );
'tags' => 'onclick="window.location.href=\'' . qa_path_html('message/' . $replyHandle) . '\';return false"',
'label' => qa_lang_html('question/reply_button'), if (!empty($replyHandle) && $replyId != $loginUserId) {
), $msgFormat['form']['buttons']['reply'] = array(
'delete' => array( 'tags' => 'onclick="window.location.href=\'' . qa_path_html('message/' . $replyHandle) . '\';return false"',
'tags' => 'name="m' . qa_html($message['messageid']) . '_dodelete" onclick="return qa_pm_click(' . qa_js($message['messageid']) . ', this, ' . qa_js($showOutbox ? 'outbox' : 'inbox') . ');"', 'label' => qa_lang_html('question/reply_button'),
'label' => qa_lang_html('question/delete_button'), );
'popup' => qa_lang_html('profile/delete_pm_popup'), }
),
), $msgFormat['form']['buttons']['delete'] = array(
'tags' => 'name="m' . qa_html($message['messageid']) . '_dodelete" onclick="return qa_pm_click(' . qa_js($message['messageid']) . ', this, ' . qa_js($showOutbox ? 'outbox' : 'inbox') . ');"',
'label' => qa_lang_html('question/delete_button'),
'popup' => qa_lang_html('profile/delete_pm_popup'),
); );
$qa_content['message_list']['messages'][] = $msgFormat; $qa_content['message_list']['messages'][] = $msgFormat;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment