structural cleanup of mod_message
This commit is contained in:
parent
364e33e4f1
commit
a07500b527
@ -4,38 +4,17 @@ require_once('include/acl_selectors.php');
|
|||||||
require_once('include/message.php');
|
require_once('include/message.php');
|
||||||
require_once('include/zot.php');
|
require_once('include/zot.php');
|
||||||
|
|
||||||
function message_init(&$a) {
|
|
||||||
$tabs = array();
|
function message_aside(&$a) {
|
||||||
$new = array(
|
|
||||||
|
$a->set_widget('newmessage',replace_macros(get_markup_template('message_side.tpl'), array(
|
||||||
|
'$tabs'=> array(),
|
||||||
|
'$new'=>array(
|
||||||
'label' => t('New Message'),
|
'label' => t('New Message'),
|
||||||
'url' => $a->get_baseurl(true) . '/message/new',
|
'url' => $a->get_baseurl(true) . '/message/new',
|
||||||
'sel'=> (argv(1) == 'new'),
|
'sel'=> (argv(1) == 'new'),
|
||||||
);
|
)
|
||||||
|
)));
|
||||||
$tpl = get_markup_template('message_side.tpl');
|
|
||||||
$a->page['aside'] = replace_macros($tpl, array(
|
|
||||||
'$tabs'=>$tabs,
|
|
||||||
'$new'=>$new,
|
|
||||||
));
|
|
||||||
$base = $a->get_baseurl();
|
|
||||||
|
|
||||||
$a->page['htmlhead'] .= <<< EOT
|
|
||||||
|
|
||||||
<script>$(document).ready(function() {
|
|
||||||
var a;
|
|
||||||
a = $("#recip").autocomplete({
|
|
||||||
serviceUrl: '$base/acl',
|
|
||||||
minChars: 2,
|
|
||||||
width: 350,
|
|
||||||
onSelect: function(value,data) {
|
|
||||||
$("#recip-complete").val(data);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
</script>
|
|
||||||
EOT;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -437,7 +416,7 @@ function message_content(&$a) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
dbg(1);
|
|
||||||
$c = q("select * from xchan where xchan_hash in (" . implode(',',$chans) . ")");
|
$c = q("select * from xchan where xchan_hash in (" . implode(',',$chans) . ")");
|
||||||
|
|
||||||
$r = q("UPDATE `mail` SET mail_flags = (mail_flags ^ %d) where not (mail_flags & %d) and parent_uri = '%s' AND channel_id = %d",
|
$r = q("UPDATE `mail` SET mail_flags = (mail_flags ^ %d) where not (mail_flags & %d) and parent_uri = '%s' AND channel_id = %d",
|
||||||
@ -446,7 +425,7 @@ dbg(1);
|
|||||||
dbesc($r[0]['parent_uri']),
|
dbesc($r[0]['parent_uri']),
|
||||||
intval(local_user())
|
intval(local_user())
|
||||||
);
|
);
|
||||||
dbg(0);
|
|
||||||
require_once("include/bbcode.php");
|
require_once("include/bbcode.php");
|
||||||
|
|
||||||
$tpl = get_markup_template('msg-header.tpl');
|
$tpl = get_markup_template('msg-header.tpl');
|
||||||
|
12
view/js/mod_message.js
Normal file
12
view/js/mod_message.js
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
$(document).ready(function() {
|
||||||
|
var a;
|
||||||
|
a = $("#recip").autocomplete({
|
||||||
|
serviceUrl: baseurl + '/acl',
|
||||||
|
minChars: 2,
|
||||||
|
width: 350,
|
||||||
|
onSelect: function(value,data) {
|
||||||
|
$("#recip-complete").val(data);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
Reference in New Issue
Block a user