diff options
author | friendica <info@friendica.com> | 2012-12-05 21:40:30 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-12-05 21:40:30 -0800 |
commit | 68c49322b7d56ea771c7168df69d1159b78508a7 (patch) | |
tree | 72c4bc1fd13cf55563e10c65a114934eb9261f2b /boot.php | |
parent | d5800c61dc85971bebd01e751f463d76552e3fe9 (diff) | |
download | volse-hubzilla-68c49322b7d56ea771c7168df69d1159b78508a7.tar.gz volse-hubzilla-68c49322b7d56ea771c7168df69d1159b78508a7.tar.bz2 volse-hubzilla-68c49322b7d56ea771c7168df69d1159b78508a7.zip |
bring back profile edit popup menu, needs some more theming
Diffstat (limited to 'boot.php')
-rw-r--r-- | boot.php | 36 |
1 files changed, 23 insertions, 13 deletions
@@ -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,18 +1336,25 @@ 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')); - - $r = q("SELECT * FROM `profile` WHERE `uid` = %d", - local_user()); - + if($is_owner) { + $profile['menu'] = array( 'chg_photo' => t('Change profile photo'), - 'cr_new' => t('Create New Profile'), '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()); + + if(count($r)) { foreach($r as $rr) { |