diff --git a/include/acl_selectors.php b/include/acl_selectors.php index 01c2f1d706..3306871d00 100644 --- a/include/acl_selectors.php +++ b/include/acl_selectors.php @@ -1,6 +1,7 @@ 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") + ), )); diff --git a/include/features.php b/include/features.php index b2712665e1..24955ba104 100644 --- a/include/features.php +++ b/include/features.php @@ -30,6 +30,7 @@ function get_features() { 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 diff --git a/include/network.php b/include/network.php index a4538e88ed..a663a6d942 100644 --- a/include/network.php +++ b/include/network.php @@ -617,7 +617,6 @@ function fetch_xrd_links($url) { 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; diff --git a/js/acl.js b/js/acl.js index 76c2f4c195..b57a925462 100644 --- a/js/acl.js +++ b/js/acl.js @@ -1,7 +1,8 @@ -function ACL(backend_url, preset){ +function ACL(backend_url, preset, automention){ that = this; that.url = backend_url; + that.automention = automention; that.kp_timer = null; @@ -35,6 +36,7 @@ function ACL(backend_url, preset){ } ACL.prototype.remove_mention = function(id) { + if (!that.aclautomention) return; var nick = that.data[id].nick; var searchText = "@"+nick+"+"+id+" "; if (tinyMCE.activeEditor===null) { @@ -52,6 +54,7 @@ ACL.prototype.remove_mention = function(id) { } ACL.prototype.add_mention = function(id) { + if (!that.aclautomention) return; var nick = that.data[id].nick; var searchText = "@"+nick+"+"+id+" "; if (tinyMCE.activeEditor===null) { diff --git a/view/templates/acl_selector.tpl b/view/templates/acl_selector.tpl index 7a9514ea86..6b6f1be4a9 100644 --- a/view/templates/acl_selector.tpl +++ b/view/templates/acl_selector.tpl @@ -20,7 +20,8 @@ $(document).ready(function() { if(typeof acl=="undefined"){ acl = new ACL( baseurl+"/acl", - [ {{$allowcid}},{{$allowgid}},{{$denycid}},{{$denygid}} ] + [ {{$allowcid}},{{$allowgid}},{{$denycid}},{{$denygid}} ], + {{$features.aclautomention}} ); } });