aboutsummaryrefslogtreecommitdiffstats
path: root/include/contact_widgets.php
diff options
context:
space:
mode:
authorAlexander Kampmann <programmer@nurfuerspam.de>2012-04-05 13:39:15 +0200
committerAlexander Kampmann <programmer@nurfuerspam.de>2012-04-05 13:39:15 +0200
commit355c42cb309eb1313097411067ca999b699aa620 (patch)
treed00d1af9dceecdf114cadff924c5ba4a864fbf43 /include/contact_widgets.php
parentcbf4544887c7f496f2b2312727fe7bcb64a6d6c8 (diff)
parent9b6e91086b29554fd04362f6c87ea148718e8b1c (diff)
downloadvolse-hubzilla-355c42cb309eb1313097411067ca999b699aa620.tar.gz
volse-hubzilla-355c42cb309eb1313097411067ca999b699aa620.tar.bz2
volse-hubzilla-355c42cb309eb1313097411067ca999b699aa620.zip
Merge branch 'master' of https://github.com/friendica/friendica
Conflicts: include/config.php update.php
Diffstat (limited to 'include/contact_widgets.php')
-rw-r--r--[-rwxr-xr-x]include/contact_widgets.php38
1 files changed, 32 insertions, 6 deletions
diff --git a/include/contact_widgets.php b/include/contact_widgets.php
index 605a3eb78..e0f37f078 100755..100644
--- a/include/contact_widgets.php
+++ b/include/contact_widgets.php
@@ -15,8 +15,6 @@ function findpeople_widget() {
$a = get_app();
- $inv = (($a->config['register_policy'] != REGISTER_CLOSED) ? t('Invite Friends') : '');
-
if(get_config('system','invitation_only')) {
$x = get_pconfig(local_user(),'system','invites_remaining');
if($x || is_site_admin()) {
@@ -34,7 +32,7 @@ function findpeople_widget() {
'$findthem' => t('Find'),
'$suggest' => t('Friend Suggestions'),
'$similar' => t('Similar Interests'),
- '$inv' => $inv
+ '$inv' => t('Invite Friends')
));
}
@@ -48,7 +46,7 @@ function networks_widget($baseurl,$selected = '') {
return '';
- $r = q("select distinct(network) from contact where uid = %d",
+ $r = q("select distinct(network) from contact where uid = %d and self = 0",
intval(local_user())
);
@@ -89,13 +87,41 @@ function fileas_widget($baseurl,$selected = '') {
$cnt = preg_match_all('/\[(.*?)\]/',$saved,$matches,PREG_SET_ORDER);
if($cnt) {
foreach($matches as $mtch) {
- $unescaped = file_tag_decode($mtch[1]);
+ $unescaped = xmlify(file_tag_decode($mtch[1]));
$terms[] = array('name' => $unescaped,'selected' => (($selected == $unescaped) ? 'selected' : ''));
}
}
return replace_macros(get_markup_template('fileas_widget.tpl'),array(
- '$title' => t('File Selections'),
+ '$title' => t('Saved Folders'),
+ '$desc' => '',
+ '$sel_all' => (($selected == '') ? 'selected' : ''),
+ '$all' => t('Everything'),
+ '$terms' => $terms,
+ '$base' => $baseurl,
+
+ ));
+}
+
+function categories_widget($baseurl,$selected = '') {
+ $a = get_app();
+
+ $saved = get_pconfig($a->profile['profile_uid'],'system','filetags');
+ if(! strlen($saved))
+ return;
+
+ $matches = false;
+ $terms = array();
+ $cnt = preg_match_all('/<(.*?)>/',$saved,$matches,PREG_SET_ORDER);
+ if($cnt) {
+ foreach($matches as $mtch) {
+ $unescaped = xmlify(file_tag_decode($mtch[1]));
+ $terms[] = array('name' => $unescaped,'selected' => (($selected == $unescaped) ? 'selected' : ''));
+ }
+ }
+
+ return replace_macros(get_markup_template('categories_widget.tpl'),array(
+ '$title' => t('Categories'),
'$desc' => '',
'$sel_all' => (($selected == '') ? 'selected' : ''),
'$all' => t('Everything'),