X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fmessage.php;h=39aa0479ff17f99b8fa07f0aa9cfbb731be2769b;hb=6a8b96709e13b04a0657c25b4538c160e2118131;hp=cc94730bc561b2d393c5bacaab6b3c94fbdfd934;hpb=d8bd4fbb3e38bf0ff9c7b61dba58e20c0d097d75;p=friendica.git diff --git a/mod/message.php b/mod/message.php index cc94730bc5..39aa0479ff 100644 --- a/mod/message.php +++ b/mod/message.php @@ -46,12 +46,31 @@ function message_content(&$a) { $myprofile = $a->get_baseurl() . '/profile/' . $a->user['nickname']; + $tabs = array( + array( + 'label' => t('Inbox'), + 'url'=> $a->get_baseurl() . '/message', + 'sel'=> (($a->argc == 1) ? 'active' : ''), + ), + array( + 'label' => t('Outbox'), + 'url' => $a->get_baseurl() . '/message/sent', + 'sel'=> (($a->argv[1] == 'sent') ? 'active' : ''), + ), + array( + 'label' => t('New Message'), + 'url' => $a->get_baseurl() . '/message/new', + 'sel'=> (($a->argv[1] == 'new') ? 'active' : ''), + ), + ); + $tpl = get_markup_template('common_tabs.tpl'); + $tab_content = replace_macros($tpl, array('$tabs'=>$tabs)); + + $tpl = get_markup_template('mail_head.tpl'); $header = replace_macros($tpl, array( '$messages' => t('Messages'), - '$inbox' => t('Inbox'), - '$outbox' => t('Outbox'), - '$new' => t('New Message') + '$tab_content' => $tab_content )); @@ -90,6 +109,8 @@ function message_content(&$a) { if(($a->argc > 1) && ($a->argv[1] === 'new')) { + $o .= $header; + $tpl = get_markup_template('msg-header.tpl'); $a->page['htmlhead'] .= replace_macros($tpl, array( @@ -114,7 +135,6 @@ function message_content(&$a) { '$upload' => t('Upload photo'), '$insert' => t('Insert web link'), '$wait' => t('Please wait') - )); return $o; @@ -159,10 +179,10 @@ function message_content(&$a) { '$from_url' => $a->get_baseurl() . '/redir/' . $rr['contact-id'], '$sparkle' => ' sparkle', '$from_photo' => $rr['thumb'], - '$subject' => (($rr['mailseen']) ? $rr['title'] : '' . $rr['title'] . ''), + '$subject' => template_escape((($rr['mailseen']) ? $rr['title'] : '' . $rr['title'] . '')), '$delete' => t('Delete conversation'), - '$body' => $rr['body'], - '$to_name' => $rr['name'], + '$body' => template_escape($rr['body']), + '$to_name' => template_escape($rr['name']), '$date' => datetime_convert('UTC',date_default_timezone_get(),$rr['mailcreated'], t('D, d M Y - g:i A')) )); } @@ -221,14 +241,14 @@ function message_content(&$a) { } $o .= replace_macros($tpl, array( '$id' => $message['id'], - '$from_name' =>$message['from-name'], + '$from_name' => template_escape($message['from-name']), '$from_url' => $from_url, '$sparkle' => $sparkle, '$from_photo' => $message['from-photo'], - '$subject' => $message['title'], - '$body' => smilies(bbcode($message['body'])), + '$subject' => template_escape($message['title']), + '$body' => template_escape(smilies(bbcode($message['body']))), '$delete' => t('Delete message'), - '$to_name' => $message['name'], + '$to_name' => template_escape($message['name']), '$date' => datetime_convert('UTC',date_default_timezone_get(),$message['created'],'D, d M Y - g:i A') )); @@ -240,7 +260,7 @@ function message_content(&$a) { '$header' => t('Send Reply'), '$to' => t('To:'), '$subject' => t('Subject:'), - '$subjtxt' => $message['title'], + '$subjtxt' => template_escape($message['title']), '$readonly' => ' readonly="readonly" style="background: #BBBBBB;" ', '$yourmessage' => t('Your message:'), '$select' => $select, @@ -248,7 +268,6 @@ function message_content(&$a) { '$upload' => t('Upload photo'), '$insert' => t('Insert web link'), '$wait' => t('Please wait') - )); return $o;