Commit 9b1e7d63 by Scott

Hide reply buttons for self and deleted users

parent 80e7ee23
......@@ -97,20 +97,24 @@ if ($showOutbox)
foreach ($userMessages as $message) {
$msgFormat = qa_message_html_fields($message, $htmlDefaults);
$replyHandle = $showOutbox ? $message['tohandle'] : $message['fromhandle'];
$replyId = $showOutbox ? $message['touserid'] : $message['fromuserid'];
$msgFormat['form'] = array(
'style' => 'light',
'buttons' => array(
'reply' => array(
'buttons' => array(),
);
if (!empty($replyHandle) && $replyId != $loginUserId) {
$msgFormat['form']['buttons']['reply'] = array(
'tags' => 'onclick="window.location.href=\'' . qa_path_html('message/' . $replyHandle) . '\';return false"',
'label' => qa_lang_html('question/reply_button'),
),
'delete' => array(
);
}
$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;
......
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