From f64e2d63b9ee66482b3461ecb6ee8f7776e23b87 Mon Sep 17 00:00:00 2001 From: Fabio Comuni Date: Mon, 10 Oct 2011 15:28:34 +0200 Subject: New common tab template. Update css --- boot.php | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'boot.php') diff --git a/boot.php b/boot.php index c8ec84681..d4e9ed0d6 100644 --- a/boot.php +++ b/boot.php @@ -1161,3 +1161,47 @@ function load_contact_links($uid) { return; }} +if(! function_exists('profile_tabs')){ +function profile_tabs($a, $is_owner=False){ + //echo "
"; var_dump($a->user); killme();
+	
+		
+	if(x($_GET,'tab'))
+		$tab = notags(trim($_GET['tab']));
+	
+	$url = $a->get_baseurl() . '/profile/' . $a->user['nickname'];
+
+	$tabs = array(
+		array(
+			'label'=>t('Status'),
+			'url' => $url,
+			'sel' => ((!isset($tab)&&$a->argv[0]=='profile')?'active':''),
+		),
+		array(
+			'label' => t('Profile'),
+			'url' 	=> $url.'/?tab=profile',
+			'sel'	=> (($tab=='profile')?'active':''),
+		),
+		array(
+			'label' => t('Photos'),
+			'url'	=> $a->get_baseurl() . '/photos/' . $a->user['nickname'],
+			'sel'	=> ((!isset($tab)&&$a->argv[0]=='photos')?'active':''),
+		),
+	);
+	
+	if ($is_owner){
+		 $tabs[] = array(
+			'label' => t('Events'),
+			'url'	=> $a->get_baseurl() . '/events',
+			'sel' 	=>((!isset($tab)&&$a->argv[0]=='events')?'active':''),
+		);
+		$tabs[] = array(
+			'label' => t('Personal Notes'),
+			'url'	=> $a->get_baseurl() . '/notes',
+			'sel' 	=>((!isset($tab)&&$a->argv[0]=='notes')?'active':''),
+		);
+	}
+
+	$tpl = get_markup_template('common_tabs.tpl');
+	return replace_macros($tpl,array('$tabs'=>$tabs));
+}}	
-- 
cgit v1.2.3


From 070e081ae9be8d43b92425cc9a9131d5977f8e00 Mon Sep 17 00:00:00 2001
From: Fabio Comuni 
Date: Mon, 10 Oct 2011 16:40:12 +0200
Subject: Fix url in profile tabs

---
 boot.php | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

(limited to 'boot.php')

diff --git a/boot.php b/boot.php
index d4e9ed0d6..e9c3f0e31 100644
--- a/boot.php
+++ b/boot.php
@@ -1162,14 +1162,16 @@ function load_contact_links($uid) {
 }}
 
 if(! function_exists('profile_tabs')){
-function profile_tabs($a, $is_owner=False){
+function profile_tabs($a, $is_owner=False, $nickname=Null){
 	//echo "
"; var_dump($a->user); killme();
 	
+	if (is_null($nickname))
+		$nickname  = $a->user['nickname'];
 		
 	if(x($_GET,'tab'))
 		$tab = notags(trim($_GET['tab']));
 	
-	$url = $a->get_baseurl() . '/profile/' . $a->user['nickname'];
+	$url = $a->get_baseurl() . '/profile/' . $nickname;
 
 	$tabs = array(
 		array(
@@ -1184,7 +1186,7 @@ function profile_tabs($a, $is_owner=False){
 		),
 		array(
 			'label' => t('Photos'),
-			'url'	=> $a->get_baseurl() . '/photos/' . $a->user['nickname'],
+			'url'	=> $a->get_baseurl() . '/photos/' . $nickname,
 			'sel'	=> ((!isset($tab)&&$a->argv[0]=='photos')?'active':''),
 		),
 	);
-- 
cgit v1.2.3