contact menu beginnings

This commit is contained in:
Friendika 2011-08-24 22:40:26 -07:00
parent 8f6ae2b660
commit 74d61ed00b
4 changed files with 95 additions and 1 deletions

View 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;
}}

View file

@ -422,6 +422,7 @@ function contacts_content(&$a) {
$o .= replace_macros($tpl, array( $o .= replace_macros($tpl, array(
'$img_hover' => sprintf( t('Visit %s\'s profile [%s]'),$rr['name'],$rr['url']), '$img_hover' => sprintf( t('Visit %s\'s profile [%s]'),$rr['name'],$rr['url']),
'$edit_hover' => t('Edit contact'), '$edit_hover' => t('Edit contact'),
'$contact_photo_menu' => contact_photo_menu($rr),
'$id' => $rr['id'], '$id' => $rr['id'],
'$alt_text' => $alt_text, '$alt_text' => $alt_text,
'$dir_icon' => $dir_icon, '$dir_icon' => $dir_icon,

View file

@ -12,8 +12,18 @@
<div class="contact-entry-edit-end"></div> <div class="contact-entry-edit-end"></div>
</div> </div>
<div class="contact-entry-nav-end"></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> <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>
</div> </div>

View file

@ -744,6 +744,7 @@ input#dfrn-url {
.contact-entry-wrapper { .contact-entry-wrapper {
float: left; float: left;
width: 180px; width: 180px;
height: 120px;
} }
.contact-entry-direction-icon { .contact-entry-direction-icon {
@ -1458,6 +1459,36 @@ input#dfrn-url {
/*margin-left: 50px;*/ /*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 { #block-message, #ignore-message {
margin-top: 20px; margin-top: 20px;
color: #FF0000; color: #FF0000;