1
0
Fork 0

Move CRepair to Contact Advanced route

This commit is contained in:
nupplaPhil 2020-02-01 00:37:11 +01:00
parent f565d590f6
commit 048bb014d8
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90
3 changed files with 9 additions and 11 deletions

View file

@ -14,9 +14,9 @@ use Friendica\Network\HTTPException\ForbiddenException;
use Friendica\Util\Strings;
/**
* GUI for repairing contact details
* GUI for advanced contact details manipulation
*/
class Repair extends BaseModule
class Advanced extends BaseModule
{
public static function init(array $parameters = [])
{
@ -27,7 +27,7 @@ class Repair extends BaseModule
public static function post(array $parameters = [])
{
$cid = $parameters['contact'];
$cid = $parameters['id'];
$contact = Model\Contact::selectFirst([], ['id' => $cid, 'uid' => local_user()]);
if (empty($contact)) {
@ -82,9 +82,7 @@ class Repair extends BaseModule
public static function content(array $parameters = [])
{
$cid = $parameters['contact'];
$cid = $parameters['contact'];
$cid = $parameters['id'];
$contact = Model\Contact::selectFirst([], ['id' => $cid, 'uid' => local_user()]);
if (empty($contact)) {
@ -124,7 +122,7 @@ class Repair extends BaseModule
$tab_str = Contact::getTabsHTML($a, $contact, 6);
$tpl = Renderer::getMarkupTemplate('crepair.tpl');
$tpl = Renderer::getMarkupTemplate('contact/advanced.tpl');
return Renderer::replaceMacros($tpl, [
'$tab_str' => $tab_str,
'$warning' => $warning,

View file

@ -87,6 +87,7 @@ return [
'[/]' => [Module\Contact::class, [R::GET]],
'/{id:\d+}[/]' => [Module\Contact::class, [R::GET, R::POST]],
'/{id:\d+}/archive' => [Module\Contact::class, [R::GET]],
'/{id:\d+}/advanced' => [Module\Contact\Advanced::class, [R::GET, R::POST]],
'/{id:\d+}/block' => [Module\Contact::class, [R::GET]],
'/{id:\d+}/conversations' => [Module\Contact::class, [R::GET]],
'/{id:\d+}/drop' => [Module\Contact::class, [R::GET]],
@ -104,7 +105,6 @@ return [
],
'/credits' => [Module\Credits::class, [R::GET]],
'/crepair/{contact:\d+}' => [Module\Contact\Repair::class, [R::GET, R::POST]],
'/delegation'=> [Module\Delegation::class, [R::GET, R::POST]],
'/dirfind' => [Module\Search\Directory::class, [R::GET]],

View file

@ -2,14 +2,14 @@
{{$tab_str nofilter}}
<div class="crepair-error-message">{{$warning nofilter}}</div><br>
<div class="crepair-return">
<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="crepair-form" action="crepair/{{$contact_id}}" method="post" >
<form id="contact-advanced-form" action="contact/{{$contact_id}}/advanced" method="post" >
<!-- <h4>{{$contact_name}}</h4> -->