From 6698d7b03a88533eda8d79581b7e13565d36fa7e Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 20 Mar 2015 17:37:01 +0100 Subject: possible improvement regarding deletion --- mod/filestorage.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'mod') diff --git a/mod/filestorage.php b/mod/filestorage.php index 92474f336..07987e4c4 100644 --- a/mod/filestorage.php +++ b/mod/filestorage.php @@ -32,13 +32,15 @@ function filestorage_post(&$a) { $str_contact_allow = perms2str($_REQUEST['contact_allow']); $str_group_deny = perms2str($_REQUEST['group_deny']); $str_contact_deny = perms2str($_REQUEST['contact_deny']); - + + //get the object before permissions change so we can catch eventual former allowed members + $object = get_file_activity_object($channel_id, $resource, $cloudPath); + attach_change_permissions($channel_id, $resource, $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny, $recurse); //Build directory tree and redirect $channel = $a->get_channel(); $cloudPath = get_parent_cloudpath($channel_id, $channel['channel_address'], $resource); - $object = get_file_activity_object($channel_id, $resource, $cloudPath); file_activity($channel_id, $object, $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny, 'post', $no_activity); -- cgit v1.2.3 From 9a2ef382679fb7f3cf3f87bc1abaf74835ea273b Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 20 Mar 2015 18:04:22 +0100 Subject: need the cloudpath before creating the object --- mod/filestorage.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'mod') diff --git a/mod/filestorage.php b/mod/filestorage.php index 07987e4c4..f2c795379 100644 --- a/mod/filestorage.php +++ b/mod/filestorage.php @@ -33,15 +33,14 @@ function filestorage_post(&$a) { $str_group_deny = perms2str($_REQUEST['group_deny']); $str_contact_deny = perms2str($_REQUEST['contact_deny']); + $channel = $a->get_channel(); + $cloudPath = get_parent_cloudpath($channel_id, $channel['channel_address'], $resource); + //get the object before permissions change so we can catch eventual former allowed members $object = get_file_activity_object($channel_id, $resource, $cloudPath); attach_change_permissions($channel_id, $resource, $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny, $recurse); - //Build directory tree and redirect - $channel = $a->get_channel(); - $cloudPath = get_parent_cloudpath($channel_id, $channel['channel_address'], $resource); - file_activity($channel_id, $object, $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny, 'post', $no_activity); goaway($cloudPath); -- cgit v1.2.3 From ead45292e134fa03726912905ca1ca58ccb12fec Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sat, 21 Mar 2015 00:06:18 +0100 Subject: some tabs title statuseditor restructuring --- mod/network.php | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) (limited to 'mod') diff --git a/mod/network.php b/mod/network.php index 0eeeedbe9..7f8d39044 100644 --- a/mod/network.php +++ b/mod/network.php @@ -119,13 +119,16 @@ function network_content(&$a, $update = 0, $load = false) { if($cid) $def_acl = array('allow_cid' => '<' . intval($cid) . '>'); - if(! $update) { - $o .= network_tabs(); + $tabs = network_tabs(); + $o .= $tabs; // search terms header - if($search) - $o .= '

' . t('Search Results For:') . ' ' . htmlspecialchars($search, ENT_COMPAT,'UTF-8') . '

'; + if($search) { + $o .= replace_macros(get_markup_template("section_title.tpl"),array( + '$title' => t('Search Results For:') . ' ' . htmlspecialchars($search, ENT_COMPAT,'UTF-8') + )); + } nav_set_selected('network'); @@ -136,7 +139,6 @@ function network_content(&$a, $update = 0, $load = false) { 'deny_gid' => $channel['channel_deny_gid'] ); - $x = array( 'is_owner' => true, 'allow_location' => ((intval(get_pconfig($channel['channel_id'],'system','use_browser_location'))) ? '1' : ''), @@ -149,8 +151,8 @@ function network_content(&$a, $update = 0, $load = false) { 'profile_uid' => local_channel() ); - $o .= status_editor($a,$x); - + $status_editor = status_editor($a,$x); + $o .= $status_editor; } @@ -186,9 +188,15 @@ function network_content(&$a, $update = 0, $load = false) { $x = group_rec_byhash(local_channel(), $group_hash); - if($x) - $o = '

' . t('Collection: ') . $x['name'] . '

' . $o; + if($x) { + $title = replace_macros(get_markup_template("section_title.tpl"),array( + '$title' => t('Collection: ') . $x['name'] + )); + } + $o = $tabs; + $o .= $title; + $o .= $status_editor; } @@ -200,7 +208,12 @@ function network_content(&$a, $update = 0, $load = false) { ); if($r) { $sql_extra = " AND item.parent IN ( SELECT DISTINCT parent FROM item WHERE true $sql_options AND uid = " . intval(local_channel()) . " AND ( author_xchan = '" . dbesc($r[0]['abook_xchan']) . "' or owner_xchan = '" . dbesc($r[0]['abook_xchan']) . "' ) and item_restrict = 0 ) "; - $o = '

' . t('Connection: ') . $r[0]['xchan_name'] . '

' . $o; + $title = replace_macros(get_markup_template("section_title.tpl"),array( + '$title' => t('Connection: ') . $r[0]['xchan_name'] + )); + $o = $tabs; + $o .= $title; + $o .= $status_editor; } else { notice( t('Invalid connection.') . EOL); -- cgit v1.2.3