]> git.mxchange.org Git - friendica.git/commitdiff
profiles popup menu in sidebar
authorFabio Comuni <fabrix.xm@gmail.com>
Mon, 5 Sep 2011 14:55:40 +0000 (16:55 +0200)
committerFabio Comuni <fabrix.xm@gmail.com>
Mon, 5 Sep 2011 14:55:40 +0000 (16:55 +0200)
boot.php
view/profile_vcard.tpl
view/theme/quattro/quattro.less
view/theme/quattro/style.css

index c131160129f21619c7404da7b85034860fbc4dcd..10195c2bac60dd544aa21251da43662de8b53e6b 100644 (file)
--- 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']) ? '<strong>' . t('visible to everybody') . '</strong>' 
+                                               : '<a href="' . $a->get_baseurl() . '/profperm/' . $rr['id'] . '" />' . t('Edit visibility') . '</a>')
+                               );
+                       }
+
+
+               }
+               
+               
        }
 
 
index ecdb5280f00df781bdfe92c7f39a99ce5399ea4e..cab732cc14d6f07b637cd668ab1f2d699127a7e2 100644 (file)
@@ -2,8 +2,21 @@
 
        <div class="tool">
                <div class="fn label">$profile.name</div>
-               {{ if $profile.edit }}<a class="icon s16 edit ttright" href="$profile.edit.0" title="$profile.edit.3"><span>$profile.edit.1</span></a>{{ endif }}
+               {{ if $profile.edit }}
+                       <div class="action">
+                       <a class="icon s16 edit ttright" href="#" rel="#profiles-menu" title="$profile.edit.3"><span>$profile.edit.1</span></a>
+                       <ul id="profiles-menu" class="menu-popup">
+                               {{ for $profile.menu.entries as $e }}
+                               <li><a href="profiles/$e.id"><img src='$e.photo'>$e.profile_name</a></li>
+                               {{ endfor }}
+                               <li><a href="profile_photo" >$profile.menu.chg_photo</a></li>
+                               <li><a href="profiles/new" id="profile-listing-new-link">$profile.menu.cr_new</a></li>
+                               
+                       </ul>
+                       </div>
+               {{ endif }}
        </div>
+                               
        
        {{ if $pdesc }}<div class="title">$profile.pdesc</div>{{ endif }}
        <div id="profile-photo-wrapper"><img class="photo" width="175" height="175" src="$profile.photo" alt="$profile.name"></div>
index 2c4e0464a41a913528827055ebe41e75cbe1b7fa..01d0b94b911de4ccc33960a81e96287fb3242b8d 100644 (file)
@@ -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;
index 0fce02f0397491c41f9b57ad411b228e84c7f1ff..6daef77a30bfb74096845d5a850d434f54d6e57a 100644 (file)
@@ -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;