Move get_acl_permissions to Acl

This commit is contained in:
Hypolite Petovan 2018-02-25 20:00:05 -05:00
parent ce9e0f3649
commit 2b35938e34
4 changed files with 8 additions and 8 deletions

View file

@ -9,10 +9,6 @@ use Friendica\Model\Contact;
require_once "mod/proxy.php";
function get_acl_permissions($user = null) {
return Acl::getDefaultUserPermissions($user);
}
function populate_acl($user = null, $show_jotnets = false) {
return Acl::getFullSelectorHTML($user, $show_jotnets);
}

View file

@ -2,7 +2,9 @@
/**
* @file mod/bookmarklet.php
*/
use Friendica\App;
use Friendica\Core\Acl;
use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Module\Login;
@ -35,7 +37,7 @@ function bookmarklet_content(App $a)
'default_location' => $a->user['default-location'],
'nickname' => $a->user['nickname'],
'lockstate' => ((is_array($a->user) && ((strlen($a->user['allow_cid'])) || (strlen($a->user['allow_gid'])) || (strlen($a->user['deny_cid'])) || (strlen($a->user['deny_gid'])))) ? 'lock' : 'unlock'),
'default_perms' => get_acl_permissions($a->user),
'default_perms' => Acl::getDefaultUserPermissions($a->user),
'acl' => populate_acl($a->user, true),
'bang' => '',
'visitor' => 'block',

View file

@ -6,6 +6,7 @@
use Friendica\App;
use Friendica\Content\Nav;
use Friendica\Core\Acl;
use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Core\Worker;
@ -480,7 +481,7 @@ function events_content(App $a) {
require_once 'include/acl_selectors.php' ;
$perms = get_acl_permissions($orig_event);
$perms = Acl::getDefaultUserPermissions($orig_event);
if ($mode === 'new' || $mode === 'copy') {
$acl = (($cid) ? '' : populate_acl(((x($orig_event)) ? $orig_event : $a->user)));

View file

@ -9,6 +9,7 @@ use Friendica\Content\Feature;
use Friendica\Content\ForumManager;
use Friendica\Content\Nav;
use Friendica\Content\Widget;
use Friendica\Core\Acl;
use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\L10n;
@ -427,7 +428,7 @@ function networkFlatView(App $a, $update = 0)
'lockstate' => (((is_array($a->user) &&
((strlen($a->user['allow_cid'])) || (strlen($a->user['allow_gid'])) ||
(strlen($a->user['deny_cid'])) || (strlen($a->user['deny_gid']))))) ? 'lock' : 'unlock'),
'default_perms' => get_acl_permissions($a->user),
'default_perms' => Acl::getDefaultUserPermissions($a->user),
'acl' => populate_acl($a->user, true),
'bang' => '',
'visitor' => 'block',
@ -576,7 +577,7 @@ function networkThreadedView(App $a, $update, $parent)
'lockstate' => ((($gid) || ($cid) || ($nets) || (is_array($a->user) &&
((strlen($a->user['allow_cid'])) || (strlen($a->user['allow_gid'])) ||
(strlen($a->user['deny_cid'])) || (strlen($a->user['deny_gid']))))) ? 'lock' : 'unlock'),
'default_perms' => get_acl_permissions($a->user),
'default_perms' => Acl::getDefaultUserPermissions($a->user),
'acl' => populate_acl((($gid || $cid || $nets) ? $def_acl : $a->user), true),
'bang' => (($gid || $cid || $nets) ? '!' : ''),
'visitor' => 'block',