aboutsummaryrefslogtreecommitdiffstats
path: root/include/contact_widgets.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-03-13 18:13:03 -0700
committerfriendica <info@friendica.com>2012-03-13 18:13:03 -0700
commitbe48fff1570aa1d04e049a6fd1665f4fc9634a62 (patch)
tree27b3a9afc78391ece8bfd2ce13ac74b77bc18898 /include/contact_widgets.php
parent8a789a33d1168359ae23300bc3169b37fb02facc (diff)
downloadvolse-hubzilla-be48fff1570aa1d04e049a6fd1665f4fc9634a62.tar.gz
volse-hubzilla-be48fff1570aa1d04e049a6fd1665f4fc9634a62.tar.bz2
volse-hubzilla-be48fff1570aa1d04e049a6fd1665f4fc9634a62.zip
file as widget and basic filing implementation for duepuntozero,slackr
much more work needed - this is just for test/evaluation currently
Diffstat (limited to 'include/contact_widgets.php')
-rwxr-xr-xinclude/contact_widgets.php29
1 files changed, 29 insertions, 0 deletions
diff --git a/include/contact_widgets.php b/include/contact_widgets.php
index caa0572d2..605a3eb78 100755
--- a/include/contact_widgets.php
+++ b/include/contact_widgets.php
@@ -75,4 +75,33 @@ function networks_widget($baseurl,$selected = '') {
));
}
+function fileas_widget($baseurl,$selected = '') {
+ $a = get_app();
+ if(! local_user())
+ return '';
+
+ $saved = get_pconfig(local_user(),'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 = file_tag_decode($mtch[1]);
+ $terms[] = array('name' => $unescaped,'selected' => (($selected == $unescaped) ? 'selected' : ''));
+ }
+ }
+
+ return replace_macros(get_markup_template('fileas_widget.tpl'),array(
+ '$title' => t('File Selections'),
+ '$desc' => '',
+ '$sel_all' => (($selected == '') ? 'selected' : ''),
+ '$all' => t('Everything'),
+ '$terms' => $terms,
+ '$base' => $baseurl,
+
+ ));
+}