diff options
author | Mario <mario@mariovavti.com> | 2020-12-14 11:02:20 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2020-12-14 11:02:20 +0000 |
commit | 2a154f8c9a772d61e7dabb5e3fd110ba00cc6007 (patch) | |
tree | f57522c894e96f5a386f2fea9c379702b4c2781e /include/contact_widgets.php | |
parent | 634ace552d40f9f287a6419dd6fe5b19d3f390ca (diff) | |
download | volse-hubzilla-2a154f8c9a772d61e7dabb5e3fd110ba00cc6007.tar.gz volse-hubzilla-2a154f8c9a772d61e7dabb5e3fd110ba00cc6007.tar.bz2 volse-hubzilla-2a154f8c9a772d61e7dabb5e3fd110ba00cc6007.zip |
merge branch files_ng into dev
Diffstat (limited to 'include/contact_widgets.php')
-rw-r--r-- | include/contact_widgets.php | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/include/contact_widgets.php b/include/contact_widgets.php index 626a825b2..3b22a3c6d 100644 --- a/include/contact_widgets.php +++ b/include/contact_widgets.php @@ -93,7 +93,7 @@ function categories_widget($baseurl,$selected = '') { dbesc(ACTIVITY_UPDATE) ); } - else + else $r = unserialize($content); $terms = array(); @@ -206,6 +206,40 @@ function articlecategories_widget($baseurl,$selected = '') { return ''; } +function filecategories_widget($baseurl,$selected = '') { + + $perms = permissions_sql(App::$profile['profile_uid']); + + $terms = array(); + $r = q("select distinct(term.term) + from term join attach on term.oid = attach.id + where attach.uid = %d + and term.uid = attach.uid + and term.ttype = %d + and term.otype = %d + $perms + order by term.term asc", + intval(App::$profile['profile_uid']), + intval(TERM_CATEGORY), + intval(TERM_OBJ_FILE) + ); + + if($r && count($r)) { + foreach($r as $rr) + $terms[] = array('name' => $rr['term'], 'selected' => (($selected == $rr['term']) ? 'selected' : '')); + + return replace_macros(get_markup_template('categories_widget.tpl'),array( + '$title' => t('Categories'), + '$desc' => '', + '$sel_all' => (($selected == '') ? 'selected' : ''), + '$all' => t('Everything'), + '$terms' => $terms, + '$base' => $baseurl, + )); + } + + return ''; +} function common_friends_visitor_widget($profile_uid,$cnt = 25) { |