aboutsummaryrefslogtreecommitdiffstats
path: root/mod/network.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-10-10 12:56:51 -0700
committerFriendika <info@friendika.com>2011-10-10 12:56:51 -0700
commitcaf18164f0f7bd336e61d4393dabf6d93c739879 (patch)
tree15053927bc3605fb52af6e51d84cf055b93341b7 /mod/network.php
parent06c268b3db815d56a92bfabd8df297f5e4331689 (diff)
parent2ea2e7f4b4a1f890cfcba95e92bf81a273042196 (diff)
downloadvolse-hubzilla-caf18164f0f7bd336e61d4393dabf6d93c739879.tar.gz
volse-hubzilla-caf18164f0f7bd336e61d4393dabf6d93c739879.tar.bz2
volse-hubzilla-caf18164f0f7bd336e61d4393dabf6d93c739879.zip
Merge branch 'pull'
Diffstat (limited to 'mod/network.php')
-rw-r--r--mod/network.php126
1 files changed, 66 insertions, 60 deletions
diff --git a/mod/network.php b/mod/network.php
index f0e9e4441..9b7c4e611 100644
--- a/mod/network.php
+++ b/mod/network.php
@@ -42,66 +42,7 @@ function network_init(&$a) {
);
}
- // 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';
- }
-
- if(x($_GET,'search')) {
- $search_active = 'active';
- }
-
- 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
- // added 'button' class for easier styling - not the best place for it, should be moved into the tpl like profile_tabs.tpl
- // once there is a network_tabs.tpl or something
- $a->page['content'] .= '<a class="button 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="button 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="button 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="button 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')) {
@@ -157,6 +98,71 @@ function network_content(&$a, $update = 0) {
$o = '';
+ // 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';
+ }
+
+ if(x($_GET,'search')) {
+ $search_active = 'active';
+ }
+
+ 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';
+ }
+
+ // tabs
+ $tabs = array(
+ array(
+ 'label' => t('All'),
+ 'url'=>$a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '?cid=' . $_GET['cid'] : ''),
+ 'sel'=>$all_active,
+ ),
+ array(
+ 'label' => t('New'),
+ 'url' => $a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . '/new' . ((x($_GET,'cid')) ? '/?cid=' . $_GET['cid'] : ''),
+ 'sel' => $new_active,
+ ),
+ array(
+ 'label' => t('Starred'),
+ 'url'=>$a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '/?cid=' . $_GET['cid'] : '') . '&star=1',
+ 'sel'=>$starred_active,
+ ),
+ array(
+ 'label' => t('Bookmarks'),
+ 'url'=>$a->get_baseurl() . '/' . str_replace('/new', '', $a->cmd) . ((x($_GET,'cid')) ? '/?cid=' . $_GET['cid'] : '') . '&bmark=1',
+ 'sel'=>$bookmarked_active,
+ ),
+ );
+ $tpl = get_markup_template('common_tabs.tpl');
+ $o .= replace_macros($tpl, array('$tabs'=>$tabs));
+ // --- end item filter tabs
+
+
+
+
+
$contact_id = $a->cid;
$group = 0;