Contacts can now be updated from every theme

This commit is contained in:
Michael 2020-11-22 08:15:17 +00:00
parent 2dd56bcb0d
commit b52ba79620
6 changed files with 3 additions and 15 deletions

View file

@ -1139,7 +1139,7 @@ class Contact extends BaseModule
]; ];
} }
if (in_array($contact['network'], Protocol::FEDERATED)) { if (in_array($contact['network'], Protocol::NATIVE_SUPPORT)) {
$contact_actions['updateprofile'] = [ $contact_actions['updateprofile'] = [
'label' => DI::l10n()->t('Refetch contact data'), 'label' => DI::l10n()->t('Refetch contact data'),
'url' => 'contact/' . $contact['id'] . '/updateprofile', 'url' => 'contact/' . $contact['id'] . '/updateprofile',

View file

@ -128,8 +128,6 @@ class Advanced extends BaseModule
'$info' => $info, '$info' => $info,
'$returnaddr' => $returnaddr, '$returnaddr' => $returnaddr,
'$return' => DI::l10n()->t('Return to contact editor'), '$return' => DI::l10n()->t('Return to contact editor'),
'$update_profile' => in_array($contact['network'], Protocol::FEDERATED),
'$udprofilenow' => DI::l10n()->t('Refetch contact data'),
'$contact_id' => $contact['id'], '$contact_id' => $contact['id'],
'$lbl_submit' => DI::l10n()->t('Submit'), '$lbl_submit' => DI::l10n()->t('Submit'),

View file

@ -13,12 +13,6 @@
<!-- <h4>{{$contact_name}}</h4> --> <!-- <h4>{{$contact_name}}</h4> -->
<div id="contact-update-profile-wrapper">
{{if $update_profile}}
<span id="contact-update-profile-now" class="button"><a href="contact/{{$contact_id}}/updateprofile" >{{$udprofilenow}}</a></span>
{{/if}}
</div>
{{include file="field_input.tpl" field=$name}} {{include file="field_input.tpl" field=$name}}
{{include file="field_input.tpl" field=$nick}} {{include file="field_input.tpl" field=$nick}}

View file

@ -17,6 +17,7 @@
<ul role="menu" aria-haspopup="true" id="contact-actions-menu" class="menu-popup" > <ul role="menu" aria-haspopup="true" id="contact-actions-menu" class="menu-popup" >
{{if $lblsuggest}}<li role="menuitem"><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 $lblsuggest}}<li role="menuitem"><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 role="menuitem"><a href="#" title="{{$contact_actions.update.title}}" onclick="window.location.href='{{$contact_actions.update.url}}'; return false;">{{$contact_actions.update.label}}</a></li>{{/if}} {{if $poll_enabled}}<li role="menuitem"><a href="#" title="{{$contact_actions.update.title}}" onclick="window.location.href='{{$contact_actions.update.url}}'; return false;">{{$contact_actions.update.label}}</a></li>{{/if}}
{{if $contact_actions.updateprofile}}<li role="menuitem"><a href="{{$contact_actions.updateprofile.url}}" title="{{$contact_actions.updateprofile.title}}">{{$contact_actions.updateprofile.label}}</a></li>{{/if}}
<li class="divider"></li> <li class="divider"></li>
<li role="menuitem"><a href="#" title="{{$contact_actions.block.title}}" onclick="window.location.href='{{$contact_actions.block.url}}'; return false;">{{$contact_actions.block.label}}</a></li> <li role="menuitem"><a href="#" title="{{$contact_actions.block.title}}" onclick="window.location.href='{{$contact_actions.block.url}}'; return false;">{{$contact_actions.block.label}}</a></li>
<li role="menuitem"><a href="#" title="{{$contact_actions.ignore.title}}" onclick="window.location.href='{{$contact_actions.ignore.url}}'; return false;">{{$contact_actions.ignore.label}}</a></li> <li role="menuitem"><a href="#" title="{{$contact_actions.ignore.title}}" onclick="window.location.href='{{$contact_actions.ignore.url}}'; return false;">{{$contact_actions.ignore.label}}</a></li>

View file

@ -15,12 +15,6 @@
<!-- <h4>{{$contact_name}}</h4> --> <!-- <h4>{{$contact_name}}</h4> -->
<div id="contact-update-profile-wrapper">
{{if $update_profile}}
<span id="contact-update-profile-now" class="button"><a href="contact/{{$contact_id}}/updateprofile" >{{$udprofilenow}}</a></span>
{{/if}}
</div>
{{include file="field_input.tpl" field=$name}} {{include file="field_input.tpl" field=$name}}
{{include file="field_input.tpl" field=$nick}} {{include file="field_input.tpl" field=$nick}}

View file

@ -18,6 +18,7 @@
<ul role="menu" aria-haspopup="true" id="contact-actions-menu" class="menu-popup" > <ul role="menu" aria-haspopup="true" id="contact-actions-menu" class="menu-popup" >
{{if $lblsuggest}}<li role="menuitem"><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 $lblsuggest}}<li role="menuitem"><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 role="menuitem"><a href="#" title="{{$contact_actions.update.title}}" onclick="window.location.href='{{$contact_actions.update.url}}'; return false;">{{$contact_actions.update.label}}</a></li>{{/if}} {{if $poll_enabled}}<li role="menuitem"><a href="#" title="{{$contact_actions.update.title}}" onclick="window.location.href='{{$contact_actions.update.url}}'; return false;">{{$contact_actions.update.label}}</a></li>{{/if}}
{{if $contact_actions.updateprofile}}<li role="menuitem"><a href="{{$contact_actions.updateprofile.url}}" title="{{$contact_actions.updateprofile.title}}">{{$contact_actions.updateprofile.label}}</a></li>{{/if}}
<li class="divider"></li> <li class="divider"></li>
<li role="menuitem"><a href="#" title="{{$contact_actions.block.title}}" onclick="window.location.href='{{$contact_actions.block.url}}'; return false;">{{$contact_actions.block.label}}</a></li> <li role="menuitem"><a href="#" title="{{$contact_actions.block.title}}" onclick="window.location.href='{{$contact_actions.block.url}}'; return false;">{{$contact_actions.block.label}}</a></li>
<li role="menuitem"><a href="#" title="{{$contact_actions.ignore.title}}" onclick="window.location.href='{{$contact_actions.ignore.url}}'; return false;">{{$contact_actions.ignore.label}}</a></li> <li role="menuitem"><a href="#" title="{{$contact_actions.ignore.title}}" onclick="window.location.href='{{$contact_actions.ignore.url}}'; return false;">{{$contact_actions.ignore.label}}</a></li>