diff options
author | friendica <info@friendica.com> | 2013-12-10 00:05:31 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2013-12-10 00:05:31 -0800 |
commit | e873f6e95ed167e48a557365089ec97abee473cc (patch) | |
tree | 0fce400cedb80748d1df0215e1492ace95c9e182 /include | |
parent | ed9f10872240231125007cf32b95007281558cac (diff) | |
download | volse-hubzilla-e873f6e95ed167e48a557365089ec97abee473cc.tar.gz volse-hubzilla-e873f6e95ed167e48a557365089ec97abee473cc.tar.bz2 volse-hubzilla-e873f6e95ed167e48a557365089ec97abee473cc.zip |
we're almost ready to turn on comanche for mod_network. All the widgets are done.
Diffstat (limited to 'include')
-rw-r--r-- | include/widgets.php | 67 |
1 files changed, 66 insertions, 1 deletions
diff --git a/include/widgets.php b/include/widgets.php index e64920cdc..e0fc94e18 100644 --- a/include/widgets.php +++ b/include/widgets.php @@ -231,7 +231,72 @@ function widget_savedsearch($arr) { '$searchbox' => searchbox('','netsearch-box',$srchurl . (($hasq) ? '' : '?f='),true), '$saved' => $saved, )); - + return $o; } + + +function widget_filer($arr) { + if(! local_user()) + return ''; + + $a = get_app(); + + $selected = ((x($_REQUEST,'file')) ? $_REQUEST['file'] : ''); + + $terms = array(); + $r = q("select distinct(term) from term where uid = %d and type = %d order by term asc", + intval(local_user()), + 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() . '/' . $a->cmd + + )); +} + +function widget_archive($arr) { + + $o = ''; + $a = get_app(); + + if(! $a->profile_uid) { + return ''; + } + + $uid = $a->profile_uid; + + if(! feature_enabled($uid,'archives')) + return ''; + + + $wall = ((array_key_exists('wall', $arr)) ? intval($arr['wall']) : 0); + $url = z_root() . '/' . $a->cmd; + + $ret = posted_dates($uid,$wall); + + if(! count($ret)) + return ''; + + $o = replace_macros(get_markup_template('posted_date_widget.tpl'),array( + '$title' => t('Archives'), + '$size' => ((count($ret) > 6) ? 6 : count($ret)), + '$url' => $url, + '$dates' => $ret + )); + return $o; +} + + |