aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-09-25 22:14:40 -0700
committerFriendika <info@friendika.com>2011-09-25 22:14:40 -0700
commit20d4fda22f26a99e7da930be639874f80ae7060d (patch)
treed7316e23c8d846e41e232fe6e5e5db025d8548fc /mod
parentc35342dcb6498fa16b3367f524e603806b1e7aa4 (diff)
parentc05178c10529abd402bc48bdc9bd97aaccdebfa6 (diff)
downloadvolse-hubzilla-20d4fda22f26a99e7da930be639874f80ae7060d.tar.gz
volse-hubzilla-20d4fda22f26a99e7da930be639874f80ae7060d.tar.bz2
volse-hubzilla-20d4fda22f26a99e7da930be639874f80ae7060d.zip
Merge branch 'pull'
Diffstat (limited to 'mod')
-rw-r--r--mod/contacts.php23
-rw-r--r--mod/group.php5
-rw-r--r--mod/network.php136
-rw-r--r--mod/photos.php11
-rw-r--r--mod/search.php5
5 files changed, 111 insertions, 69 deletions
diff --git a/mod/contacts.php b/mod/contacts.php
index 307e9b15b..6dda546d3 100644
--- a/mod/contacts.php
+++ b/mod/contacts.php
@@ -23,8 +23,6 @@ function contacts_init(&$a) {
$a->page['aside'] = '';
$a->page['aside'] .= group_side('contacts','group',false,0,$contact_id);
- $inv = '<div class="side-link" id="side-invite-link" ><a href="invite" >' . t("Invite Friends") . '</a></div>';
-
if(get_config('system','invitation_only')) {
$x = get_pconfig(local_user(),'system','invites_remaining');
if($x || is_site_admin()) {
@@ -33,21 +31,26 @@ function contacts_init(&$a) {
. '</div>' . $inv;
}
}
- elseif($a->config['register_policy'] != REGISTER_CLOSED)
- $a->page['aside'] .= $inv;
-
-
- $a->page['aside'] .= '<div class="side-link" id="side-match-link"><a href="match" >'
- . t('Find People With Shared Interests') . '</a></div>';
$tpl = get_markup_template('follow.tpl');
+
+ $findSimilarLink = '<div class="side-link" id="side-match-link"><a href="match" >'
+ . t('Similar Interests') . '</a></div>';
+
+ $inv = '';
+ if($a->config['register_policy'] != REGISTER_CLOSED) {
+ $inv = '<div class="side-link" id="side-invite-link" ><a href="invite" >' . t("Invite Friends") . '</a></div>';
+ }
+
$a->page['aside'] .= replace_macros($tpl,array(
'$label' => t('Connect/Follow'),
'$hint' => t('Example: bob@example.com, http://example.com/barbara'),
- '$follow' => t('Follow')
+ '$follow' => t('Follow'),
+ '$findSimilar' => $findSimilarLink,
+ '$inviteFriends' => $inv
));
-
+
}
diff --git a/mod/group.php b/mod/group.php
index 981796f67..ca163902c 100644
--- a/mod/group.php
+++ b/mod/group.php
@@ -176,8 +176,8 @@ function group_content(&$a) {
if($change)
$o = '';
- $o .= '<div id="group-members">';
$o .= '<h3>' . t('Members') . '</h3>';
+ $o .= '<div id="group-members">';
$textmode = (($switchtotext && (count($members) > $switchtotext)) ? true : false);
foreach($members as $member) {
if($member['url']) {
@@ -190,9 +190,10 @@ function group_content(&$a) {
$o .= '</div><div id="group-members-end"></div>';
$o .= '<hr id="group-separator" />';
+
+ $o .= '<h3>' . t('All Contacts') . '</h3>';
$o .= '<div id="group-all-contacts">';
- $o .= '<h3>' . t('All Contacts') . '</h3>';
$r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `blocked` = 0 and `pending` = 0 and `self` = 0 ORDER BY `name` ASC",
intval(local_user())
);
diff --git a/mod/network.php b/mod/network.php
index 63d344db3..739dcf0d3 100644
--- a/mod/network.php
+++ b/mod/network.php
@@ -17,12 +17,12 @@ function network_init(&$a) {
// We need a better way of managing a growing argument list
- $srchurl = '/network'
- . ((x($_GET,'cid')) ? '?cid=' . $_GET['cid'] : '')
- . ((x($_GET,'star')) ? '?star=' . $_GET['star'] : '')
- . ((x($_GET,'order')) ? '?order=' . $_GET['order'] : '')
- . ((x($_GET,'bmark')) ? '?bmark=' . $_GET['bmark'] : '');
-
+ // moved into savedsearches()
+ // $srchurl = '/network'
+ // . ((x($_GET,'cid')) ? '?cid=' . $_GET['cid'] : '')
+ // . ((x($_GET,'star')) ? '?star=' . $_GET['star'] : '')
+ // . ((x($_GET,'bmark')) ? '?bmark=' . $_GET['bmark'] : '');
+
if(x($_GET,'save')) {
$r = q("select * from `search` where `uid` = %d and `term` = '%s' limit 1",
intval(local_user()),
@@ -42,76 +42,110 @@ function network_init(&$a) {
);
}
- $a->page['aside'] .= search($search,'netsearch-box',$srchurl,true);
-
- $a->page['aside'] .= '<div id="network-new-link">';
-
-
- $a->page['aside'] .= '<div id="network-view-link">';
- if(($a->argc > 1 && $a->argv[1] === 'new') || ($a->argc > 2 && $a->argv[2] === 'new') || x($_GET,'search')) {
- $a->page['aside'] .= '<a href="' . $a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '?cid=' . $_GET['cid'] : '') . '">' . t('View Conversations') . '</a></div>';
+ // item filter tabs
+ // TODO: fix this logic, reduce duplication
+ $a->page['content'] .= '<div class="tabs-wrapper">';
+
+ $starred_active = '';
+ $new_active = '';
+ $bookmarked_active = '';
+ $all_active = '';
+ $search_active = '';
+
+ if(($a->argc > 1 && $a->argv[1] === 'new')
+ || ($a->argc > 2 && $a->argv[2] === 'new')) {
+ $new_active = 'active';
}
- else {
- $a->page['aside'] .= '<a href="' . $a->get_baseurl() . '/' . $a->cmd . '/new' . ((x($_GET,'cid')) ? '/?cid=' . $_GET['cid'] : '') . '">' . t('View New Items') . '</a></div>';
-
- if(x($_GET,'star'))
- $a->page['aside'] .= '<div id="network-star-link">'
- . '<a class="network-star" href="' . $a->get_baseurl() . '/' . $a->cmd
- . ((x($_GET,'cid')) ? '/?cid=' . $_GET['cid'] : '') . '">'
- . t('View Any Items') . '</a>'
- . '<span class="network-star icon starred"></span>'
- . '<span class="network-star icon unstarred"></span>'
- . '<div class="clear"></div></div>';
- else
- $a->page['aside'] .= '<div id="network-star-link">'
- . '<a class="network-star" href="' . $a->get_baseurl() . '/' . $a->cmd
- . ((x($_GET,'cid')) ? '/?cid=' . $_GET['cid'] : '') . '&star=1" >'
- . t('View Starred Items') . '</a>'
- . '<span class="network-star icon starred"></span>'
- . '<div class="clear"></div></div>';
-
- if(! $_GET['bmark'])
- $a->page['aside'] .= '<div id="network-bmark-link">'
- . '<a class="network-bmark" href="' . $a->get_baseurl() . '/' . $a->cmd
- . ((x($_GET,'cid')) ? '/?cid=' . $_GET['cid'] : '') . '&bmark=1" >'
- . t('View Bookmarks') . '</a>'
- . '<div class="clear"></div></div>';
-
-
+
+ if(x($_GET,'search')) {
+ $search_active = 'active';
}
-
- $a->page['aside'] .= '</div>';
-
+
+ if(x($_GET,'star')) {
+ $starred_active = 'active';
+ }
+
+ if($_GET['bmark']) {
+ $bookmarked_active = 'active';
+ }
+
+ if (($new_active == '')
+ && ($starred_active == '')
+ && ($bookmarked_active == '')
+ && ($search_active == '')) {
+ $all_active = 'active';
+ }
+
+ // network links moved to content to match other pages
+ // all
+ $a->page['content'] .= '<a class="tabs ' . $all_active . '" href="' . $a->get_baseurl() . '/'
+ . str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '?cid=' . $_GET['cid'] : '') . '">'
+ . t('All') . '</a>';
+
+ // new
+ $a->page['content'] .= '<a class="tabs ' . $new_active . '" href="' . $a->get_baseurl() . '/'
+ . str_replace('/new', '', $a->cmd) . '/new'
+ . ((x($_GET,'cid')) ? '/?cid=' . $_GET['cid'] : '') . '">'
+ . t('New') . '</a>';
+
+ // starred
+ $a->page['content'] .= '<a class="tabs ' . $starred_active . '" href="' . $a->get_baseurl() . '/'
+ . str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '/?cid=' . $_GET['cid'] : '') . '&star=1" >'
+ . t('Starred') . '</a>';
+
+ // bookmarks
+ $a->page['content'] .= '<a class="tabs ' . $bookmarked_active . '" href="' . $a->get_baseurl() . '/'
+ . str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '/?cid=' . $_GET['cid'] : '') . '&bmark=1" >'
+ . t('Bookmarks') . '</a>';
+
+ $a->page['content'] .= '</div>';
+ // --- end item filter tabs
+
+ // search terms header
+ if(x($_GET,'search')) {
+ $a->page['content'] .= '<h2>Search Results For: ' . $search . '</h2>';
+ }
+
$a->page['aside'] .= group_side('network','network',true,$group_id);
+
+ // moved to saved searches to have it in the same div
+ //$a->page['aside'] .= search($search,'netsearch-box',$srchurl,true);
- $a->page['aside'] .= saved_searches();
+ $a->page['aside'] .= saved_searches($search);
}
-function saved_searches() {
+function saved_searches($search) {
+ $srchurl = '/network'
+ . ((x($_GET,'cid')) ? '?cid=' . $_GET['cid'] : '')
+ . ((x($_GET,'star')) ? '?star=' . $_GET['star'] : '')
+ . ((x($_GET,'bmark')) ? '?bmark=' . $_GET['bmark'] : '');
+
$o = '';
$r = q("select `term` from `search` WHERE `uid` = %d",
intval(local_user())
);
+ $o .= '<div id="saved-search-list" class="widget">';
+ $o .= '<h3 id="search">' . t('Saved Searches') . '</h3>' . "\r\n";
+ $o .= search($search,'netsearch-box',$srchurl,true);
+
if(count($r)) {
- $o .= '<h3>' . t('Saved Searches') . '</h3>' . "\r\n";
- $o .= '<div id="saved-search-list"><ul id="saved-search-ul">' . "\r\n";
+ $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=' . $rr['term'] . '" class="savedsearchterm" >' . $rr['term'] . '</a></li>' . "\r\n";
}
- $o .= '</ul></div>' . "\r\n";
+ $o .= '</ul>';
}
+ $o .= '</div>' . "\r\n";
return $o;
}
-
-
function network_content(&$a, $update = 0) {
require_once('include/conversation.php');
diff --git a/mod/photos.php b/mod/photos.php
index 7141919b0..cb7df15cc 100644
--- a/mod/photos.php
+++ b/mod/photos.php
@@ -33,11 +33,14 @@ function photos_init(&$a) {
if(count($albums)) {
$a->data['albums'] = $albums;
- $o .= '<h4><a href="' . $a->get_baseurl() . '/profile/' . $a->data['user']['nickname'] . '">' . $a->data['user']['username'] . '</a></h4>';
+ $o .= '<div class="vcard">';
+ $o .= '<div class="fn">' . $a->data['user']['username'] . '</h4>';
$o .= '<div id="profile-photo-wrapper"><img class="photo" style="width: 175px; height: 175px;" src="' . $a->get_baseurl() . '/photo/profile/' . $a->data['user']['uid'] . '.jpg" alt="' . $a->data['user']['username'] . '" /></div>';
-
- $o .= '<h4>' . '<a href="' . $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '">' . t('Photo Albums') . '</a></h4>';
-
+ $o .= '</div>';
+
+ $o .= '<div id="side-bar-photos-albums" class="widget">';
+ $o .= '<h3>' . '<a href="' . $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '">' . t('Photo Albums') . '</a></h4>';
+
$o .= '<ul>';
foreach($albums as $album) {
diff --git a/mod/search.php b/mod/search.php
index d150b2e1e..2ce3c8dcd 100644
--- a/mod/search.php
+++ b/mod/search.php
@@ -9,8 +9,9 @@ function search_saved_searches() {
);
if(count($r)) {
+ $o .= '<div id="saved-search-list" class="widget">';
$o .= '<h3>' . t('Saved Searches') . '</h3>' . "\r\n";
- $o .= '<div id="saved-search-list"><ul id="saved-search-ul">' . "\r\n";
+ $o .= '<ul id="saved-search-ul">' . "\r\n";
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";
}
@@ -140,7 +141,7 @@ function search_content(&$a) {
);
-
+ $o .= '<h2>Search results for: ' . $search . '</h2>';
$o .= conversation($a,$r,'search',false);