aboutsummaryrefslogtreecommitdiffstats
path: root/mod/sharedwithme.php
diff options
context:
space:
mode:
authormarijus <mario@mariovavti.com>2015-01-27 19:00:16 +0100
committermarijus <mario@mariovavti.com>2015-01-27 19:00:16 +0100
commit65aa6cf708a34e20ebad3c6b6dfc4088e927cce1 (patch)
tree29f2e7f364b1dee69b96084b94d878871f90a9fa /mod/sharedwithme.php
parentefb6842d748ad35f2843619983a4e3e9b14617a9 (diff)
downloadvolse-hubzilla-65aa6cf708a34e20ebad3c6b6dfc4088e927cce1.tar.gz
volse-hubzilla-65aa6cf708a34e20ebad3c6b6dfc4088e927cce1.tar.bz2
volse-hubzilla-65aa6cf708a34e20ebad3c6b6dfc4088e927cce1.zip
move userReadableSize() and getIconFromType() from /include/RedDAV/RedBrowser.php to include/text.php and add template for mod/sharedwithme
Diffstat (limited to 'mod/sharedwithme.php')
-rw-r--r--mod/sharedwithme.php38
1 files changed, 24 insertions, 14 deletions
diff --git a/mod/sharedwithme.php b/mod/sharedwithme.php
index 8b7d2661c..56cbc35ec 100644
--- a/mod/sharedwithme.php
+++ b/mod/sharedwithme.php
@@ -73,27 +73,37 @@ function sharedwithme_content(&$a) {
dbesc($channel['channel_hash'])
);
- $o = profile_tabs($a, $is_owner, $channel['channel_address']);
-
- $o .= '<div class="section-title-wrapper">';
-
- $o .= '<a href="/sharedwithme/dropall" onclick="return confirmDelete();" class="btn btn-xs btn-default pull-right"><i class="icon-trash"></i>&nbsp;' . t('Remove all entries') . '</a>';
-
- $o .= '<h2>' . t('Files shared with me') . '</h2>';
-
- $o .= '</div>';
-
- $o .= '<div class="section-content-wrapper">';
+ $items =array();
if($r) {
foreach($r as $rr) {
$object = json_decode($rr['object'],true);
- $url = rawurldecode(get_rel_link($object['link'],'alternate'));
- $o .= '<a href="' . $url . '?f=&zid=' . $channel['xchan_addr'] . '">' . $url . '</a>&nbsp;<a href="/sharedwithme/' . $rr['id'] . '/drop" onclick="return confirmDelete();"><i class="icon-trash drop-icons"></i></a><br><br>';
+
+ $item = array();
+ $item['id'] = $rr['id'];
+ $item['objfiletype'] = $object['filetype'];
+ $item['objfiletypeclass'] = getIconFromType($object['filetype']);
+ $item['objurl'] = rawurldecode(get_rel_link($object['link'],'alternate')) . '?f=&zid=' . $channel['xchan_addr'];
+ $item['objfilename'] = $object['filename'];
+ $item['objfilesize'] = userReadableSize($object['filesize']);
+ $item['objedited'] = $object['edited'];
+
+ $items[] = $item;
+
}
}
- $o .= '</div>';
+ $o = profile_tabs($a, $is_owner, $channel['channel_address']);
+
+ $o .= replace_macros(get_markup_template('sharedwithme.tpl'), array(
+ '$header' => t('Files: shared with me'),
+ '$name' => t('Name'),
+ '$size' => t('Size'),
+ '$lastmod' => t('Last Modified'),
+ '$dropall' => t('Remove all files'),
+ '$drop' => t('Remove this file'),
+ '$items' => $items
+ ));
return $o;