X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fmessage.php;h=fb22419857e2f7d748ac3f06eccb122642eafa21;hb=0353410cd4b8153fd2b6e9d3524c6e46ad4acd68;hp=6fa128808b0650044ea56f0aae02c7e0aa5c9a23;hpb=b74a776162b86b6257acf0406e7df4da236c8f09;p=friendica.git
diff --git a/mod/message.php b/mod/message.php
index 6fa128808b..fb22419857 100644
--- a/mod/message.php
+++ b/mod/message.php
@@ -18,14 +18,19 @@ function message_init(&$a) {
));
$base = $a->get_baseurl();
- $a->page['htmlhead'] .= '';
+ $a->page['htmlhead'] .= '';
$a->page['htmlhead'] .= <<< EOT
@@ -94,10 +99,6 @@ function message_content(&$a) {
$myprofile = $a->get_baseurl(true) . '/profile/' . $a->user['nickname'];
-
-
-
-
$tpl = get_markup_template('mail_head.tpl');
$header = replace_macros($tpl, array(
'$messages' => t('Messages'),
@@ -171,21 +172,36 @@ function message_content(&$a) {
));
$preselect = (isset($a->argv[2])?array($a->argv[2]):false);
-
- $select = contact_select('messageto','message-to-select', $preselect, 4, true, false, false, 10);
+
-// here's sort of where we want to do contact autocomplete
-// comment out the contact selector line just above and use the following one instead,
-// then figure out how to make it do the right thing
-// pictures would be nice, but that didn't seem to work when I tried it
-// (the json backend is found in mod/acl.php)
+ $prename = $preurl = $preid = '';
-// $select = '';
+ if($preselect) {
+ $r = q("select name, url, id from contact where uid = %d and id = %d limit 1",
+ intval(local_user()),
+ intval($a->argv[2])
+ );
+ if(count($r)) {
+ $prename = $r[0]['name'];
+ $preurl = $r[0]['url'];
+ $preid = $r[0]['id'];
+ }
+ }
+
+ $prefill = (($preselect) ? $prename : '');
+
+ // the ugly select box
+
+ $select = contact_select('messageto','message-to-select', $preselect, 4, true, false, false, 10);
$tpl = get_markup_template('prv_message.tpl');
$o .= replace_macros($tpl,array(
'$header' => t('Send Private Message'),
'$to' => t('To:'),
+ '$showinputs' => 'true',
+ '$prefill' => $prefill,
+ '$autocomp' => $autocomp,
+ '$preid' => $preid,
'$subject' => t('Subject:'),
'$subjtxt' => ((x($_REQUEST,'subject')) ? strip_tags($_REQUEST['subject']) : ''),
'$text' => ((x($_REQUEST,'body')) ? escape_tags(htmlspecialchars($_REQUEST['body'])) : ''),
@@ -195,7 +211,8 @@ function message_content(&$a) {
'$parent' => '',
'$upload' => t('Upload photo'),
'$insert' => t('Insert web link'),
- '$wait' => t('Please wait')
+ '$wait' => t('Please wait'),
+ '$submit' => t('Submit')
));
return $o;
@@ -361,9 +378,10 @@ function message_content(&$a) {
$seen = $message['seen'];
}
+
+
$select = $message['name'] . '';
$parent = '';
-
$tpl = get_markup_template('mail_display.tpl');
$o = replace_macros($tpl, array(
@@ -378,6 +396,7 @@ function message_content(&$a) {
// reply
'$header' => t('Send Reply'),
'$to' => t('To:'),
+ '$showinputs' => '',
'$subject' => t('Subject:'),
'$subjtxt' => template_escape($message['title']),
'$readonly' => ' readonly="readonly" style="background: #BBBBBB;" ',