diff --git a/Code/Lib/AccessList.php b/Code/Lib/AccessList.php index 1fa18128e..0383332f2 100644 --- a/Code/Lib/AccessList.php +++ b/Code/Lib/AccessList.php @@ -382,10 +382,10 @@ class AccessList "SELECT * FROM pgrp WHERE deleted = 0 AND uid = %d ORDER BY gname ASC", intval($channel['channel_id']) ); - $grps[] = [ - 'name' => t('Public'), 'hash' => '', 'selected' => $channel['channel_allow_gid'] === '', - 'name' => t('Connections'), 'hash' => 'connections:' . $channel['channel_hash'], - 'selected' => $channel['channel_allow_gid'] === '<' . 'connections:' . $channel['channel_hash'] . '>' + $grps = [ + ['name' => t('Public'), 'id' => '', 'selected' => $channel['channel_allow_gid'] === ''], + ['name' => t('Connections'), 'id' => 'connections:' . $channel['channel_hash'], + 'selected' => $channel['channel_allow_gid'] === '<' . 'connections:' . $channel['channel_hash'] . '>'] ]; if ($r) { foreach ($r as $rr) { @@ -399,7 +399,8 @@ class AccessList '$desc' => t('Use this form to select your default posting audience and default permissions for media and file uploads.'), '$desc2' => t('Note: If you change your channel type, this form will be reset to the default audience for that type'), '$label' => t('Default audience for posts and media access'), - '$groups' => $grps + '$groups' => $grps, + '$submit' => t('Submit') ]); } diff --git a/Code/Lib/Apps.php b/Code/Lib/Apps.php index 12a17fd3d..796726c06 100644 --- a/Code/Lib/Apps.php +++ b/Code/Lib/Apps.php @@ -382,6 +382,7 @@ class Apps 'Access Lists' => t('Access Lists'), 'Apps' => t('Apps'), 'Articles' => t('Articles'), + 'Audience' => t('Audience'), 'CalDAV' => t('CalDAV'), 'CardDAV' => t('CardDAV'), 'Cards' => t('Cards'), diff --git a/Code/Module/Audience.php b/Code/Module/Audience.php index 249a4d28a..6f8705173 100644 --- a/Code/Module/Audience.php +++ b/Code/Module/Audience.php @@ -2,7 +2,10 @@ namespace Code\Module; +use App; use Code\Lib\AccessControl; +use Code\Lib\AccessList; +use Code\Lib\Libsync; use Code\Web\Controller; class Audience extends Controller @@ -18,8 +21,8 @@ class Audience extends Controller dbesc($channel_allow_gid), intval($channel['channel_id']) ); - - + App::$channel['channel_allow_gid'] = $channel_allow_gid; + Libsync::build_sync_packet(); } public function get() @@ -28,7 +31,6 @@ class Audience extends Controller return login(); } return AccessList::AudienceSelect(); - } diff --git a/app/audience.apd b/app/audience.apd new file mode 100644 index 000000000..c8c0f1e33 --- /dev/null +++ b/app/audience.apd @@ -0,0 +1,6 @@ +version: 1 +url: $baseurl/audience +requires: local_channel +name: Audience +photo: icon:address-book-o +categories: social diff --git a/view/tpl/audience_selection.tpl b/view/tpl/audience_selection.tpl index 7d5246880..6deffee27 100644 --- a/view/tpl/audience_selection.tpl +++ b/view/tpl/audience_selection.tpl @@ -1,6 +1,8 @@
+

{{$title}} +

{{$desc}}
{{$desc2}}
@@ -8,7 +10,7 @@
- {{foreach $groups as $group}} {{/foreach}}