aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-01-05 20:40:48 -0800
committerfriendica <info@friendica.com>2012-01-05 20:40:48 -0800
commitc3ada095f4156bba01e77d2d250d5821ba5e859e (patch)
treef03f9d9d7c03f159c17ba41db3701e3213529dee /include
parent291a82c4a465c6c3b1db7087682cb050d1943a08 (diff)
downloadvolse-hubzilla-c3ada095f4156bba01e77d2d250d5821ba5e859e.tar.gz
volse-hubzilla-c3ada095f4156bba01e77d2d250d5821ba5e859e.tar.bz2
volse-hubzilla-c3ada095f4156bba01e77d2d250d5821ba5e859e.zip
network select widget
Diffstat (limited to 'include')
-rw-r--r--include/contact_widgets.php33
1 files changed, 33 insertions, 0 deletions
diff --git a/include/contact_widgets.php b/include/contact_widgets.php
index 3a21ff2c6..424f2997e 100644
--- a/include/contact_widgets.php
+++ b/include/contact_widgets.php
@@ -40,3 +40,36 @@ function findpeople_widget() {
}
+function networks_widget($baseurl,$selected = '') {
+
+ $a = get_app();
+
+ if(! local_user())
+ return '';
+
+
+ $r = q("select distinct(network) from contact where uid = %d",
+ intval(local_user())
+ );
+
+ $nets = array();
+ if(count($r)) {
+ require_once('include/contact_selectors.php');
+ foreach($r as $rr) {
+ if($rr['network'])
+ $nets[] = array('ref' => $rr['network'], 'name' => network_to_name($rr['network']), 'selected' => (($selected == $rr['network']) ? 'selected' : '' ));
+ }
+ }
+
+ return replace_macros(get_markup_template('nets.tpl'),array(
+ '$title' => t('Networks'),
+ '$desc' => '',
+ '$sel_all' => (($selected == '') ? 'selected' : ''),
+ '$all' => t('All Networks'),
+ '$nets' => $nets,
+ '$base' => $baseurl,
+
+ ));
+}
+
+