]> git.mxchange.org Git - friendica.git/commitdiff
contact menu beginnings
authorFriendika <info@friendika.com>
Thu, 25 Aug 2011 05:40:26 +0000 (22:40 -0700)
committerFriendika <info@friendika.com>
Thu, 25 Aug 2011 05:40:26 +0000 (22:40 -0700)
include/Contact.php
mod/contacts.php
view/contact_template.tpl
view/theme/duepuntozero/style.css

index 4ca77d065175c58bc0f02d3b2f7239cc20fadb73..6eda0b6c520013a1d312e91be1c6a5d621f5d3dd 100644 (file)
@@ -85,3 +85,55 @@ function unmark_for_death($contact) {
        );
 }}
 
+if(! function_exists('contact_photo_menu')){
+function contact_photo_menu($contact) {
+
+       $a = get_app();
+       
+       $contact_url="";
+       $pm_url="";
+       $status_link="";
+       $photos_link="";
+       $posts_link="";
+
+       $sparkle = false;
+       if($contact['network'] === NETWORK_DFRN) {
+               $sparkle = true;
+               $profile_link = $a->get_baseurl() . '/redir/' . $contact['id'];
+       }
+       else
+               $profile_link = $contact['url'];
+
+       if($profile_link === 'mailbox')
+               $profile_link = '';
+
+       if($sparkle) {
+               $status_link = $profile_link . "?url=status";
+               $photos_link = $profile_link . "?url=photos";
+               $profile_link = $profile_link . "?url=profile";
+               $pm_url = $a->get_baseurl() . '/message/new/' . $contact['id'];
+       }
+
+       $contact_url = $a->get_baseurl() . '/contacts/' . $cid;
+       $posts_link = $a->get_baseurl() . '/network/?cid=' . $cid;
+
+       $menu = Array(
+               t("View status") => $status_link,
+               t("View profile") => $profile_link,
+               t("View photos") => $photos_link,               
+               t("View recent") => $posts_link, 
+               t("Edit contact") => $contact_url,
+               t("Send PM") => $pm_url,
+       );
+       
+       
+       $args = array('contact' => $contact, 'menu' => $menu);
+       
+       call_hooks('contact_photo_menu', $args);
+       
+       $o = "";
+       foreach($menu as $k=>$v){
+               if ($v!="") $o .= "<li><a href='$v'>$k</a></li>\n";
+       }
+       return $o;
+}}
index 4d9385026cdf6622b92d90fa8c7fa377f3af3dd2..6863bd73708ea0621a284b16df88fd8618a5c505 100644 (file)
@@ -422,6 +422,7 @@ function contacts_content(&$a) {
                        $o .= replace_macros($tpl, array(
                                '$img_hover' => sprintf( t('Visit %s\'s profile [%s]'),$rr['name'],$rr['url']),
                                '$edit_hover' => t('Edit contact'),
+                               '$contact_photo_menu' => contact_photo_menu($rr),
                                '$id' => $rr['id'],
                                '$alt_text' => $alt_text,
                                '$dir_icon' => $dir_icon,
index e9f616760d47d1487a16bb7c64257ecdd10542d1..a74cebab5df1a5a094f36a18de6485601bfd6bba 100644 (file)
                        <div class="contact-entry-edit-end"></div>
                </div>
                <div class="contact-entry-nav-end"></div>
-               <div class="contact-entry-photo" id="contact-entry-photo-$id" >
+               <div class="contact-entry-photo" id="contact-entry-photo-$id"
+               onmouseover="if (typeof t$id != 'undefined') clearTimeout(t$id); openMenu('contact-photo-menu-button-$id')" onmouseout="t$id=setTimeout('closeMenu(\'contact-photo-menu-button-$id\'); closeMenu(\'contact-photo-menu-$id\');',200)">
+
                        <a href="$url" title="$img_hover" /><img src="$thumb" $sparkle alt="$name" /></a>
+
+               <span onclick="openClose('contact-photo-menu-$id');" class="fakelink contact-photo-menu-button" id="contact-photo-menu-button-$id">menu</span>
+                <div class="contact-photo-menu" id="contact-photo-menu-$id">
+                    <ul>
+                        $contact_photo_menu
+                    </ul>
+                </div>
+
                </div>
                        
        </div>
index 5943e5061722c07dbb5bdaa8fb55c324d5f86dce..66e9f857e8d4e9e16cff0681aad415db5af38b8d 100644 (file)
@@ -744,6 +744,7 @@ input#dfrn-url {
 .contact-entry-wrapper {
        float: left;
        width: 180px;
+       height: 120px;
 }
 
 .contact-entry-direction-icon {
@@ -1458,6 +1459,36 @@ input#dfrn-url {
        /*margin-left: 50px;*/
 }
 
+
+.contact-photo-menu-button {
+       display: block;
+/*     position: absolute; */
+       background-image: url("photo-menu.jpg");
+       background-position: top left; 
+       background-repeat: no-repeat;
+       margin: 0px; padding: 0px;
+       width: 16px;
+       height: 16px;
+       top: 60px; left:10px;
+       overflow: hidden;
+       text-indent: 40px;
+       display: none;
+       
+}
+.contact-photo-menu {
+       width: auto;
+       border: 2px solid #444444;
+       background: #FFFFFF;
+/*     position: absolute; */
+       left: 10px; top: 90px;
+       display: none;
+       z-index: 10000;
+}
+.contact-photo-menu ul { margin:0px; padding: 0px; list-style: none }
+.contact-photo-menu li a { display: block; padding: 2px; }
+.contact-photo-menu li a:hover { color: #FFFFFF; background: #3465A4; text-decoration: none; }
+
+
 #block-message, #ignore-message {
        margin-top: 20px;
        color: #FF0000;