diff options
author | Simon L'nu <simon.lnu@gmail.com> | 2012-04-01 23:56:13 -0400 |
---|---|---|
committer | Simon L'nu <simon.lnu@gmail.com> | 2012-04-01 23:56:13 -0400 |
commit | 5eca42975cdf3fc0e5be2dfdb05ded9d19ed5b7c (patch) | |
tree | 5ce33b1595a2dd7d94e43ca9d2efc7be8facc94b /include/contact_widgets.php | |
parent | 9472ba8d2031183cc9d573f27e02511c1c5a3050 (diff) | |
parent | 5d35f0d54a52801dd9a17d4e44c294e4c9168de3 (diff) | |
download | volse-hubzilla-5eca42975cdf3fc0e5be2dfdb05ded9d19ed5b7c.tar.gz volse-hubzilla-5eca42975cdf3fc0e5be2dfdb05ded9d19ed5b7c.tar.bz2 volse-hubzilla-5eca42975cdf3fc0e5be2dfdb05ded9d19ed5b7c.zip |
Merge branch 'master', remote-tracking branch 'remotes/upstream/master'
* remotes/upstream/master:
add title to D* posts
allow users to set categories on their posts
Modified peopleyouknow to handle sites without Facebook better
diabook-themes: add link to global dir in "find friends" at right_aside
modified: mod/newmember.php
New user quick start.
check for style.php existence before inclusion
Moved Diaspora notes away from top, per user request
* 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, + + )); +} + |