From 08e54234e30c10e3130b7d71caba9fd43e3593e3 Mon Sep 17 00:00:00 2001 From: Fabio Comuni Date: Mon, 5 Sep 2011 16:55:40 +0200 Subject: [PATCH] profiles popup menu in sidebar --- boot.php | 29 ++++++++++++++++++++++++++++- view/profile_vcard.tpl | 15 ++++++++++++++- view/theme/quattro/quattro.less | 6 +++--- view/theme/quattro/style.css | 9 ++++++++- 4 files changed, 53 insertions(+), 6 deletions(-) diff --git a/boot.php b/boot.php index c13116012..10195c2ba 100644 --- a/boot.php +++ b/boot.php @@ -860,9 +860,36 @@ function profile_sidebar($profile, $block = 0) { $connect = False; - // show edit to yourself + // show edit profile to yourself if ($profile['uid'] == local_user()) { $profile['edit'] = array($a->get_baseurl(). '/profiles', t('Profiles'),"", t('Manage/edit profiles')); + + $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)) { + + foreach($r as $rr) { + $profile['menu']['entries'][] = array( + 'photo' => $rr['thumb'], + 'id' => $rr['id'], + 'alt' => t('Profile Image'), + 'profile_name' => $rr['profile-name'], + 'visible' => (($rr['is-default']) ? '' . t('visible to everybody') . '' + : '' . t('Edit visibility') . '') + ); + } + + + } + + } diff --git a/view/profile_vcard.tpl b/view/profile_vcard.tpl index ecdb5280f..cab732cc1 100644 --- a/view/profile_vcard.tpl +++ b/view/profile_vcard.tpl @@ -2,8 +2,21 @@
$profile.name
- {{ if $profile.edit }}$profile.edit.1{{ endif }} + {{ if $profile.edit }} +
+ $profile.edit.1 + +
+ {{ endif }}
+ {{ if $pdesc }}
$profile.pdesc
{{ endif }}
$profile.name
diff --git a/view/theme/quattro/quattro.less b/view/theme/quattro/quattro.less index 2c4e0464a..01d0b94b9 100644 --- a/view/theme/quattro/quattro.less +++ b/view/theme/quattro/quattro.less @@ -35,7 +35,7 @@ a:hover {color: @LinkHover; text-decoration: underline; } .tool { height: auto; overflow: auto; .label { float: left;} - .icon { float: right; } + .action { float: right; } } /* popup notifications */ @@ -168,11 +168,11 @@ ul.menu-popup { .shadow(); - a { display: block; color: @MenuItem; padding: 5px 10px;} + a { display: block; color: @MenuItem; padding: 5px 10px; text-decoration: none;} a:hover { background-color: @MenuItemHoverBg; } .menu-sep { border-top: 1px solid @MenuItemSeparator; } li { float: none; overflow: auto; height: auto; display: block; } - + li img { float: left; width: 16px; height: 16px; padding-right: 5px;} .empty { padding: 5px; text-align: center; diff --git a/view/theme/quattro/style.css b/view/theme/quattro/style.css index 0fce02f03..6daef77a3 100644 --- a/view/theme/quattro/style.css +++ b/view/theme/quattro/style.css @@ -92,7 +92,7 @@ a:hover { .tool .label { float: left; } -.tool .icon { +.tool .action { float: right; } /* popup notifications */ @@ -268,6 +268,7 @@ ul.menu-popup a { display: block; color: #2d2d2d; padding: 5px 10px; + text-decoration: none; } ul.menu-popup a:hover { background-color: #bdcdd4; @@ -281,6 +282,12 @@ ul.menu-popup li { height: auto; display: block; } +ul.menu-popup li img { + float: left; + width: 16px; + height: 16px; + padding-right: 5px; +} ul.menu-popup .empty { padding: 5px; text-align: center;