aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-10-11 19:27:58 -0700
committerFriendika <info@friendika.com>2011-10-11 19:27:58 -0700
commit2206d894b3fec7064b91e0420bcc2b16e9e7009b (patch)
treedff69c246dbba923a76e68404e2c012acbb29c07 /mod
parent557a7d0cec31a36d12898429c479c71671833dfd (diff)
downloadvolse-hubzilla-2206d894b3fec7064b91e0420bcc2b16e9e7009b.tar.gz
volse-hubzilla-2206d894b3fec7064b91e0420bcc2b16e9e7009b.tar.bz2
volse-hubzilla-2206d894b3fec7064b91e0420bcc2b16e9e7009b.zip
add contact_widgets and provide widgets on appropriate pages, fix the saved search widget
fix directory page on testbubble, don't use system theme for community, directory, and search if the viewer is logged in.
Diffstat (limited to 'mod')
-rw-r--r--mod/community.php10
-rw-r--r--mod/contacts.php36
-rw-r--r--mod/directory.php16
-rw-r--r--mod/dirfind.php13
-rw-r--r--mod/network.php4
-rw-r--r--mod/search.php10
6 files changed, 45 insertions, 44 deletions
diff --git a/mod/community.php b/mod/community.php
index cb255029f..34c992bad 100644
--- a/mod/community.php
+++ b/mod/community.php
@@ -1,5 +1,12 @@
<?php
+function community_init(&$a) {
+ if(! local_user())
+ unset($_SESSION['theme']);
+
+
+}
+
function community_content(&$a, $update = 0) {
@@ -19,9 +26,6 @@ function community_content(&$a, $update = 0) {
require_once('include/security.php');
require_once('include/conversation.php');
- if(x($_SESSION,'theme'))
- unset($_SESSION['theme']);
-
$o .= '<h3>' . t('Community') . '</h3>';
if(! $update) {
diff --git a/mod/contacts.php b/mod/contacts.php
index d24873b8f..9bbcea07d 100644
--- a/mod/contacts.php
+++ b/mod/contacts.php
@@ -19,44 +19,16 @@ function contacts_init(&$a) {
}
require_once('include/group.php');
+ require_once('include/contact_widgets.php');
+
if(! x($a->page,'aside'))
$a->page['aside'] = '';
- $a->page['aside'] .= replace_macros(get_markup_template('follow.tpl'),array(
- '$connect' => t('Add New Contact'),
- '$desc' => t('Enter address or web location'),
- '$hint' => t('Example: bob@example.com, http://example.com/barbara'),
- '$follow' => t('Connect')
- ));
-
-
+ $a->page['aside'] .= follow_widget();
$a->page['aside'] .= group_side('contacts','group',false,0,$contact_id);
- if(get_config('system','invitation_only')) {
- $x = get_pconfig(local_user(),'system','invites_remaining');
- if($x || is_site_admin()) {
- $a->page['aside'] .= '<div class="side-link" id="side-invite-remain">'
- . sprintf( tt('%d invitation available','%d invitations available',$x), $x)
- . '</div>' . $inv;
- }
- }
-
- $tpl = get_markup_template('peoplefind.tpl');
-
- $inv = (($a->config['register_policy'] != REGISTER_CLOSED) ? t('Invite Friends') : '');
-
- $a->page['aside'] .= replace_macros($tpl,array(
- '$findpeople' => t('Find People'),
- '$desc' => t('Enter name or interest'),
- '$label' => t('Connect/Follow'),
- '$hint' => t('Examples: Robert Morgenstein, Fishing'),
- '$findthem' => t('Find'),
- '$similar' => t('Similar Interests'),
- '$inv' => $inv
- ));
-
-
+ $a->page['aside'] .= findpeople_widget();
}
diff --git a/mod/directory.php b/mod/directory.php
index 93abcd5de..5f00b4f5a 100644
--- a/mod/directory.php
+++ b/mod/directory.php
@@ -2,6 +2,17 @@
function directory_init(&$a) {
$a->set_pager_itemspage(60);
+
+ if(local_user()) {
+ require_once('include/contact_widgets.php');
+
+ $a->page['aside'] .= findpeople_widget();
+
+ }
+ else
+ unset($_SESSION['theme']);
+
+
}
@@ -23,8 +34,6 @@ function directory_content(&$a) {
$o = '';
nav_set_selected('directory');
- if(x($_SESSION,'theme'))
- unset($_SESSION['theme']);
if(x($a->data,'search'))
$search = notags(trim($a->data['search']));
@@ -45,12 +54,13 @@ function directory_content(&$a) {
if($everything)
$admin = '<ul><li><div id="directory-admin-link"><a href="' . $a->get_baseurl() . '/directory' . '">' . t('Normal site view') . '</a></div></li></ul>';
else
- $admin = '<ul><li><div id="directory-admin-link"><a href="' . $a->get_baseurl() . '/directory/all' . '">' . t('View all site entries') . '</a></div></li></ul>';
+ $admin = '<ul><li><div id="directory-admin-link"><a href="' . $a->get_baseurl() . '/directory/all' . '">' . t('Admin - View all site entries') . '</a></div></li></ul>';
}
$o .= replace_macros($tpl, array(
'$search' => $search,
'$globaldir' => $globaldir,
+ '$desc' => t('Find on this site'),
'$admin' => $admin,
'$finding' => (strlen($search) ? '<h4>' . t('Finding: ') . "'" . $search . "'" . '</h4>' : ""),
'$sitedir' => t('Site Directory'),
diff --git a/mod/dirfind.php b/mod/dirfind.php
index 2d8479043..801018276 100644
--- a/mod/dirfind.php
+++ b/mod/dirfind.php
@@ -1,5 +1,18 @@
<?php
+function dirfind_init(&$a) {
+
+ require_once('include/contact_widgets.php');
+
+ if(! x($a->page,'aside'))
+ $a->page['aside'] = '';
+
+ $a->page['aside'] .= follow_widget();
+
+ $a->page['aside'] .= findpeople_widget();
+}
+
+
function dirfind_content(&$a) {
diff --git a/mod/network.php b/mod/network.php
index 9b7c4e611..5aa39bf63 100644
--- a/mod/network.php
+++ b/mod/network.php
@@ -78,11 +78,13 @@ function saved_searches($search) {
if(count($r)) {
$o .= '<ul id="saved-search-ul">' . "\r\n";
foreach($r as $rr) {
- $o .= '<li class="saved-search-li clear"><a href="network/?f=&remove=1&search=' . $rr['term'] . '" class="icon drophide savedsearchdrop" title="' . t('Remove term') . '" onclick="return confirmDelete();" onmouseover="imgbright(this);" onmouseout="imgdull(this);" ></a> <a href="network/?f&search=' . urlencode($rr['term']) . '" class="savedsearchterm" >' . $rr['term'] . '</a></li>' . "\r\n";
+ $o .= '<li class="saved-search-li clear"><a href="network/?f=&remove=1&search=' . $rr['term'] . '" class="icon drophide savedsearchdrop" title="' . t('Remove term') . '" onclick="return confirmDelete();" onmouseover="imgbright(this);" onmouseout="imgdull(this);" ></a> <a href="network/?f=&search=' . urlencode($rr['term']) . '" class="savedsearchterm" >' . $rr['term'] . '</a></li>' . "\r\n";
}
$o .= '</ul>';
}
+ $o .= '<div class="clear"></div>';
+
$o .= '</div>' . "\r\n";
return $o;
diff --git a/mod/search.php b/mod/search.php
index 034794e17..2a8bf1484 100644
--- a/mod/search.php
+++ b/mod/search.php
@@ -15,7 +15,7 @@ function search_saved_searches() {
foreach($r as $rr) {
$o .= '<li class="saved-search-li clear"><a href="search/?f=&remove=1&search=' . $rr['term'] . '" class="icon drophide savedsearchdrop" title="' . t('Remove term') . '" onclick="return confirmDelete();" onmouseover="imgbright(this);" onmouseout="imgdull(this);" ></a> <a href="search/?f=&search=' . $rr['term'] . '" class="savedsearchterm" >' . $rr['term'] . '</a></li>' . "\r\n";
}
- $o .= '</ul></div>' . "\r\n";
+ $o .= '</ul><div class="clear"></div></div>' . "\r\n";
}
return $o;
@@ -50,6 +50,9 @@ function search_init(&$a) {
$a->page['aside'] .= search_saved_searches();
}
+ else
+ unset($_SESSION['theme']);
+
}
@@ -75,12 +78,9 @@ function search_content(&$a) {
require_once('include/security.php');
require_once('include/conversation.php');
- if(x($_SESSION,'theme'))
- unset($_SESSION['theme']);
-
$o = '<div id="live-search"></div>' . "\r\n";
- $o .= '<h3>' . t('Search') . '</h3>';
+ $o .= '<h3>' . t('Search This Site') . '</h3>';
if(x($a->data,'search'))
$search = notags(trim($a->data['search']));