]> git.mxchange.org Git - friendica.git/commitdiff
add fetaure switch for acl-automention
authorfabrixxm <fabrix.xm@gmail.com>
Fri, 3 Jan 2014 13:40:43 +0000 (14:40 +0100)
committerfabrixxm <fabrix.xm@gmail.com>
Fri, 3 Jan 2014 13:40:43 +0000 (14:40 +0100)
include/acl_selectors.php
include/features.php
include/network.php
js/acl.js
view/templates/acl_selector.tpl

index 01c2f1d706af648a9f9e5fcaffce8106e27ca9a7..3306871d00ba3a27b65fe47bfba1e0bb103bb1f4 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 
 require_once("include/contact_selectors.php");
+require_once("include/features.php");
 
 /**
  * 
@@ -329,6 +330,9 @@ function populate_acl($user = null,$celeb = false) {
                '$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")
+               ),
        ));
        
        
index b2712665e159a8fad2779a7daf2c922b92441fe1..24955ba104f72c18b37a4875bb4d946c944e98d1 100644 (file)
@@ -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
index a4538e88ed79a92d54fc0182b150c6cfaad264b0..a663a6d94283ad896139315423c250b0c7d17a1a 100644 (file)
@@ -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;
index 76c2f4c19579d57010cb81d726b1469c7831af26..b57a92546203b2f98162d1b5cab8c9ef59efc9f6 100644 (file)
--- 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) {
index 7a9514ea8612fb6f5b579148270cc39773fb2ffe..6b6f1be4a90d32bb80df36f9e731be12c6ba7605 100644 (file)
@@ -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}}
                );
        }
 });