X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fnetwork.php;h=5aa39bf638c2d63b6a56e944c2142a59dae08522;hb=df7702709b07560af1d469f0835586af317f39b0;hp=739dcf0d375653c7f4ecb1ef7f772199a37435fd;hpb=20d4fda22f26a99e7da930be639874f80ae7060d;p=friendica.git
diff --git a/mod/network.php b/mod/network.php
index 739dcf0d37..5aa39bf638 100644
--- a/mod/network.php
+++ b/mod/network.php
@@ -42,64 +42,7 @@ function network_init(&$a) {
);
}
- // item filter tabs
- // TODO: fix this logic, reduce duplication
- $a->page['content'] .= '
';
-
- $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
- $a->page['content'] .= '
'
- . t('All') . '';
-
- // new
- $a->page['content'] .= '
'
- . t('New') . '';
-
- // starred
- $a->page['content'] .= '
'
- . t('Starred') . '';
-
- // bookmarks
- $a->page['content'] .= '
'
- . t('Bookmarks') . '';
-
- $a->page['content'] .= '
';
- // --- end item filter tabs
+
// search terms header
if(x($_GET,'search')) {
@@ -135,11 +78,13 @@ function saved_searches($search) {
if(count($r)) {
$o .= '';
}
+ $o .= '';
+
$o .= '' . "\r\n";
return $o;
@@ -155,6 +100,71 @@ function network_content(&$a, $update = 0) {
$o = '';
+ // item filter tabs
+ // TODO: fix this logic, reduce duplication
+ $a->page['content'] .= '';
+
+ $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;
@@ -196,7 +206,7 @@ function network_content(&$a, $update = 0) {
}
}
- $o .= '';
+ nav_set_selected('network');
$_SESSION['return_url'] = $a->cmd;