From 68c49322b7d56ea771c7168df69d1159b78508a7 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 5 Dec 2012 21:40:30 -0800 Subject: [PATCH] bring back profile edit popup menu, needs some more theming --- boot.php | 38 ++++++++++------- view/theme/redbasic/tpl/profile_vcard.tpl | 51 ----------------------- view/tpl/profile_vcard.tpl | 16 +++++++ 3 files changed, 40 insertions(+), 65 deletions(-) delete mode 100644 view/theme/redbasic/tpl/profile_vcard.tpl diff --git a/boot.php b/boot.php index bd952661f..3d7401ba0 100644 --- a/boot.php +++ b/boot.php @@ -1256,12 +1256,12 @@ function profile_load(&$a, $nickname, $profile = 0) { require_once($theme_info_file); } - if(local_user() && local_user() == $a->profile['uid']) { - $a->page['aside'] .= replace_macros(get_markup_template('profile_edlink.tpl'),array( - '$editprofile' => t('Edit profile'), - '$profid' => $a->profile['id'] - )); - } +// if(local_user() && local_user() == $a->profile['uid']) { +// $a->page['aside'] .= replace_macros(get_markup_template('profile_edlink.tpl'),array( +// '$editprofile' => t('Edit profile'), +// '$profid' => $a->profile['id'] +// )); +// } $block = (((get_config('system','block_public')) && (! local_user()) && (! remote_user())) ? true : false); @@ -1306,6 +1306,9 @@ if(! function_exists('profile_sidebar')) { if((! is_array($profile)) && (! count($profile))) return $o; + + $is_owner = (($profile['uid'] == local_user()) ? true : false); + $profile['picdate'] = urlencode($profile['picdate']); call_hooks('profile_sidebar_enter', $profile); @@ -1333,17 +1336,24 @@ if(! function_exists('profile_sidebar')) { // show edit profile to yourself - if ($profile['uid'] == local_user() && feature_enabled(local_user(),'multi_profiles')) { - $profile['edit'] = array($a->get_baseurl(). '/profiles', t('Profiles'),"", t('Manage/edit profiles')); - + if($is_owner) { + + $profile['menu'] = array( + 'chg_photo' => t('Change profile photo'), + 'entries' => array(), + ); + + + if(feature_enabled(local_user(),'multi_profiles')) { + $profile['edit'] = array($a->get_baseurl(). '/profiles', t('Profiles'),"", t('Manage/edit profiles')); + $profile['menu']['cr_new'] = t('Create New Profile'); + } + else + $profile['edit'] = array($a->get_baseurl() . '/profiles/' . $profile['id'], t('Edit Profile'),'',t('Edit Profile')); + $r = q("SELECT * FROM `profile` WHERE `uid` = %d", local_user()); - $profile['menu'] = array( - 'chg_photo' => t('Change profile photo'), - 'cr_new' => t('Create New Profile'), - 'entries' => array(), - ); if(count($r)) { diff --git a/view/theme/redbasic/tpl/profile_vcard.tpl b/view/theme/redbasic/tpl/profile_vcard.tpl deleted file mode 100644 index 0b5c76e88..000000000 --- a/view/theme/redbasic/tpl/profile_vcard.tpl +++ /dev/null @@ -1,51 +0,0 @@ -
- -
$profile.name
- - - - {{ if $pdesc }}
$profile.pdesc
{{ endif }} -
$profile.name
- - - - {{ if $location }} -
$location
-
- {{ if $profile.address }}
$profile.address
{{ endif }} - - $profile.locality{{ if $profile.locality }}, {{ endif }} - $profile.region - $profile.postal-code - - {{ if $profile.country-name }}$profile.country-name{{ endif }} -
-
- {{ endif }} - - {{ if $gender }}
$gender
$profile.gender
{{ endif }} - - {{ if $profile.pubkey }}{{ endif }} - - {{ if $marital }}
$marital
$profile.marital
{{ endif }} - - {{ if $homepage }}
$homepage
$profile.homepage
{{ endif }} - - {{ inc diaspora_vcard.tpl }}{{ endinc }} - -
- -
- -$contact_block - - diff --git a/view/tpl/profile_vcard.tpl b/view/tpl/profile_vcard.tpl index 1d0c433e9..216f9665a 100644 --- a/view/tpl/profile_vcard.tpl +++ b/view/tpl/profile_vcard.tpl @@ -1,5 +1,21 @@
+ {{ if $profile.edit }} +
+ $profile.edit.1 + +
+ {{ endif }} +
$profile.name