aboutsummaryrefslogtreecommitdiffstats
path: root/include/contact_widgets.php
diff options
context:
space:
mode:
authorFabio Comuni <fabrix.xm@gmail.com>2012-01-06 09:11:48 +0100
committerFabio Comuni <fabrix.xm@gmail.com>2012-01-06 09:11:48 +0100
commitf9b0af6f2f0c57481a0b5b3dc269b2389f3fa872 (patch)
treef06c87479be60f3c601cbeed6088e6e74d97785c /include/contact_widgets.php
parentefe308b5ac9ac7e8d399fb880f31b6967de8fec1 (diff)
parentc3ada095f4156bba01e77d2d250d5821ba5e859e (diff)
downloadvolse-hubzilla-f9b0af6f2f0c57481a0b5b3dc269b2389f3fa872.tar.gz
volse-hubzilla-f9b0af6f2f0c57481a0b5b3dc269b2389f3fa872.tar.bz2
volse-hubzilla-f9b0af6f2f0c57481a0b5b3dc269b2389f3fa872.zip
Merge remote-tracking branch 'friendica/master'
Diffstat (limited to 'include/contact_widgets.php')
-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,
+
+ ));
+}
+
+