diff options
author | Michael Vogel <icarus@dabo.de> | 2012-04-02 22:00:22 +0200 |
---|---|---|
committer | Michael Vogel <icarus@dabo.de> | 2012-04-02 22:00:22 +0200 |
commit | 3dc317dcc62c8e982d964bcae421a1410771d51c (patch) | |
tree | 6e63f4e263a6637656ed24dfb5c36292d442c268 /include/contact_widgets.php | |
parent | a39d8d3f02e5bbd711fde71594c2c787b21ef2e9 (diff) | |
parent | 6dfd55668f39d2cfb27d468cc982471abaad5165 (diff) | |
download | volse-hubzilla-3dc317dcc62c8e982d964bcae421a1410771d51c.tar.gz volse-hubzilla-3dc317dcc62c8e982d964bcae421a1410771d51c.tar.bz2 volse-hubzilla-3dc317dcc62c8e982d964bcae421a1410771d51c.zip |
Merge commit 'upstream/master'
Diffstat (limited to 'include/contact_widgets.php')
-rwxr-xr-x | include/contact_widgets.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/include/contact_widgets.php b/include/contact_widgets.php index 7346b95af..e0f37f078 100755 --- a/include/contact_widgets.php +++ b/include/contact_widgets.php @@ -103,3 +103,31 @@ function fileas_widget($baseurl,$selected = '') { )); } +function categories_widget($baseurl,$selected = '') { + $a = get_app(); + + $saved = get_pconfig($a->profile['profile_uid'],'system','filetags'); + if(! strlen($saved)) + return; + + $matches = false; + $terms = array(); + $cnt = preg_match_all('/<(.*?)>/',$saved,$matches,PREG_SET_ORDER); + if($cnt) { + foreach($matches as $mtch) { + $unescaped = xmlify(file_tag_decode($mtch[1])); + $terms[] = array('name' => $unescaped,'selected' => (($selected == $unescaped) ? '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, + + )); +} + |