<?php
require_once("include/contact_selectors.php");
+require_once("include/features.php");
/**
*
'$allowgid' => json_encode($perms['allow_gid']),
'$denycid' => json_encode($perms['deny_cid']),
'$denygid' => json_encode($perms['deny_gid']),
+ '$features' => array(
+ "aclautomention"=>(feature_enabled($user,"aclautomention")?"true":"false")
+ ),
));
t('Post Composition Features'),
array('richtext', t('Richtext Editor'), t('Enable richtext editor')),
array('preview', t('Post Preview'), t('Allow previewing posts and comments before publishing them')),
+ array('aclautomention', t('Auto-mention Forums'), t('Add/remove mention when a fourm page is selected/deselected in ACL window.')),
),
// Network sidebar widgets
if(! function_exists('validate_url')) {
function validate_url(&$url) {
-
// no naked subdomains (allow localhost for tests)
if(strpos($url,'.') === false && strpos($url,'/localhost/') === false)
return false;
-function ACL(backend_url, preset){
+function ACL(backend_url, preset, automention){
that = this;
that.url = backend_url;
+ that.automention = automention;
that.kp_timer = null;
}
ACL.prototype.remove_mention = function(id) {
+ if (!that.aclautomention) return;
var nick = that.data[id].nick;
var searchText = "@"+nick+"+"+id+" ";
if (tinyMCE.activeEditor===null) {
}
ACL.prototype.add_mention = function(id) {
+ if (!that.aclautomention) return;
var nick = that.data[id].nick;
var searchText = "@"+nick+"+"+id+" ";
if (tinyMCE.activeEditor===null) {
if(typeof acl=="undefined"){
acl = new ACL(
baseurl+"/acl",
- [ {{$allowcid}},{{$allowgid}},{{$denycid}},{{$denygid}} ]
+ [ {{$allowcid}},{{$allowgid}},{{$denycid}},{{$denygid}} ],
+ {{$features.aclautomention}}
);
}
});