From 908e15bc9041f757217ba8d3635a8d83a5544c46 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 3 Aug 2016 23:57:41 +0200 Subject: multi acl: port events --- Zotlabs/Module/Events.php | 12 +++++++++++- include/conversation.php | 2 -- view/js/acl.js | 5 ++--- view/tpl/event_form.tpl | 9 ++++++--- view/tpl/jot.tpl | 2 +- 5 files changed, 20 insertions(+), 10 deletions(-) diff --git a/Zotlabs/Module/Events.php b/Zotlabs/Module/Events.php index def5c437b..d27de9989 100644 --- a/Zotlabs/Module/Events.php +++ b/Zotlabs/Module/Events.php @@ -435,6 +435,10 @@ class Events extends \Zotlabs\Web\Controller { $acl = new \Zotlabs\Access\AccessList($channel); $perm_defaults = $acl->get(); + + $permissions = ((x($orig_event)) ? $orig_event : $perm_defaults); + + //print_r(acl2json($permissions['allow_gid'])); killme(); $tpl = get_markup_template('event_form.tpl'); @@ -467,10 +471,16 @@ class Events extends \Zotlabs\Web\Controller { '$sh_checked' => $sh_checked, '$share' => array('share', t('Share this event'), $sh_checked, '', array(t('No'),t('Yes'))), '$preview' => t('Preview'), - '$permissions' => t('Permission settings'), + '$perms_label' => t('Permission settings'), // populating the acl dialog was a permission description from view_stream because Cal.php, which // displays events, says "since we don't currently have an event permission - use the stream permission" '$acl' => (($orig_event['event_xchan']) ? '' : populate_acl(((x($orig_event)) ? $orig_event : $perm_defaults), false, \Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_stream'))), + + '$allow_cid' => acl2json($permissions['allow_cid']), + '$allow_gid' => acl2json($permissions['allow_gid']), + '$deny_cid' => acl2json($permissions['deny_cid']), + '$deny_gid' => acl2json($permissions['deny_gid']), + '$submit' => t('Submit'), '$advanced' => t('Advanced Options') diff --git a/include/conversation.php b/include/conversation.php index f68d538dc..6bcd968f4 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1213,8 +1213,6 @@ function status_editor($a, $x, $popup = false) { call_hooks('jot_tool', $jotplugins); - //print_r(acl2json($x['permissions']['allow_gid'])); killme(); - $o .= replace_macros($tpl, array( '$return_path' => ((x($x, 'return_path')) ? $x['return_path'] : App::$query_string), '$action' => z_root() . '/item', diff --git a/view/js/acl.js b/view/js/acl.js index 0006bcfca..175462250 100644 --- a/view/js/acl.js +++ b/view/js/acl.js @@ -64,13 +64,12 @@ function ACL(backend_url) { ACL.prototype.get_form_data = function(event) { -//event.preventDefault() - form_id = $(this).data('formid'); + form_id = $(this).data('form_id'); that.form_id = $('#' + form_id); - console.log(event); + console.log(form_id); that.allow_cid = ($(this).data('allow_cid') || []); that.allow_gid = ($(this).data('allow_gid') || []); diff --git a/view/tpl/event_form.tpl b/view/tpl/event_form.tpl index fbeec9aa3..a2bb1f112 100755 --- a/view/tpl/event_form.tpl +++ b/view/tpl/event_form.tpl @@ -1,4 +1,4 @@ -
+ @@ -107,7 +107,6 @@ {{if ! $eid}} {{include file="field_checkbox.tpl" field=$share}} - {{$acl}} {{/if}}
@@ -116,8 +115,12 @@
{{if ! $eid}} - + {{/if}}
+ +{{if ! $eid}} + {{$acl}} +{{/if}} diff --git a/view/tpl/jot.tpl b/view/tpl/jot.tpl index a207989fb..661954623 100755 --- a/view/tpl/jot.tpl +++ b/view/tpl/jot.tpl @@ -1,4 +1,4 @@ -
+ {{$mimeselect}} {{$layoutselect}} {{if $id_select}} -- cgit v1.2.3