1
1
Fork 0

contact-edit-actions-button: initial commit

This commit is contained in:
rabuzarus 2016-02-08 01:56:15 +01:00
parent 99c3db98a7
commit 991cbd604a
3 changed files with 132 additions and 32 deletions

View file

@ -565,6 +565,8 @@ function contacts_content(&$a) {
($contact['rel'] == CONTACT_IS_FOLLOWER))
$follow = $a->get_baseurl(true)."/follow?url=".urlencode($contact["url"]);
$contact_actions = contact_action_menu($contact);
$o .= replace_macros($tpl, array(
//'$header' => t('Contact Editor'),
@ -574,7 +576,7 @@ function contacts_content(&$a) {
'$lbl_vis2' => sprintf( t('Please choose the profile you would like to display to %s when viewing your profile securely.'), $contact['name']),
'$lbl_info1' => t('Contact Information / Notes'),
'$infedit' => t('Edit contact notes'),
'$common_text' => $common_text,
//'$common_text' => $common_text,
'$common_link' => $a->get_baseurl(true) . '/common/loc/' . local_user() . '/' . $contact['id'],
'$all_friends' => $all_friends,
'$relation_text' => $relation_text,
@ -622,7 +624,9 @@ function contacts_content(&$a) {
'$about' => bbcode($contact["about"], false, false),
'$about_label' => t("About:"),
'$keywords' => $contact["keywords"],
'$keywords_label' => t("Tags:")
'$keywords_label' => t("Tags:"),
'$contact_action_button' => t("Actions"),
'$contact_actions' => $contact_actions,
));
@ -954,3 +958,66 @@ function _contact_detail_for_template($rr){
);
}
function contact_action_menu($contact) {
$contact_action_menu = array(
'suggest' => array(
'label' => t('Suggest friends'),
'url' => app::get_baseurl(true) . '/fsuggest/' . $contact['id'],
'title' => '',
'sel' => '',
'id' => 'suggest',
),
'update' => array(
'label' => t('Update now'),
'url' => app::get_baseurl(true) . '/contacts/' . $contact['id'] . '/update',
'title' => '',
'sel' => '',
'id' => 'update',
),
'repair' => array(
'label' => t('Repair'),
'url' => app::get_baseurl(true) . '/crepair/' . $contact['id'],
'title' => t('Advanced Contact Settings'),
'sel' => '',
'id' => 'repair',
),
'block' => array(
'label' => (intval($contact['blocked']) ? t('Unblock') : t('Block') ),
'url' => app::get_baseurl(true) . '/contacts/' . $contact['id'] . '/block',
'title' => t('Toggle Blocked status'),
'sel' => (intval($contact['blocked']) ? 'active' : ''),
'id' => 'toggle-block',
),
'ignore' => array(
'label' => (intval($contact['readonly']) ? t('Unignore') : t('Ignore') ),
'url' => app::get_baseurl(true) . '/contacts/' . $contact['id'] . '/ignore',
'title' => t('Toggle Ignored status'),
'sel' => (intval($contact['readonly']) ? 'active' : ''),
'id' => 'toggle-ignore',
),
'archive' => array(
'label' => (intval($contact['archive']) ? t('Unarchive') : t('Archive') ),
'url' => app::get_baseurl(true) . '/contacts/' . $contact['id'] . '/archive',
'title' => t('Toggle Archive status'),
'sel' => (intval($contact['archive']) ? 'active' : ''),
'id' => 'toggle-archive',
),
'delete' => array(
'label' => t('Delete'),
'url' => app::get_baseurl(true) . '/contacts/' . $contact['id'] . '/drop',
'title' => t('Delete contact'),
'sel' => '',
'id' => 'delete',
)
);
return $contact_action_menu;
}

View file

@ -1,6 +1,28 @@
/* General style rules .*/
.pull-right { float: right }
/* General designing elements */
.btn {
outline: none;
-moz-box-shadow: inset 0px 1px 0px 0px #ffffff;
-webkit-box-shadow: inset 0px 1px 0px 0px #ffffff;
box-shadow: inset 0px 1px 0px 0px #ffffff;
background-color: #ededed;
text-indent: 0;
border: 1px solid #dcdcdc;
display: inline-block;
color: #777777;
padding: 5px 10px;
text-align: center;
}
ul.menu-popup li.divider {
height: 1px;
margin: 3px 0;
overflow: hidden;
background-color: #2d2d2d;;
}
/* List of social Networks */
img.connector, img.connector-disabled {
height: 40px;
@ -351,3 +373,8 @@ td.federation-data {
#live-community {
clear: both;
}
/* contact-edit */
#contact-edit-actions {
float: right;
}

View file

@ -4,6 +4,21 @@
{{$tab_str}}
<div id="contact-edit-actions">
<a class="btn" rel="#contact-actions-menu" href="#" id="contact-edit-actions-button">{{$contact_action_button}}</a>
<ul role="menu" aria-haspopup="true" id="contact-actions-menu" class="menu-popup" >
{{if $lblsuggest}}<li><a href="#" title="{{$contact_actions.suggest.title}}" onclick="window.location.href='{{$contact_actions.suggest.url}}'; return false;">{{$contact_actions.suggest.label}}</a></li>{{/if}}
{{if $poll_enabled}}<li><a href="#" title="{{$contact_actions.update.title}}" onclick="window.location.href='{{$contact_actions.update.url}}'; return false;">{{$contact_actions.update.label}}</a></li>{{/if}}
<li><a href="#" title="{{$contact_actions.repair.title}}" onclick="window.location.href='{{$contact_actions.repair.url}}'; return false;">{{$contact_actions.repair.label}}</a></li>
<li class="divider"></li>
<li><a href="#" title="{{$contact_actions.block.title}}" onclick="window.location.href='{{$contact_actions.block.url}}'; return false;">{{$contact_actions.block.label}}</a></li>
<li><a href="#" title="{{$contact_actions.ignore.title}}" onclick="window.location.href='{{$contact_actions.ignore.url}}'; return false;">{{$contact_actions.ignore.label}}</a></li>
<li><a href="#" title="{{$contact_actions.archive.title}}" onclick="window.location.href='{{$contact_actions.archive.url}}'; return false;">{{$contact_actions.archive.label}}</a></li>
<li><a href="#" title="{{$contact_actions.delete.title}}" onclick="return confirmDelete();">{{$contact_actions.delete.label}}</a></li>
</ul>
</div>
<div id="contact-edit-drop-link" >
<a href="contacts/{{$contact_id}}/drop" class="icon drophide" id="contact-edit-drop-link" onclick="return confirmDelete();" title="{{$delete}}" onmouseover="imgbright(this);" onmouseout="imgdull(this);"></a>
</div>
@ -35,15 +50,6 @@
</ul>
<ul>
{{if $common_text}}
<li><div id="contact-edit-common"><a href="{{$common_link}}">{{$common_text}}</a></div></li>
{{/if}}
{{if $all_friends}}
<li><div id="contact-edit-allfriends"><a href="allfriends/{{$contact_id}}">{{$all_friends}}</a></div></li>
{{/if}}
<!-- <li><a href="network/0?nets=all&cid={{$contact_id}}" id="contact-edit-view-recent">{{$lblrecent}}</a></li> -->
{{if $lblsuggest}}
<li><a href="fsuggest/{{$contact_id}}" id="contact-edit-suggest">{{$lblsuggest}}</a></li>