From 7c8b9397ae8fc83ce96d9905992f40e6fde4663a Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sun, 12 Apr 2015 13:13:22 +0200 Subject: reverse file activity logic --- include/attach.php | 4 ++-- mod/filestorage.php | 8 ++++---- mod/photos.php | 2 +- view/css/conversation.css | 3 ++- view/tpl/attach_edit.tpl | 34 +++++++++------------------------- 5 files changed, 18 insertions(+), 33 deletions(-) diff --git a/include/attach.php b/include/attach.php index 415859b39..2a72c7819 100644 --- a/include/attach.php +++ b/include/attach.php @@ -985,7 +985,7 @@ function pipe_streams($in, $out) { * @param string $verb * @param boolean $no_activity */ -function file_activity($channel_id, $object, $allow_cid, $allow_gid, $deny_cid, $deny_gid, $verb, $no_activity) { +function file_activity($channel_id, $object, $allow_cid, $allow_gid, $deny_cid, $deny_gid, $verb, $notify) { require_once('include/items.php'); @@ -1107,7 +1107,7 @@ function file_activity($channel_id, $object, $allow_cid, $allow_gid, $deny_cid, //notice( t('File activity updated') . EOL); } - if($no_activity) { + if(! $notify) { return; } diff --git a/mod/filestorage.php b/mod/filestorage.php index f2c795379..0421641e2 100644 --- a/mod/filestorage.php +++ b/mod/filestorage.php @@ -21,7 +21,7 @@ function filestorage_post(&$a) { $recurse = ((x($_POST, 'recurse')) ? intval($_POST['recurse']) : 0); $resource = ((x($_POST, 'filehash')) ? notags($_POST['filehash']) : ''); - $no_activity = ((x($_POST, 'no_activity')) ? intval($_POST['no_activity']) : 0); + $notify = ((x($_POST, 'notify')) ? intval($_POST['notify']) : 0); if(! $resource) { notice(t('Item not found.') . EOL); @@ -41,7 +41,7 @@ function filestorage_post(&$a) { attach_change_permissions($channel_id, $resource, $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny, $recurse); - file_activity($channel_id, $object, $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny, 'post', $no_activity); + file_activity($channel_id, $object, $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny, 'post', $notify); goaway($cloudPath); } @@ -148,7 +148,7 @@ function filestorage_content(&$a) { '$aclselect' => $aclselect_e, '$lockstate' => $lockstate, '$permset' => t('Set/edit permissions'), - '$recurse' => t('Include all files and sub folders'), + '$recurse' => array('recurse', t('Include all files and sub folders'), 0, '', array(t('No'), t('Yes'))), '$backlink' => t('Return to file list'), '$isadir' => $is_a_dir, '$cpdesc' => t('Copy/paste this code to attach file to a post'), @@ -156,7 +156,7 @@ function filestorage_content(&$a) { '$submit' => t('Submit'), '$attach_btn_title' => t('Attach this file to a new post'), '$link_btn_title' => t('Show URL to this file'), - '$activity_btn_title' => t('Do not show in shared with me folder of your connections') + '$notify' => array('notify', t('Notify your contacts about this file'), 0, '', array(t('No'), t('Yes'))) )); echo $o; diff --git a/mod/photos.php b/mod/photos.php index 503a113dc..296aab67f 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -553,7 +553,7 @@ function photos_content(&$a) { '$nickname' => $a->data['channel']['channel_address'], '$newalbum_label' => t('Enter a new album name'), '$newalbum_placeholder' => t('or select an existing one (doubleclick)'), - '$visible' => array('visible', t('Create a status post for this upload'),0,''), + '$visible' => array('visible', t('Create a status post for this upload'), 0, '', array(t('No'), t('Yes'))), '$albums' => $albums['albums'], '$selname' => $selname, '$permissions' => t('Permissions'), diff --git a/view/css/conversation.css b/view/css/conversation.css index dced812b7..d94a08b3e 100644 --- a/view/css/conversation.css +++ b/view/css/conversation.css @@ -19,7 +19,8 @@ code { display:none; } -#jot-title-wrap input { +#jot-title-wrap input, +#jot-pagetitle-wrap input { padding: 8px; margin-bottom: 5px; } diff --git a/view/tpl/attach_edit.tpl b/view/tpl/attach_edit.tpl index 4a438e8fd..f4be58db0 100644 --- a/view/tpl/attach_edit.tpl +++ b/view/tpl/attach_edit.tpl @@ -3,7 +3,8 @@ - + {{if !$isadir}}{{include file="field_checkbox.tpl" field=$notify}}{{/if}} + {{if $isadir}}{{include file="field_checkbox.tpl" field=$recurse}}{{/if}}
{{if !$isadir}} @@ -14,31 +15,14 @@
-
- {{if $isadir}} -
- -
- {{/if}} - {{if !$isadir}} -
- -
- {{/if}} -
- - -
+
+ +
- {{$aclselect}}