require_once('include/message.php');
require_once('include/Smilies.php');
-function message_init(&$a) {
+function message_init(App $a) {
$tabs = '';
}
-function message_post(&$a) {
+function message_post(App $a) {
- if(! local_user()) {
+ if (! local_user()) {
notice( t('Permission denied.') . EOL);
return;
}
$body = ((x($_REQUEST,'body')) ? escape_tags(trim($_REQUEST['body'])) : '');
$recipient = ((x($_REQUEST,'messageto')) ? intval($_REQUEST['messageto']) : 0 );
- // Work around doubled linefeeds in Tinymce 3.5b2
-
-/* $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;
$newbody = $newbody . $origbody;
$cnt = 0;
- foreach($images as $image) {
+ foreach ($images as $image) {
// We're depending on the property of 'foreach' (specified on the PHP website) that
// it loops over the array starting from the first element and going sequentially
// to the last element
-function message_content(&$a) {
+function message_content(App $a) {
$o = '';
nav_set_selected('messages');
- if(! local_user()) {
+ if (! local_user()) {
notice( t('Permission denied.') . EOL);
return;
}
intval($a->argv[2]),
intval(local_user())
);
- if($r) {
+ if ($r) {
info( t('Message deleted.') . EOL );
}
//goaway(App::get_baseurl(true) . '/message' );
$o .= $header;
-/* $plaintext = false;
- if(intval(get_pconfig(local_user(),'system','plaintext')))
- $plaintext = true;*/
- $plaintext = true;
- if( local_user() && feature_enabled(local_user(),'richtext') )
- $plaintext = false;
-
-
$tpl = get_markup_template('msg-header.tpl');
$a->page['htmlhead'] .= replace_macros($tpl, array(
'$baseurl' => App::get_baseurl(true),
- '$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'),
'$nickname' => $a->user['nickname'],
'$linkurl' => t('Please enter a link URL:')
));
$tpl = get_markup_template('msg-end.tpl');
$a->page['end'] .= replace_macros($tpl, array(
'$baseurl' => App::get_baseurl(true),
- '$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'),
'$nickname' => $a->user['nickname'],
'$linkurl' => t('Please enter a link URL:')
));
$_SESSION['return_url'] = $a->query_string;
- if($a->argc == 1) {
+ if ($a->argc == 1) {
// List messages
$r = get_messages(local_user(), $a->pager['start'], $a->pager['itemspage']);
- if(! dbm::is_result($r)) {
+ if (! dbm::is_result($r)) {
info( t('No messages.') . EOL);
return $o;
}
$o .= $header;
- $plaintext = true;
- if( local_user() && feature_enabled(local_user(),'richtext') )
- $plaintext = false;
-
$r = q("SELECT `mail`.*, `contact`.`name`, `contact`.`url`, `contact`.`thumb`
FROM `mail` LEFT JOIN `contact` ON `mail`.`contact-id` = `contact`.`id`
WHERE `mail`.`uid` = %d AND `mail`.`id` = %d LIMIT 1",
$tpl = get_markup_template('msg-header.tpl');
$a->page['htmlhead'] .= replace_macros($tpl, array(
'$baseurl' => App::get_baseurl(true),
- '$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'),
'$nickname' => $a->user['nickname'],
'$linkurl' => t('Please enter a link URL:')
));
$tpl = get_markup_template('msg-end.tpl');
$a->page['end'] .= replace_macros($tpl, array(
'$baseurl' => App::get_baseurl(true),
- '$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'),
'$nickname' => $a->user['nickname'],
'$linkurl' => t('Please enter a link URL:')
));
-
$mails = array();
$seen = 0;
$unknown = false;