]> git.mxchange.org Git - friendica.git/blobdiff - include/contact_widgets.php
modularise successful authentication
[friendica.git] / include / contact_widgets.php
index efb833aafcb5cabc6e8f26ac5a152c305cc2eefe..caa0572d20f79aff5a3bf2deb669364836ac10cb 100644 (file)
@@ -32,9 +32,47 @@ function findpeople_widget() {
                '$label' => t('Connect/Follow'),
                '$hint' => t('Examples: Robert Morgenstein, Fishing'),
                '$findthem' => t('Find'),
+               '$suggest' => t('Friend Suggestions'),
                '$similar' => t('Similar Interests'),
                '$inv' => $inv
        ));
 
 }
 
+
+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' : '' ));
+               }
+       }
+
+       if(count($nets) < 2)
+               return '';
+
+       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,
+
+       ));
+}
+
+