From 824262b8248701b9f0bd33168e73108eb457c464 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 25 Feb 2018 20:03:03 -0500 Subject: [PATCH] Move populate_acl to Acl --- include/acl_selectors.php | 4 ---- mod/bookmarklet.php | 2 +- mod/community.php | 4 +++- mod/display.php | 3 ++- mod/events.php | 2 +- mod/network.php | 4 ++-- mod/photos.php | 5 +++-- mod/profile.php | 3 ++- mod/settings.php | 3 ++- 9 files changed, 16 insertions(+), 14 deletions(-) diff --git a/include/acl_selectors.php b/include/acl_selectors.php index ef7eef108f..2c9770f9bd 100644 --- a/include/acl_selectors.php +++ b/include/acl_selectors.php @@ -9,10 +9,6 @@ use Friendica\Model\Contact; require_once "mod/proxy.php"; -function populate_acl($user = null, $show_jotnets = false) { - return Acl::getFullSelectorHTML($user, $show_jotnets); -} - function navbar_complete(App $a) { $search = notags(trim($_REQUEST['search'])); $mode = $_REQUEST['smode']; diff --git a/mod/bookmarklet.php b/mod/bookmarklet.php index 45c3d31907..5d8d02c477 100644 --- a/mod/bookmarklet.php +++ b/mod/bookmarklet.php @@ -38,7 +38,7 @@ function bookmarklet_content(App $a) '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' => Acl::getDefaultUserPermissions($a->user), - 'acl' => populate_acl($a->user, true), + 'acl' => Acl::getFullSelectorHTML($a->user, true), 'bang' => '', 'visitor' => 'block', 'profile_uid' => local_user(), diff --git a/mod/community.php b/mod/community.php index 88fc6168bb..5f0bd34a13 100644 --- a/mod/community.php +++ b/mod/community.php @@ -2,8 +2,10 @@ /** * @file mod/community.php */ + use Friendica\App; use Friendica\Content\Nav; +use Friendica\Core\Acl; use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\PConfig; @@ -104,7 +106,7 @@ function community_content(App $a, $update = 0) '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'), - 'acl' => populate_acl($a->user, true), + 'acl' => Acl::getFullSelectorHTML($a->user, true), 'bang' => '', 'visitor' => 'block', 'profile_uid' => local_user(), diff --git a/mod/display.php b/mod/display.php index 42aad736cc..d543535aa7 100644 --- a/mod/display.php +++ b/mod/display.php @@ -5,6 +5,7 @@ use Friendica\App; use Friendica\Content\Text\BBCode; +use Friendica\Core\Acl; use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\Protocol; @@ -317,7 +318,7 @@ function display_content(App $a, $update = false, $update_uid = 0) { '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'), - 'acl' => populate_acl($a->user, true), + 'acl' => Acl::getFullSelectorHTML($a->user, true), 'bang' => '', 'visitor' => 'block', 'profile_uid' => local_user(), diff --git a/mod/events.php b/mod/events.php index cf84dc7bad..7a54056b5a 100644 --- a/mod/events.php +++ b/mod/events.php @@ -484,7 +484,7 @@ function events_content(App $a) { $perms = Acl::getDefaultUserPermissions($orig_event); if ($mode === 'new' || $mode === 'copy') { - $acl = (($cid) ? '' : populate_acl(((x($orig_event)) ? $orig_event : $a->user))); + $acl = (($cid) ? '' : Acl::getFullSelectorHTML(((x($orig_event)) ? $orig_event : $a->user))); } // If we copy an old event, we need to remove the ID and URI diff --git a/mod/network.php b/mod/network.php index 9ab476004d..f7cc167642 100644 --- a/mod/network.php +++ b/mod/network.php @@ -429,7 +429,7 @@ function networkFlatView(App $a, $update = 0) ((strlen($a->user['allow_cid'])) || (strlen($a->user['allow_gid'])) || (strlen($a->user['deny_cid'])) || (strlen($a->user['deny_gid']))))) ? 'lock' : 'unlock'), 'default_perms' => Acl::getDefaultUserPermissions($a->user), - 'acl' => populate_acl($a->user, true), + 'acl' => Acl::getFullSelectorHTML($a->user, true), 'bang' => '', 'visitor' => 'block', 'profile_uid' => local_user(), @@ -578,7 +578,7 @@ function networkThreadedView(App $a, $update, $parent) ((strlen($a->user['allow_cid'])) || (strlen($a->user['allow_gid'])) || (strlen($a->user['deny_cid'])) || (strlen($a->user['deny_gid']))))) ? 'lock' : 'unlock'), 'default_perms' => Acl::getDefaultUserPermissions($a->user), - 'acl' => populate_acl((($gid || $cid || $nets) ? $def_acl : $a->user), true), + 'acl' => Acl::getFullSelectorHTML((($gid || $cid || $nets) ? $def_acl : $a->user), true), 'bang' => (($gid || $cid || $nets) ? '!' : ''), 'visitor' => 'block', 'profile_uid' => local_user(), diff --git a/mod/photos.php b/mod/photos.php index 3cd8b75286..fd8f1c84c7 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -7,6 +7,7 @@ use Friendica\App; use Friendica\Content\Feature; use Friendica\Content\Nav; use Friendica\Content\Text\BBCode; +use Friendica\Core\Acl; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; @@ -1084,7 +1085,7 @@ function photos_content(App $a) $tpl = get_markup_template('photos_upload.tpl'); - $aclselect_e = ($visitor ? '' : populate_acl($a->user)); + $aclselect_e = ($visitor ? '' : Acl::getFullSelectorHTML($a->user)); $o .= replace_macros($tpl,[ '$pagename' => L10n::t('Upload Photos'), @@ -1425,7 +1426,7 @@ function photos_content(App $a) $album_e = $ph[0]['album']; $caption_e = $ph[0]['desc']; - $aclselect_e = populate_acl($ph[0]); + $aclselect_e = Acl::getFullSelectorHTML($ph[0]); $edit = replace_macros($edit_tpl, [ '$id' => $ph[0]['id'], diff --git a/mod/profile.php b/mod/profile.php index 5e5988994c..6e8de35277 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -6,6 +6,7 @@ use Friendica\App; use Friendica\Content\Nav; use Friendica\Content\Widget; +use Friendica\Core\Acl; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; @@ -213,7 +214,7 @@ function profile_content(App $a, $update = 0) || strlen($a->user['deny_cid']) || strlen($a->user['deny_gid']) ) ? 'lock' : 'unlock', - 'acl' => $is_owner ? populate_acl($a->user, true) : '', + 'acl' => $is_owner ? Acl::getFullSelectorHTML($a->user, true) : '', 'bang' => '', 'visitor' => $is_owner || $commvisitor ? 'block' : 'none', 'profile_uid' => $a->profile['profile_uid'], diff --git a/mod/settings.php b/mod/settings.php index 6fcbe4d116..6646f1559c 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -6,6 +6,7 @@ use Friendica\App; use Friendica\Content\Feature; use Friendica\Content\Nav; +use Friendica\Core\Acl; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; @@ -1224,7 +1225,7 @@ function settings_content(App $a) '$permissions' => L10n::t('Default Post Permissions'), '$permdesc' => L10n::t("\x28click to open/close\x29"), '$visibility' => $profile['net-publish'], - '$aclselect' => populate_acl($a->user), + '$aclselect' => Acl::getFullSelectorHTML($a->user), '$suggestme' => $suggestme, '$blockwall'=> $blockwall, // array('blockwall', L10n::t('Allow friends to post to your profile page:'), !$blockwall, ''), '$blocktags'=> $blocktags, // array('blocktags', L10n::t('Allow friends to tag your posts:'), !$blocktags, ''),