X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=mod%2Fmessage.php;h=1724ebc424e7ac048cd68cb25195eddc4c78e772;hb=f76a24607c3c6b4debf7c2eaf3c957e4312f95c9;hp=1e9d731a4502064c39f830150a601d967fd0bff2;hpb=bfca7f47ef1f986ea8515d23c3c1962c7fe3a298;p=friendica.git diff --git a/mod/message.php b/mod/message.php index 1e9d731a45..1724ebc424 100644 --- a/mod/message.php +++ b/mod/message.php @@ -4,13 +4,20 @@ require_once('include/acl_selectors.php'); require_once('include/message.php'); function message_init(&$a) { - $tabs = array(); + + $tabs = ''; + + if ($a->argc >1 && is_numeric($a->argv[1])) { + $tabs = render_messages(get_messages(local_user(),0,5), 'mail_list.tpl'); + } + $new = array( 'label' => t('New Message'), 'url' => $a->get_baseurl(true) . '/message/new', 'sel'=> ($a->argv[1] == 'new'), + 'accesskey' => 'm', ); - + $tpl = get_markup_template('message_side.tpl'); $a->page['aside'] = replace_macros($tpl, array( '$tabs'=>$tabs, @@ -18,25 +25,18 @@ function message_init(&$a) { )); $base = $a->get_baseurl(); - $a->page['htmlhead'] .= ''; - $a->page['htmlhead'] .= <<< EOT - - -EOT; - + $head_tpl = get_markup_template('message-head.tpl'); + $a->page['htmlhead'] .= replace_macros($head_tpl,array( + '$baseurl' => $a->get_baseurl(true), + '$base' => $base + )); + + $end_tpl = get_markup_template('message-end.tpl'); + $a->page['end'] .= replace_macros($end_tpl,array( + '$baseurl' => $a->get_baseurl(true), + '$base' => $base + )); + } function message_post(&$a) { @@ -53,11 +53,15 @@ function message_post(&$a) { // Work around doubled linefeeds in Tinymce 3.5b2 - $plaintext = intval(get_pconfig(local_user(),'system','plaintext')); +/* $plaintext = intval(get_pconfig(local_user(),'system','plaintext') && !feature_enabled(local_user(),'richtext')); + if(! $plaintext) { + $body = fix_mce_lf($body); + }*/ + $plaintext = intval(!feature_enabled(local_user(),'richtext')); if(! $plaintext) { $body = fix_mce_lf($body); } - + $ret = send_message($recipient, $body, $subject, $replyto); $norecip = false; @@ -85,6 +89,8 @@ function message_post(&$a) { $a->argc = 2; $a->argv[1] = 'new'; } + else + goaway($a->get_baseurl(true) . '/' . $_SESSION['return_url']); } @@ -140,7 +146,7 @@ function item_redir_and_replace_images($body, $images, $cid) { for($i = 0; $i < count($images); $i++) { $search = '/\[url\=(.*?)\]\[!#saved_image' . $i . '#!\]\[\/url\]' . '/is'; - $replace = '[url=' . z_path() . '/redir/' . $cid + $replace = '[url=' . z_path() . '/redir/' . $cid . '?f=1&url=' . '$1' . '][!#saved_image' . $i . '#!][/url]' ; $img_end = strpos($origbody, '[!#saved_image' . $i . '#!][/url]') + strlen('[!#saved_image' . $i . '#!][/url]'); @@ -188,6 +194,36 @@ function message_content(&$a) { if(($a->argc == 3) && ($a->argv[1] === 'drop' || $a->argv[1] === 'dropconv')) { if(! intval($a->argv[2])) return; + + // Check if we should do HTML-based delete confirmation + if($_REQUEST['confirm']) { + //