aboutsummaryrefslogtreecommitdiffstats
path: root/include/contact_widgets.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-01-13 09:50:53 +0000
committerMario <mario@mariovavti.com>2021-01-13 09:50:53 +0000
commit5eefdc6485b2f6082f6fe5dfd6f1731fae7e3a2a (patch)
tree7521f4800e393538d19c393c6f495ea2d41cbf5a /include/contact_widgets.php
parent0bc4c7d1a0e4348018e533be600ad1c648fd97fb (diff)
parent4d2bcbc5837a7d99dc541595ca8087c335242af0 (diff)
downloadvolse-hubzilla-5.2.tar.gz
volse-hubzilla-5.2.tar.bz2
volse-hubzilla-5.2.zip
Merge branch '5.2RC'5.2
Diffstat (limited to 'include/contact_widgets.php')
-rw-r--r--include/contact_widgets.php36
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) {