Set backlink to the parent folder, not cloud's root.

If you edit a file and click on the backlink you always returned to
the root folder of your cloud. This patch sets the correct parent
folder as backlink.
Bit messy, but looks like it works.
This commit is contained in:
Klaus Weidenbach 2014-06-24 21:05:00 +02:00
parent a2108570c1
commit a6403905ef
2 changed files with 3 additions and 1 deletions

View File

@ -110,6 +110,7 @@ function filestorage_content(&$a) {
$channel = $a->get_channel(); $channel = $a->get_channel();
$cloudpath = get_cloudpath($f) . (($f['flags'] & ATTACH_FLAG_DIR) ? '?f=&davguest=1' : ''); $cloudpath = get_cloudpath($f) . (($f['flags'] & ATTACH_FLAG_DIR) ? '?f=&davguest=1' : '');
$parentpath = get_parent_cloudpath($channel['channel_id'], $channel['channel_address'], $f['hash']);
$aclselect_e = populate_acl($f,false); $aclselect_e = populate_acl($f,false);
$is_a_dir = (($f['flags'] & ATTACH_FLAG_DIR) ? true : false); $is_a_dir = (($f['flags'] & ATTACH_FLAG_DIR) ? true : false);
@ -121,6 +122,7 @@ function filestorage_content(&$a) {
'$header' => t('Edit file permissions'), '$header' => t('Edit file permissions'),
'$file' => $f, '$file' => $f,
'$cloudpath' => z_root() . '/' . $cloudpath, '$cloudpath' => z_root() . '/' . $cloudpath,
'$parentpath' => $parentpath,
'$uid' => $channel['channel_id'], '$uid' => $channel['channel_id'],
'$channelnick' => $channel['channel_address'], '$channelnick' => $channel['channel_address'],
'$permissions' => t('Permissions'), '$permissions' => t('Permissions'),

View File

@ -1,4 +1,4 @@
<div id="attach-edit-backlink">< <a href="cloud/{{$channelnick}}">{{$backlink}}</a></div> <div id="attach-edit-backlink">< <a href="{{$parentpath}}">{{$backlink}}</a></div>
<h1>{{$header}}</h1> <h1>{{$header}}</h1>