aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Widget/Filer.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-03-15 19:30:57 -0700
committerzotlabs <mike@macgirvin.com>2017-03-15 19:30:57 -0700
commit92d7c32f61e8d8a72141629e73bb3bba38546278 (patch)
treeafc34ecb11114690aff4bdb4a6f27398d538c8c9 /Zotlabs/Widget/Filer.php
parent0ee48f6a58ae21b6c27b122206cfd6e366abed40 (diff)
downloadvolse-hubzilla-92d7c32f61e8d8a72141629e73bb3bba38546278.tar.gz
volse-hubzilla-92d7c32f61e8d8a72141629e73bb3bba38546278.tar.bz2
volse-hubzilla-92d7c32f61e8d8a72141629e73bb3bba38546278.zip
more widgets
Diffstat (limited to 'Zotlabs/Widget/Filer.php')
-rw-r--r--Zotlabs/Widget/Filer.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/Zotlabs/Widget/Filer.php b/Zotlabs/Widget/Filer.php
new file mode 100644
index 000000000..cb9a0becf
--- /dev/null
+++ b/Zotlabs/Widget/Filer.php
@@ -0,0 +1,35 @@
+<?php
+
+namespace Zotlabs\Widget;
+
+
+class Filer {
+
+ function widget($arr) {
+ if(! local_channel())
+ return '';
+
+
+ $selected = ((x($_REQUEST,'file')) ? $_REQUEST['file'] : '');
+
+ $terms = array();
+ $r = q("select distinct term from term where uid = %d and ttype = %d order by term asc",
+ intval(local_channel()),
+ intval(TERM_FILE)
+ );
+ if(! $r)
+ return;
+
+ foreach($r as $rr)
+ $terms[] = array('name' => $rr['term'], 'selected' => (($selected == $rr['term']) ? 'selected' : ''));
+
+ return replace_macros(get_markup_template('fileas_widget.tpl'),array(
+ '$title' => t('Saved Folders'),
+ '$desc' => '',
+ '$sel_all' => (($selected == '') ? 'selected' : ''),
+ '$all' => t('Everything'),
+ '$terms' => $terms,
+ '$base' => z_root() . '/' . \App::$cmd
+ ));
+ }
+}