Merge pull request #11155 from annando/advanced-cleaned

Cleaned advanced contact tab
This commit is contained in:
Hypolite Petovan 2022-01-14 07:58:51 -05:00 committed by GitHub
commit 8abf1dccf0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 99 deletions

View file

@ -73,12 +73,7 @@ class Advanced extends BaseModule
$name = ($_POST['name'] ?? '') ?: $contact['name']; $name = ($_POST['name'] ?? '') ?: $contact['name'];
$nick = $_POST['nick'] ?? ''; $nick = $_POST['nick'] ?? '';
$url = $_POST['url'] ?? ''; $url = $_POST['url'] ?? '';
$alias = $_POST['alias'] ?? '';
$request = $_POST['request'] ?? '';
$confirm = $_POST['confirm'] ?? '';
$notify = $_POST['notify'] ?? '';
$poll = $_POST['poll'] ?? ''; $poll = $_POST['poll'] ?? '';
$attag = $_POST['attag'] ?? '';
$photo = $_POST['photo'] ?? ''; $photo = $_POST['photo'] ?? '';
$nurl = Strings::normaliseLink($url); $nurl = Strings::normaliseLink($url);
@ -89,12 +84,7 @@ class Advanced extends BaseModule
'nick' => $nick, 'nick' => $nick,
'url' => $url, 'url' => $url,
'nurl' => $nurl, 'nurl' => $nurl,
'alias' => $alias,
'request' => $request,
'confirm' => $confirm,
'notify' => $notify,
'poll' => $poll, 'poll' => $poll,
'attag' => $attag,
], ],
['id' => $contact['id'], 'uid' => local_user()] ['id' => $contact['id'], 'uid' => local_user()]
); );
@ -121,9 +111,6 @@ class Advanced extends BaseModule
$this->page['aside'] = Widget\VCard::getHTML($contact); $this->page['aside'] = Widget\VCard::getHTML($contact);
$warning = $this->t('<strong>WARNING: This is highly advanced</strong> and if you enter incorrect information your communications with this contact may stop working.');
$info = $this->t('Please use your browser \'Back\' button <strong>now</strong> if you are uncertain what to do on this page.');
$returnaddr = "contact/$cid"; $returnaddr = "contact/$cid";
// This data is fetched automatically for most networks. // This data is fetched automatically for most networks.
@ -139,22 +126,15 @@ class Advanced extends BaseModule
$tpl = Renderer::getMarkupTemplate('contact/advanced.tpl'); $tpl = Renderer::getMarkupTemplate('contact/advanced.tpl');
return Renderer::replaceMacros($tpl, [ return Renderer::replaceMacros($tpl, [
'$tab_str' => $tab_str, '$tab_str' => $tab_str,
'$warning' => $warning,
'$info' => $info,
'$returnaddr' => $returnaddr, '$returnaddr' => $returnaddr,
'$return' => $this->t('Return to contact editor'), '$return' => $this->t('Return to contact editor'),
'$contact_id' => $contact['id'], '$contact_id' => $contact['id'],
'$lbl_submit' => $this->t('Submit'), '$lbl_submit' => $this->t('Submit'),
'$name' => ['name', $this->t('Name'), $contact['name'], '', '', $readonly], '$name' => ['name', $this->t('Name'), $contact['name'], '', '', $readonly],
'$nick' => ['nick', $this->t('Account Nickname'), $contact['nick'], '', '', $readonly], '$nick' => ['nick', $this->t('Account Nickname'), $contact['nick'], '', '', 'readonly'],
'$attag' => ['attag', $this->t('@Tagname - overrides Name/Nickname'), $contact['attag']], '$url' => ['url', $this->t('Account URL'), $contact['url'], '', '', 'readonly'],
'$url' => ['url', $this->t('Account URL'), $contact['url'], '', '', $readonly], 'poll' => ['poll', $this->t('Poll/Feed URL'), $contact['poll'], '', '', ($contact['network'] == Protocol::FEED) ? '' : 'readonly'],
'$alias' => ['alias', $this->t('Account URL Alias'), $contact['alias'], '', '', $readonly],
'$request' => ['request', $this->t('Friend Request URL'), $contact['request'], '', '', $readonly],
'confirm' => ['confirm', $this->t('Friend Confirm URL'), $contact['confirm'], '', '', $readonly],
'notify' => ['notify', $this->t('Notification Endpoint URL'), $contact['notify'], '', '', $readonly],
'poll' => ['poll', $this->t('Poll/Feed URL'), $contact['poll'], '', '', $readonly],
'photo' => ['photo', $this->t('New photo from this URL'), '', '', '', $readonly], 'photo' => ['photo', $this->t('New photo from this URL'), '', '', '', $readonly],
]); ]);
} }

View file

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: 2021.12-rc\n" "Project-Id-Version: 2021.12-rc\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-01-09 12:31-0500\n" "POT-Creation-Date: 2022-01-12 21:28+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -402,7 +402,7 @@ msgstr ""
#: mod/events.php:519 mod/message.php:201 mod/message.php:357 #: mod/events.php:519 mod/message.php:201 mod/message.php:357
#: mod/photos.php:927 mod/photos.php:1031 mod/photos.php:1301 #: mod/photos.php:927 mod/photos.php:1031 mod/photos.php:1301
#: mod/photos.php:1342 mod/photos.php:1398 mod/photos.php:1472 #: mod/photos.php:1342 mod/photos.php:1398 mod/photos.php:1472
#: src/Module/Admin/Item/Source.php:65 src/Module/Contact/Advanced.php:147 #: src/Module/Admin/Item/Source.php:65 src/Module/Contact/Advanced.php:132
#: src/Module/Contact/Poke.php:177 src/Module/Contact/Profile.php:327 #: src/Module/Contact/Poke.php:177 src/Module/Contact/Profile.php:327
#: src/Module/Debug/ActivityPubConversion.php:141 #: src/Module/Debug/ActivityPubConversion.php:141
#: src/Module/Debug/Babel.php:313 src/Module/Debug/Localtime.php:64 #: src/Module/Debug/Babel.php:313 src/Module/Debug/Localtime.php:64
@ -1127,7 +1127,7 @@ msgid "Bad Request."
msgstr "" msgstr ""
#: mod/redir.php:55 mod/redir.php:129 src/Module/Contact/Advanced.php:70 #: mod/redir.php:55 mod/redir.php:129 src/Module/Contact/Advanced.php:70
#: src/Module/Contact/Advanced.php:119 src/Module/Contact/Contacts.php:55 #: src/Module/Contact/Advanced.php:109 src/Module/Contact/Contacts.php:55
#: src/Module/Contact/Conversations.php:78 #: src/Module/Contact/Conversations.php:78
#: src/Module/Contact/Conversations.php:83 #: src/Module/Contact/Conversations.php:83
#: src/Module/Contact/Conversations.php:88 src/Module/Contact/Media.php:43 #: src/Module/Contact/Conversations.php:88 src/Module/Contact/Media.php:43
@ -1255,7 +1255,7 @@ msgstr ""
#: src/Module/Admin/Users/Active.php:129 src/Module/Admin/Users/Blocked.php:130 #: src/Module/Admin/Users/Active.php:129 src/Module/Admin/Users/Blocked.php:130
#: src/Module/Admin/Users/Create.php:71 src/Module/Admin/Users/Deleted.php:88 #: src/Module/Admin/Users/Create.php:71 src/Module/Admin/Users/Deleted.php:88
#: src/Module/Admin/Users/Index.php:142 src/Module/Admin/Users/Index.php:162 #: src/Module/Admin/Users/Index.php:142 src/Module/Admin/Users/Index.php:162
#: src/Module/Admin/Users/Pending.php:104 src/Module/Contact/Advanced.php:149 #: src/Module/Admin/Users/Pending.php:104 src/Module/Contact/Advanced.php:134
msgid "Name" msgid "Name"
msgstr "" msgstr ""
@ -7142,59 +7142,27 @@ msgstr ""
msgid "Visit %s's profile [%s]" msgid "Visit %s's profile [%s]"
msgstr "" msgstr ""
#: src/Module/Contact/Advanced.php:109 #: src/Module/Contact/Advanced.php:99
msgid "Contact update failed." msgid "Contact update failed."
msgstr "" msgstr ""
#: src/Module/Contact/Advanced.php:124 #: src/Module/Contact/Advanced.php:130
msgid ""
"<strong>WARNING: This is highly advanced</strong> and if you enter incorrect "
"information your communications with this contact may stop working."
msgstr ""
#: src/Module/Contact/Advanced.php:125
msgid ""
"Please use your browser 'Back' button <strong>now</strong> if you are "
"uncertain what to do on this page."
msgstr ""
#: src/Module/Contact/Advanced.php:145
msgid "Return to contact editor" msgid "Return to contact editor"
msgstr "" msgstr ""
#: src/Module/Contact/Advanced.php:150 #: src/Module/Contact/Advanced.php:135
msgid "Account Nickname" msgid "Account Nickname"
msgstr "" msgstr ""
#: src/Module/Contact/Advanced.php:151 #: src/Module/Contact/Advanced.php:136
msgid "@Tagname - overrides Name/Nickname"
msgstr ""
#: src/Module/Contact/Advanced.php:152
msgid "Account URL" msgid "Account URL"
msgstr "" msgstr ""
#: src/Module/Contact/Advanced.php:153 #: src/Module/Contact/Advanced.php:137
msgid "Account URL Alias"
msgstr ""
#: src/Module/Contact/Advanced.php:154
msgid "Friend Request URL"
msgstr ""
#: src/Module/Contact/Advanced.php:155
msgid "Friend Confirm URL"
msgstr ""
#: src/Module/Contact/Advanced.php:156
msgid "Notification Endpoint URL"
msgstr ""
#: src/Module/Contact/Advanced.php:157
msgid "Poll/Feed URL" msgid "Poll/Feed URL"
msgstr "" msgstr ""
#: src/Module/Contact/Advanced.php:158 #: src/Module/Contact/Advanced.php:138
msgid "New photo from this URL" msgid "New photo from this URL"
msgstr "" msgstr ""

View file

@ -2,13 +2,6 @@
{{$tab_str nofilter}} {{$tab_str nofilter}}
<div class="contact-advanced-error-message">{{$warning nofilter}}</div><br>
<div class="contact-advanced-return">
{{$info nofilter}}<br>
<!-- <a href="{{$returnaddr}}">{{$return}}</a> -->
</div>
<br />
<form id="contact-advanced-form" action="contact/{{$contact_id}}/advanced" method="post"> <form id="contact-advanced-form" action="contact/{{$contact_id}}/advanced" method="post">
<!-- <h4>{{$contact_name}}</h4> --> <!-- <h4>{{$contact_name}}</h4> -->
@ -17,18 +10,8 @@
{{include file="field_input.tpl" field=$nick}} {{include file="field_input.tpl" field=$nick}}
{{include file="field_input.tpl" field=$attag}}
{{include file="field_input.tpl" field=$url}} {{include file="field_input.tpl" field=$url}}
{{include file="field_input.tpl" field=$alias}}
{{include file="field_input.tpl" field=$request}}
{{include file="field_input.tpl" field=$confirm}}
{{include file="field_input.tpl" field=$notify}}
{{include file="field_input.tpl" field=$poll}} {{include file="field_input.tpl" field=$poll}}
{{include file="field_input.tpl" field=$photo}} {{include file="field_input.tpl" field=$photo}}

View file

@ -4,13 +4,6 @@
{{$tab_str nofilter}} {{$tab_str nofilter}}
<div class="contact-advanced-error-message">{{$warning nofilter}}</div><br>
<div class="contact-advanced-return">
{{$info nofilter}}<br>
<!-- <a href="{{$returnaddr}}">{{$return}}</a> -->
</div>
<br />
<form id="contact-advanced-form" action="contact/{{$contact_id}}/advanced" method="post"> <form id="contact-advanced-form" action="contact/{{$contact_id}}/advanced" method="post">
<!-- <h4>{{$contact_name}}</h4> --> <!-- <h4>{{$contact_name}}</h4> -->
@ -19,18 +12,8 @@
{{include file="field_input.tpl" field=$nick}} {{include file="field_input.tpl" field=$nick}}
{{include file="field_input.tpl" field=$attag}}
{{include file="field_input.tpl" field=$url}} {{include file="field_input.tpl" field=$url}}
{{include file="field_input.tpl" field=$alias}}
{{include file="field_input.tpl" field=$request}}
{{include file="field_input.tpl" field=$confirm}}
{{include file="field_input.tpl" field=$notify}}
{{include file="field_input.tpl" field=$poll}} {{include file="field_input.tpl" field=$poll}}
{{include file="field_input.tpl" field=$photo}} {{include file="field_input.tpl" field=$photo}}