Commit 49bc31dd by Scott

Use full language keys in messages code

parent 75d73888
...@@ -42,9 +42,9 @@ ...@@ -42,9 +42,9 @@
$req = qa_request_part(1); $req = qa_request_part(1);
if ($req === null) if ($req === null)
$showBox = 'inbox'; $showOutbox = false;
else if ($req === 'sent') else if ($req === 'sent')
$showBox = 'outbox'; $showOutbox = true;
else else
return include QA_INCLUDE_DIR.'qa-page-not-found.php'; return include QA_INCLUDE_DIR.'qa-page-not-found.php';
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
$pagesize = qa_opt('page_size_pms'); $pagesize = qa_opt('page_size_pms');
// get number of messages then actual messages for this page // get number of messages then actual messages for this page
$func = 'qa_db_messages_'.$showBox.'_selectspec'; $func = $showOutbox ? 'qa_db_messages_outbox_selectspec' : 'qa_db_messages_inbox_selectspec';
$pmSpecCount = qa_db_selectspec_count( $func('private', $loginUserId, true) ); $pmSpecCount = qa_db_selectspec_count( $func('private', $loginUserId, true) );
$pmSpec = $func('private', $loginUserId, true, $start, $pagesize); $pmSpec = $func('private', $loginUserId, true, $start, $pagesize);
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
// Prepare content for theme // Prepare content for theme
$qa_content = qa_content_prepare(); $qa_content = qa_content_prepare();
$qa_content['title'] = qa_lang_html('misc/pm_'.$showBox.'_title'); $qa_content['title'] = qa_lang_html( $showOutbox ? 'misc/pm_outbox_title' : 'misc/pm_inbox_title' );
$qa_content['script_rel'][] = 'qa-content/qa-user.js?'.QA_VERSION; $qa_content['script_rel'][] = 'qa-content/qa-user.js?'.QA_VERSION;
$qa_content['message_list'] = array( $qa_content['message_list'] = array(
...@@ -97,12 +97,12 @@ ...@@ -97,12 +97,12 @@
); );
$htmlDefaults = qa_message_html_defaults(); $htmlDefaults = qa_message_html_defaults();
if ($showBox === 'outbox') if ($showOutbox)
$htmlDefaults['towhomview'] = true; $htmlDefaults['towhomview'] = true;
foreach ($userMessages as $message) { foreach ($userMessages as $message) {
$msgFormat = qa_message_html_fields($message, $htmlDefaults); $msgFormat = qa_message_html_fields($message, $htmlDefaults);
$replyHandle = $showBox == 'inbox' ? $message['fromhandle'] : $message['tohandle']; $replyHandle = $showOutbox ? $message['tohandle'] : $message['fromhandle'];
$msgFormat['form'] = array( $msgFormat['form'] = array(
'style' => 'light', 'style' => 'light',
...@@ -112,7 +112,7 @@ ...@@ -112,7 +112,7 @@
'label' => qa_lang_html('question/reply_button'), 'label' => qa_lang_html('question/reply_button'),
), ),
'delete' => array( 'delete' => array(
'tags' => 'name="m'.qa_html($message['messageid']).'_dodelete" onclick="return qa_pm_click('.qa_js($message['messageid']).', this, '.qa_js($showBox).');"', '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'), 'label' => qa_lang_html('question/delete_button'),
'popup' => qa_lang_html('profile/delete_pm_popup'), 'popup' => qa_lang_html('profile/delete_pm_popup'),
), ),
...@@ -124,6 +124,6 @@ ...@@ -124,6 +124,6 @@
$qa_content['page_links'] = qa_html_page_links(qa_request(), $start, $pagesize, $count, qa_opt('pages_prev_next')); $qa_content['page_links'] = qa_html_page_links(qa_request(), $start, $pagesize, $count, qa_opt('pages_prev_next'));
$qa_content['navigation']['sub'] = qa_messages_sub_navigation($showBox); $qa_content['navigation']['sub'] = qa_messages_sub_navigation($showOutbox ? 'outbox' : 'inbox');
return $qa_content; return $qa_content;
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