multi acl: port events
This commit is contained in:
parent
df27a48e72
commit
908e15bc90
@ -436,6 +436,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');
|
||||
|
||||
$form = replace_macros($tpl,array(
|
||||
@ -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')
|
||||
|
||||
|
@ -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',
|
||||
|
@ -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') || []);
|
||||
|
@ -1,4 +1,4 @@
|
||||
<form id="event-edit-form" action="{{$post}}" method="post" >
|
||||
<form id="event-edit-form" action="{{$post}}" method="post" class="acl-form" data-form_id="event-edit-form" data-allow_cid='{{$allow_cid}}' data-allow_gid='{{$allow_gid}}' data-deny_cid='{{$deny_cid}}' data-deny_gid='{{$deny_gid}}'>
|
||||
|
||||
<input type="hidden" name="event_id" value="{{$eid}}" />
|
||||
<input type="hidden" name="event_hash" value="{{$event_hash}}" />
|
||||
@ -107,7 +107,6 @@
|
||||
|
||||
{{if ! $eid}}
|
||||
{{include file="field_checkbox.tpl" field=$share}}
|
||||
{{$acl}}
|
||||
{{/if}}
|
||||
|
||||
<div class="clear"></div>
|
||||
@ -116,8 +115,12 @@
|
||||
<div class="btn-group pull-right">
|
||||
<button id="event-edit-preview-btn" class="btn btn-default" type="button" title="{{$preview}}" onclick="doEventPreview();"><i class="fa fa-eye" ></i></button>
|
||||
{{if ! $eid}}
|
||||
<button id="dbtn-acl" class="btn btn-default" type="button" data-toggle="modal" data-target="#aclModal" title="{{$permissions}}"><i id="jot-perms-icon" class="fa"></i></button>
|
||||
<button id="dbtn-acl" class="btn btn-default" type="button" data-toggle="modal" data-target="#aclModal" title="{{$perms_label}}"><i id="jot-perms-icon" class="fa"></i></button>
|
||||
{{/if}}
|
||||
<button id="event-submit" class="btn btn-primary" type="submit" name="submit">{{$submit}}</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
{{if ! $eid}}
|
||||
{{$acl}}
|
||||
{{/if}}
|
||||
|
@ -1,4 +1,4 @@
|
||||
<form id="profile-jot-form" action="{{$action}}" method="post" class="acl-form" data-formid="profile-jot-form" data-allow_cid='{{$allow_cid}}' data-allow_gid='{{$allow_gid}}' data-deny_cid='{{$deny_cid}}' data-deny_gid='{{$deny_gid}}'>
|
||||
<form id="profile-jot-form" action="{{$action}}" method="post" class="acl-form" data-form_id="profile-jot-form" data-allow_cid='{{$allow_cid}}' data-allow_gid='{{$allow_gid}}' data-deny_cid='{{$deny_cid}}' data-deny_gid='{{$deny_gid}}'>
|
||||
{{$mimeselect}}
|
||||
{{$layoutselect}}
|
||||
{{if $id_select}}
|
||||
|
Reference in New Issue
Block a user