small work on connections page
This commit is contained in:
		| @@ -32,6 +32,7 @@ class Connections extends \Zotlabs\Web\Controller { | |||||||
|  |  | ||||||
| 		nav_set_selected('Connections'); | 		nav_set_selected('Connections'); | ||||||
| 	 | 	 | ||||||
|  | 		$active      = false; | ||||||
| 		$blocked     = false; | 		$blocked     = false; | ||||||
| 		$hidden      = false; | 		$hidden      = false; | ||||||
| 		$ignored     = false; | 		$ignored     = false; | ||||||
| @@ -44,11 +45,16 @@ class Connections extends \Zotlabs\Web\Controller { | |||||||
| 		if(! $_REQUEST['aj']) | 		if(! $_REQUEST['aj']) | ||||||
| 			$_SESSION['return_url'] = \App::$query_string; | 			$_SESSION['return_url'] = \App::$query_string; | ||||||
| 	 | 	 | ||||||
| 		$search_flags = ''; | 		$search_flags = ""; | ||||||
| 		$head = ''; | 		$head = ''; | ||||||
| 	 | 	 | ||||||
| 		if(argc() == 2) { | 		if(argc() == 2) { | ||||||
| 			switch(argv(1)) { | 			switch(argv(1)) { | ||||||
|  | 				case 'active': | ||||||
|  | 					$search_flags = " and abook_blocked = 0 and abook_ignored = 0 and abook_hidden = 0 and abook_archived = 0 AND abook_not_here = 0 "; | ||||||
|  | 					$head = t('Active'); | ||||||
|  | 					$active = true; | ||||||
|  | 					break; | ||||||
| 				case 'blocked': | 				case 'blocked': | ||||||
| 					$search_flags = " and abook_blocked = 1 "; | 					$search_flags = " and abook_blocked = 1 "; | ||||||
| 					$head = t('Blocked'); | 					$head = t('Blocked'); | ||||||
| @@ -101,8 +107,9 @@ class Connections extends \Zotlabs\Web\Controller { | |||||||
| 				case 'all': | 				case 'all': | ||||||
| 					$head = t('All'); | 					$head = t('All'); | ||||||
| 				default: | 				default: | ||||||
| 					$search_flags = ''; | 					$search_flags = " and abook_blocked = 0 and abook_ignored = 0 and abook_hidden = 0 and abook_archived = 0 and abook_not_here = 0 "; | ||||||
| 					$all = true; | 					$active = true; | ||||||
|  | 					$head = t('Active'); | ||||||
| 					break; | 					break; | ||||||
| 	 | 	 | ||||||
| 			} | 			} | ||||||
| @@ -129,6 +136,13 @@ class Connections extends \Zotlabs\Web\Controller { | |||||||
| 			), | 			), | ||||||
| 			*/ | 			*/ | ||||||
| 	 | 	 | ||||||
|  | 			'active' => array( | ||||||
|  | 				'label' => t('Active Connections'), | ||||||
|  | 				'url'   => z_root() . '/connections/active',  | ||||||
|  | 				'sel'   => ($active) ? 'active' : '', | ||||||
|  | 				'title' => t('Show active connections'), | ||||||
|  | 			), | ||||||
|  |  | ||||||
| 			'pending' => array( | 			'pending' => array( | ||||||
| 				'label' => t('New Connections'), | 				'label' => t('New Connections'), | ||||||
| 				'url'   => z_root() . '/connections/pending',  | 				'url'   => z_root() . '/connections/pending',  | ||||||
| @@ -136,12 +150,6 @@ class Connections extends \Zotlabs\Web\Controller { | |||||||
| 				'title' => t('Show pending (new) connections'), | 				'title' => t('Show pending (new) connections'), | ||||||
| 			), | 			), | ||||||
| 	 | 	 | ||||||
| 			'all' => array( |  | ||||||
| 				'label' => t('All Connections'), |  | ||||||
| 				'url'   => z_root() . '/connections/all',  |  | ||||||
| 				'sel'   => ($all) ? 'active' : '', |  | ||||||
| 				'title' => t('Show all connections'), |  | ||||||
| 			), |  | ||||||
| 	 | 	 | ||||||
| 			/* | 			/* | ||||||
| 			array( | 			array( | ||||||
| @@ -188,6 +196,13 @@ class Connections extends \Zotlabs\Web\Controller { | |||||||
| 	//		), | 	//		), | ||||||
| 	 | 	 | ||||||
|  |  | ||||||
|  | 			'all' => array( | ||||||
|  | 				'label' => t('All Connections'), | ||||||
|  | 				'url'   => z_root() . '/connections',  | ||||||
|  | 				'sel'   => ($all) ? 'active' : '', | ||||||
|  | 				'title' => t('Show all connections'), | ||||||
|  | 			), | ||||||
|  | 	 | ||||||
| 		); | 		); | ||||||
| 	 | 	 | ||||||
| 		//$tab_tpl = get_markup_template('common_tabs.tpl'); | 		//$tab_tpl = get_markup_template('common_tabs.tpl'); | ||||||
| @@ -238,6 +253,7 @@ class Connections extends \Zotlabs\Web\Controller { | |||||||
| 	 | 	 | ||||||
| 					$status_str = ''; | 					$status_str = ''; | ||||||
| 					$status = array( | 					$status = array( | ||||||
|  | 						((intval($rr['abook_active'])) ? t('Active') : ''), | ||||||
| 						((intval($rr['abook_pending'])) ? t('Pending approval') : ''), | 						((intval($rr['abook_pending'])) ? t('Pending approval') : ''), | ||||||
| 						((intval($rr['abook_archived'])) ? t('Archived') : ''), | 						((intval($rr['abook_archived'])) ? t('Archived') : ''), | ||||||
| 						((intval($rr['abook_hidden'])) ? t('Hidden') : ''), | 						((intval($rr['abook_hidden'])) ? t('Hidden') : ''), | ||||||
| @@ -246,6 +262,11 @@ class Connections extends \Zotlabs\Web\Controller { | |||||||
| 						((intval($rr['abook_not_here'])) ? t('Not connected at this location') : '') | 						((intval($rr['abook_not_here'])) ? t('Not connected at this location') : '') | ||||||
| 					); | 					); | ||||||
|  |  | ||||||
|  | 					$oneway = false; | ||||||
|  | 					if(! intval(get_abconfig(local_channel(),$rr['xchan_hash'],'their_perms','post_comments'))) { | ||||||
|  | 						$oneway = true; | ||||||
|  | 					} | ||||||
|  | 	 | ||||||
| 					foreach($status as $str) { | 					foreach($status as $str) { | ||||||
| 						if(!$str) | 						if(!$str) | ||||||
| 							continue; | 							continue; | ||||||
| @@ -283,7 +304,8 @@ class Connections extends \Zotlabs\Web\Controller { | |||||||
| 						'ignore_hover' => t('Ignore connection'), | 						'ignore_hover' => t('Ignore connection'), | ||||||
| 						'ignore' => ((! $rr['abook_ignored']) ? t('Ignore') : false), | 						'ignore' => ((! $rr['abook_ignored']) ? t('Ignore') : false), | ||||||
| 						'recent_label' => t('Recent activity'), | 						'recent_label' => t('Recent activity'), | ||||||
| 						'recentlink' => z_root() . '/network/?f=&cid=' . intval($rr['abook_id']) | 						'recentlink' => z_root() . '/network/?f=&cid=' . intval($rr['abook_id']), | ||||||
|  | 						'oneway' => $oneway | ||||||
| 					); | 					); | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
|   | |||||||
| @@ -9,7 +9,7 @@ | |||||||
| 			</button> | 			</button> | ||||||
| 			<div class="dropdown-menu dropdown-menu-right"> | 			<div class="dropdown-menu dropdown-menu-right"> | ||||||
| 				{{foreach $tabs as $menu}} | 				{{foreach $tabs as $menu}} | ||||||
| 				<a class="dropdown-item" href="{{$menu.url}}">{{$menu.label}}</a> | 				<a class="dropdown-item {{$menu.sel}}" href="{{$menu.url}}">{{$menu.label}}</a> | ||||||
| 				{{/foreach}} | 				{{/foreach}} | ||||||
| 			</div> | 			</div> | ||||||
| 		</div> | 		</div> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user