aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2016-08-04 09:10:21 +0200
committerMario Vavti <mario@mariovavti.com>2016-08-04 09:10:21 +0200
commit4ede3fd771ea997cffaa6abab29988a58daf892e (patch)
tree45c5e44b042536014bb072676b74b4180442e793
parent3783c1af3e750fbf880559fd6f2d69017d87b101 (diff)
downloadvolse-hubzilla-4ede3fd771ea997cffaa6abab29988a58daf892e.tar.gz
volse-hubzilla-4ede3fd771ea997cffaa6abab29988a58daf892e.tar.bz2
volse-hubzilla-4ede3fd771ea997cffaa6abab29988a58daf892e.zip
multi acl: port photos
-rw-r--r--Zotlabs/Module/Photos.php10
-rwxr-xr-xview/tpl/photo_view.tpl5
-rwxr-xr-xview/tpl/photos_upload.tpl6
3 files changed, 13 insertions, 8 deletions
diff --git a/Zotlabs/Module/Photos.php b/Zotlabs/Module/Photos.php
index 1eeab1461..6aeac7af7 100644
--- a/Zotlabs/Module/Photos.php
+++ b/Zotlabs/Module/Photos.php
@@ -668,6 +668,10 @@ class Photos extends \Zotlabs\Web\Controller {
'$selname' => $selname,
'$permissions' => t('Permissions'),
'$aclselect' => $aclselect,
+ '$allow_cid' => acl2json($channel_acl['allow_cid']),
+ '$allow_gid' => acl2json($channel_acl['allow_gid']),
+ '$deny_cid' => acl2json($channel_acl['deny_cid']),
+ '$deny_gid' => acl2json($channel_acl['deny_gid']),
'$lockstate' => $lockstate,
'$uploader' => $ret['addon_text'],
'$default' => (($ret['default_upload']) ? true : false),
@@ -1016,7 +1020,7 @@ class Photos extends \Zotlabs\Web\Controller {
// FIXME - remove this when we move to conversation module
$r = $r[0]['children'];
-
+
$edit = null;
if($can_post) {
$album_e = $ph[0]['album'];
@@ -1042,6 +1046,10 @@ class Photos extends \Zotlabs\Web\Controller {
'tag_label' => t('Add a Tag'),
'permissions' => t('Permissions'),
'aclselect' => $aclselect_e,
+ 'allow_cid' => acl2json($ph[0]['allow_cid']),
+ 'allow_gid' => acl2json($ph[0]['allow_gid']),
+ 'deny_cid' => acl2json($ph[0]['deny_cid']),
+ 'deny_gid' => acl2json($ph[0]['deny_gid']),
'lockstate' => $lockstate[0],
'help_tags' => t('Example: @bob, @Barbara_Jensen, @jim@example.com'),
'item_id' => ((count($linked_items)) ? $link_item['id'] : 0),
diff --git a/view/tpl/photo_view.tpl b/view/tpl/photo_view.tpl
index 76259a8be..f81572b8c 100755
--- a/view/tpl/photo_view.tpl
+++ b/view/tpl/photo_view.tpl
@@ -53,7 +53,7 @@
{{$map}}
</div>
<div id="photo-edit" class="section-content-tools-wrapper">
- <form action="photos/{{$edit.nickname}}/{{$edit.resource_id}}" method="post" id="photo_edit_form">
+ <form action="photos/{{$edit.nickname}}/{{$edit.resource_id}}" method="post" id="photo_edit_form" class="acl-form" data-form_id="photo_edit_form" data-allow_cid='{{$edit.allow_cid}}' data-allow_gid='{{$edit.allow_gid}}' data-deny_cid='{{$edit.deny_cid}}' data-deny_gid='{{$edit.deny_gid}}'>
<input type="hidden" name="item_id" value="{{$edit.item_id}}" />
{{* album renaming is not supported atm.
<div class="form-group">
@@ -88,8 +88,6 @@
</div>
{{/if}}
- {{$edit.aclselect}}
-
<div class="form-group pull-left">
<button class="btn btn-danger btn-sm" id="photo-edit-delete-button" type="submit" name="delete" value="{{$edit.delete}}" onclick="return confirmDelete();" />{{$edit.delete}}</button>
</div>
@@ -102,6 +100,7 @@
<button id="dbtn-submit" class="btn btn-primary btn-sm" type="submit" name="submit" >{{$edit.submit}}</button>
</div>
</form>
+ {{$edit.aclselect}}
<div id="photo-edit-end" class="clear"></div>
</div>
<div id="photo-view-wrapper">
diff --git a/view/tpl/photos_upload.tpl b/view/tpl/photos_upload.tpl
index 6b98a8ac4..90cd0e84a 100755
--- a/view/tpl/photos_upload.tpl
+++ b/view/tpl/photos_upload.tpl
@@ -1,6 +1,6 @@
<div id="photo-upload-form">
<div class="section-content-tools-wrapper">
- <form action="photos/{{$nickname}}" enctype="multipart/form-data" method="post" name="photos-upload-form" id="photos-upload-form">
+ <form action="photos/{{$nickname}}" enctype="multipart/form-data" method="post" name="photos-upload-form" id="photos-upload-form" class="acl-form" data-form_id="photos-upload-form" data-allow_cid='{{$allow_cid}}' data-allow_gid='{{$allow_gid}}' data-deny_cid='{{$deny_cid}}' data-deny_gid='{{$deny_gid}}'>
<input type="hidden" id="photos-upload-source" name="source" value="photos" />
<div class="form-group">
@@ -14,9 +14,6 @@
{{/foreach}}
</datalist>
</div>
-
- {{$aclselect}}
-
{{if $default}}
<div class="form-group">
<input id="photos-upload-choose" type="file" name="userfile" />
@@ -59,5 +56,6 @@
{{/if}}
</form>
</div>
+ {{$aclselect}}
<div id="photos-upload-end" class="clear"></div>
</div>