From 7f402da40fd0eb3b8077ee79ed4aa3991cd5d918 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Wed, 5 Feb 2020 22:22:08 -0500 Subject: [PATCH 1/3] Fix undefined variable in contact import n mod/settings --- mod/settings.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mod/settings.php b/mod/settings.php index b9bdf66ec..30d406d59 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -406,9 +406,10 @@ function settings_post(App $a) Worker::add(PRIORITY_LOW, 'AddContact', $_SESSION['uid'], $csvRow[0]); } } + info(DI::l10n()->t('Importing Contacts done')); // delete temp file - unlink($filename); + unlink($_FILES['importcontact-filename']['tmp_name']); } } } From 45f6707ff459ec0e3016521495c712fa83fec6e5 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Wed, 5 Feb 2020 22:40:09 -0500 Subject: [PATCH 2/3] Reformat dfrn_request and auto_request templates --- view/templates/auto_request.tpl | 88 ++++++----- view/templates/dfrn_request.tpl | 118 +++++++------- view/theme/frio/templates/auto_request.tpl | 109 ++++++------- view/theme/frio/templates/dfrn_request.tpl | 171 +++++++++++---------- 4 files changed, 254 insertions(+), 232 deletions(-) diff --git a/view/templates/auto_request.tpl b/view/templates/auto_request.tpl index 3f901f675..84039fa4f 100644 --- a/view/templates/auto_request.tpl +++ b/view/templates/auto_request.tpl @@ -1,60 +1,64 @@

{{$header}}

-{{if $myaddr == ""}} +{{if !$myaddr}}

-{{$page_desc}}
+ {{$page_desc}} +

+

+ {{$invite_desc nofilter}}

-{{$invite_desc nofilter}} -

-

-{{$desc nofilter}} + {{$desc nofilter}}

{{/if}} -{{if $request}} -
-{{else}} - -{{/if}} - + {{if $photo}} - + {{/if}} -{{if $url}}
{{$url_label}}
{{$url}}
{{/if}} -{{if $location}}
{{$location_label}}
{{$location}}
{{/if}} -{{if $keywords}}
{{$keywords_label}}
{{$keywords}}
{{/if}} -{{if $about}}
{{$about_label}}
{{$about nofilter}}
{{/if}} +
+{{if $url}} +
{{$url_label}}
+
{{$url}}
+{{/if}} +{{if $location}} +
{{$location_label}}
+
{{$location}}
+{{/if}} +{{if $keywords}} +
{{$keywords_label}}
+
{{$keywords}}
+{{/if}} +{{if $about}} +
{{$about_label}}
+
{{$about nofilter}}
+{{/if}} +
-
- - {{if $myaddr}} - {{$myaddr}} - - {{else}} - - {{/if}} - {{if $url}} - - {{/if}} -
-
- - -
- -
+
+ +{{if $myaddr}} + {{$myaddr}} + +{{else}} + +{{/if}} +{{if $url}} + +{{/if}} +
+
- {{if $submit}} - - {{/if}} - +{{if $submit}} + +{{/if}} +
diff --git a/view/templates/dfrn_request.tpl b/view/templates/dfrn_request.tpl index 2f6aec62e..c35285fd6 100644 --- a/view/templates/dfrn_request.tpl +++ b/view/templates/dfrn_request.tpl @@ -1,90 +1,98 @@

{{$header}}

-{{if $myaddr}} -{{else}} +{{if !$myaddr}}

-{{$page_desc}}
+ {{$page_desc}} +

-{{$invite_desc nofilter}} +

+ {{$invite_desc nofilter}}

-{{$desc nofilter}} + {{$desc nofilter}}

{{/if}} -{{if $request}} -
-{{else}} - -{{/if}} - + {{if $photo}} - + {{/if}} -{{if $url}}
{{$url_label}}
{{$url}}
{{/if}} -{{if $location}}
{{$location_label}}
{{$location}}
{{/if}} -{{if $keywords}}
{{$keywords_label}}
{{$keywords}}
{{/if}} -{{if $about}}
{{$about_label}}
{{$about nofilter}}
{{/if}} +
+{{if $url}} +
{{$url_label}}
+
{{$url}}
+{{/if}} +{{if $location}} +
{{$location_label}}
+
{{$location}}
+{{/if}} +{{if $keywords}} +
{{$keywords_label}}
+
{{$keywords}}
+{{/if}} +{{if $about}} +
{{$about_label}}
+
{{$about nofilter}}
+{{/if}} +
-
- - {{if $myaddr}} +
+ +{{if $myaddr}} {{$myaddr}} - - {{else}} - - {{/if}} - {{if $url}} - - {{/if}} -
-
+ +{{else}} + +{{/if}} +{{if $url}} + +{{/if}} +
+
-

-{{$pls_answer}} -

+

+ {{$pls_answer}} +

-
+
-{{include file="field_checkbox.tpl" field=$does_know_you}} - + *}} -

-{{$add_note}} -

-
- +

+ {{$add_note}} +

+
+ +
- -
-
- {{if $submit}} - - {{/if}} - +{{if $submit}} + +{{/if}} +
diff --git a/view/theme/frio/templates/auto_request.tpl b/view/theme/frio/templates/auto_request.tpl index 787288180..e9c4c8250 100644 --- a/view/theme/frio/templates/auto_request.tpl +++ b/view/theme/frio/templates/auto_request.tpl @@ -1,63 +1,66 @@
-

{{$header}}

+

{{$header}}

-{{if $myaddr == ""}} -

-{{$page_desc}}
-

-

-

-{{$invite_desc nofilter}} -

-

-{{$desc}} -

+{{if !$myaddr}} +

+ {{$page_desc}} +

+ +

+ {{$invite_desc nofilter}} +

+

+ {{$desc}} +

{{/if}} -{{if $request}} -
-{{else}} - -{{/if}} + {{if $photo}} - + {{/if}} +
+{{if $url}} +
{{$url_label}}
+
{{$url}}
+{{/if}} +{{if $location}} +
{{$location_label}}
+
{{$location}}
+{{/if}} +{{if $keywords}} +
{{$keywords_label}}
+
{{$keywords}}
+{{/if}} +{{if $about}} +
{{$about_label}}
+
{{$about}}
+{{/if}} +
-{{if $url}}
{{$url_label}}
{{$url}}
{{/if}} -{{if $location}}
{{$location_label}}
{{$location}}
{{/if}} +
+ + {{if $myaddr}} + {{$myaddr}} + + {{else}} + + {{/if}} + {{if $url}} + + {{/if}} +
+
-{{if $keywords}}
{{$keywords_label}}
{{$keywords}}
{{/if}} -{{if $about}}
{{$about_label}}
{{$about}}
{{/if}} - -
- - {{if $myaddr}} - {{$myaddr}} - - {{else}} - - {{/if}} - {{if $url}} - - {{/if}} -
-
- - -
- -
- -
- {{if $submit}} - - {{/if}} - -
-
+
+ {{if $submit}} + + {{/if}} + +
+
diff --git a/view/theme/frio/templates/dfrn_request.tpl b/view/theme/frio/templates/dfrn_request.tpl index 8270ebac2..45d4aeafd 100644 --- a/view/theme/frio/templates/dfrn_request.tpl +++ b/view/theme/frio/templates/dfrn_request.tpl @@ -1,92 +1,99 @@
-

{{$header}}

+

{{$header}}

-{{if $myaddr}} -{{else}} -

-{{$page_desc}}
-

-{{$invite_desc nofilter}} -

-

-{{$desc}} -

+{{if !$myaddr}} +

+ {{$page_desc}} +

+ +

+ {{$invite_desc nofilter}} +

+

+ {{$desc}} +

{{/if}} -{{if $request}} -
-{{else}} - -{{/if}} + {{if $photo}} - + {{/if}} +
+{{if $url}} +
{{$url_label}}
+
{{$url}}
+{{/if}} +{{if $location}} +
{{$location_label}}
+
{{$location}}
+{{/if}} +{{if $keywords}} +
{{$keywords_label}}
+
{{$keywords}}
+{{/if}} +{{if $about}} +
{{$about_label}}
+
{{$about}}
+{{/if}} +
-{{if $url}}
{{$url_label}}
{{$url}}
{{/if}} -{{if $location}}
{{$location_label}}
{{$location}}
{{/if}} -{{if $keywords}}
{{$keywords_label}}
{{$keywords}}
{{/if}} -{{if $about}}
{{$about_label}}
{{$about}}
{{/if}} - -
- - {{if $myaddr}} - {{$myaddr}} - - {{else}} - - {{/if}} - {{if $url}} - - {{/if}} -
-
- -

-{{$pls_answer}} -

- -
- -{{include file="field_checkbox.tpl" field=$does_know_you}} - - -

-{{$add_note}} -

-
- -
- - -
- -
- {{if $submit}} - +
+ + {{if $myaddr}} + {{$myaddr}} + + {{else}} + {{/if}} - -
- + {{if $url}} + + {{/if}} +
+
+ +

+ {{$pls_answer}} +

+ +
+ {{include file="field_checkbox.tpl" field=$does_know_you}} + {{* +

+ {{$does_know}} +

+ +
+ + + +
+
+
+ + + +
+
+ *}} + +

+ {{$add_note}} +

+
+ +
+
+ +
+{{if $submit}} + +{{/if}} + +
+
From 2fb1819e572a64c9d308fc2913411986f4b04df7 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Wed, 5 Feb 2020 22:41:04 -0500 Subject: [PATCH 3/3] Simplify dfrn_request and auto_request templates - Limit template variables --- mod/dfrn_request.php | 35 +++++------ mod/follow.php | 21 +++---- mod/settings.php | 4 +- view/templates/auto_request.tpl | 39 +----------- view/templates/dfrn_request.tpl | 66 +------------------- view/theme/frio/templates/auto_request.tpl | 51 +++------------- view/theme/frio/templates/dfrn_request.tpl | 71 ++-------------------- 7 files changed, 40 insertions(+), 247 deletions(-) diff --git a/mod/dfrn_request.php b/mod/dfrn_request.php index 4079e6cca..4a860a97a 100644 --- a/mod/dfrn_request.php +++ b/mod/dfrn_request.php @@ -626,28 +626,21 @@ function dfrn_request_content(App $a) $tpl = Renderer::getMarkupTemplate('auto_request.tpl'); } - $page_desc = DI::l10n()->t("Please enter your 'Identity Address' from one of the following supported communications networks:"); - - $invite_desc = DI::l10n()->t('If you are not yet a member of the free social web, follow this link to find a public Friendica site and join us today.', Search::getGlobalDirectory() . '/servers'); - $o = Renderer::replaceMacros($tpl, [ - '$header' => DI::l10n()->t('Friend/Connection Request'), - '$desc' => DI::l10n()->t('Examples: jojo@demo.friendica.com, http://demo.friendica.com/profile/jojo, testuser@gnusocial.de'), - '$pls_answer' => DI::l10n()->t('Please answer the following:'), - '$does_know_you' => ['knowyou', DI::l10n()->t('Does %s know you?', $a->profile['name'])], - '$add_note' => DI::l10n()->t('Add a personal note:'), - '$page_desc' => $page_desc, - '$friendica' => DI::l10n()->t('Friendica'), - '$statusnet' => DI::l10n()->t("GNU Social \x28Pleroma, Mastodon\x29"), - '$diaspora' => DI::l10n()->t("Diaspora \x28Socialhome, Hubzilla\x29"), - '$diasnote' => DI::l10n()->t(' - please do not use this form. Instead, enter %s into your Diaspora search bar.', $target_addr), - '$your_address' => DI::l10n()->t('Your Identity Address:'), - '$invite_desc' => $invite_desc, - '$submit' => DI::l10n()->t('Submit Request'), - '$cancel' => DI::l10n()->t('Cancel'), - '$nickname' => $a->argv[1], - '$name' => $a->profile['name'], - '$myaddr' => $myaddr + '$header' => DI::l10n()->t('Friend/Connection Request'), + '$page_desc' => DI::l10n()->t('Enter your Webfinger address (user@domain.tld) or profile URL here. If this isn\'t supported by your system (for example it doesn\'t work with Diaspora), you have to subscribe to %s directly on your system', $target_addr), + '$invite_desc' => DI::l10n()->t('If you are not yet a member of the free social web, follow this link to find a public Friendica node and join us today.', Search::getGlobalDirectory() . '/servers'), + '$your_address' => DI::l10n()->t('Your Webfinger address or profile URL:'), + '$pls_answer' => DI::l10n()->t('Please answer the following:'), + '$submit' => DI::l10n()->t('Submit Request'), + '$cancel' => DI::l10n()->t('Cancel'), + + '$request' => 'dfrn_request/' . $a->argv[1], + '$name' => $a->profile['name'], + '$myaddr' => $myaddr, + + '$does_know_you' => ['knowyou', DI::l10n()->t('%s knows me', $a->profile['name'])], + '$addnote_field' => ['dfrn-request-message', DI::l10n()->t('Add a personal note:')], ]); return $o; } diff --git a/mod/follow.php b/mod/follow.php index 2a5241a0c..e1d8b0ea7 100644 --- a/mod/follow.php +++ b/mod/follow.php @@ -163,29 +163,22 @@ function follow_content(App $a) $o = Renderer::replaceMacros($tpl, [ '$header' => DI::l10n()->t('Connect/Follow'), - '$desc' => '', '$pls_answer' => DI::l10n()->t('Please answer the following:'), - '$does_know_you' => ['knowyou', DI::l10n()->t('Does %s know you?', $ret['name'])], - '$add_note' => DI::l10n()->t('Add a personal note:'), - '$page_desc' => '', - '$friendica' => '', - '$statusnet' => '', - '$diaspora' => '', - '$diasnote' => '', '$your_address' => DI::l10n()->t('Your Identity Address:'), - '$invite_desc' => '', - '$emailnet' => '', + '$url_label' => DI::l10n()->t('Profile URL'), + '$keywords_label'=> DI::l10n()->t('Tags:'), '$submit' => $submit, '$cancel' => DI::l10n()->t('Cancel'), - '$nickname' => '', + + '$request' => $request, '$name' => $ret['name'], '$url' => $ret['url'], '$zrl' => Profile::zrl($ret['url']), - '$url_label' => DI::l10n()->t('Profile URL'), '$myaddr' => $myaddr, - '$request' => $request, '$keywords' => $r[0]['keywords'], - '$keywords_label'=> DI::l10n()->t('Tags:') + + '$does_know_you' => ['knowyou', DI::l10n()->t('Does %s know you?', $ret['name'])], + '$addnote_field' => ['dfrn-request-message', DI::l10n()->t('Add a personal note:')], ]); DI::page()['aside'] = ''; diff --git a/mod/settings.php b/mod/settings.php index 30d406d59..ddb3fb76c 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -792,8 +792,8 @@ function settings_content(App $a) Hook::callAll('connector_settings', $settings_connectors); if (is_site_admin()) { - $diasp_enabled = DI::l10n()->t('Built-in support for %s connectivity is %s', DI::l10n()->t('Diaspora'), ((DI::config()->get('system', 'diaspora_enabled')) ? DI::l10n()->t('enabled') : DI::l10n()->t('disabled'))); - $ostat_enabled = DI::l10n()->t('Built-in support for %s connectivity is %s', DI::l10n()->t("GNU Social \x28OStatus\x29"), ((DI::config()->get('system', 'ostatus_disabled')) ? DI::l10n()->t('disabled') : DI::l10n()->t('enabled'))); + $diasp_enabled = DI::l10n()->t('Built-in support for %s connectivity is %s', DI::l10n()->t('Diaspora (Socialhome, Hubzilla)'), ((DI::config()->get('system', 'diaspora_enabled')) ? DI::l10n()->t('enabled') : DI::l10n()->t('disabled'))); + $ostat_enabled = DI::l10n()->t('Built-in support for %s connectivity is %s', DI::l10n()->t('OStatus (GNU Social)'), ((DI::config()->get('system', 'ostatus_disabled')) ? DI::l10n()->t('disabled') : DI::l10n()->t('enabled'))); } else { $diasp_enabled = ""; $ostat_enabled = ""; diff --git a/view/templates/auto_request.tpl b/view/templates/auto_request.tpl index 84039fa4f..0f960a4a2 100644 --- a/view/templates/auto_request.tpl +++ b/view/templates/auto_request.tpl @@ -1,57 +1,20 @@

{{$header}}

-{{if !$myaddr}} -

- {{$page_desc}} -

- -

- {{$invite_desc nofilter}} -

-

- {{$desc nofilter}} -

-{{/if}} - -
-{{if $photo}} - -{{/if}} - +
-{{if $url}}
{{$url_label}}
{{$url}}
-{{/if}} -{{if $location}} -
{{$location_label}}
-
{{$location}}
-{{/if}} {{if $keywords}}
{{$keywords_label}}
{{$keywords}}
-{{/if}} -{{if $about}} -
{{$about_label}}
-
{{$about nofilter}}
{{/if}}
-{{if $myaddr}} {{$myaddr}} -{{else}} - -{{/if}} -{{if $url}} -{{/if}}
diff --git a/view/templates/dfrn_request.tpl b/view/templates/dfrn_request.tpl index c35285fd6..f1ef7c469 100644 --- a/view/templates/dfrn_request.tpl +++ b/view/templates/dfrn_request.tpl @@ -2,45 +2,14 @@ {{if !$myaddr}}

- {{$page_desc}} + {{$page_desc nofilter}}

-

{{$invite_desc nofilter}}

-

- {{$desc nofilter}} -

{{/if}} - -{{if $photo}} - -{{/if}} - -
-{{if $url}} -
{{$url_label}}
-
{{$url}}
-{{/if}} -{{if $location}} -
{{$location_label}}
-
{{$location}}
-{{/if}} -{{if $keywords}} -
{{$keywords_label}}
-
{{$keywords}}
-{{/if}} -{{if $about}} -
{{$about_label}}
-
{{$about nofilter}}
-{{/if}} -
- +
{{if $myaddr}} @@ -48,9 +17,6 @@ {{else}} -{{/if}} -{{if $url}} - {{/if}}
@@ -60,39 +26,13 @@

- {{include file="field_checkbox.tpl" field=$does_know_you}} - {{* -

- {{$does_know}} -

-
- - - -
-
-
- - - -
-
- *}} - -

- {{$add_note}} -

-
- -
+ {{include file="field_textarea.tpl" field=$addnote_field}}
-{{if $submit}} -{{/if}}
diff --git a/view/theme/frio/templates/auto_request.tpl b/view/theme/frio/templates/auto_request.tpl index e9c4c8250..c803c3d8a 100644 --- a/view/theme/frio/templates/auto_request.tpl +++ b/view/theme/frio/templates/auto_request.tpl @@ -1,65 +1,28 @@

{{$header}}

-{{if !$myaddr}} -

- {{$page_desc}} -

- -

- {{$invite_desc nofilter}} -

-

- {{$desc}} -

-{{/if}} - -
- -{{if $photo}} - -{{/if}} +
-{{if $url}}
{{$url_label}}
{{$url}}
-{{/if}} -{{if $location}} -
{{$location_label}}
-
{{$location}}
-{{/if}} {{if $keywords}}
{{$keywords_label}}
{{$keywords}}
-{{/if}} -{{if $about}} -
{{$about_label}}
-
{{$about}}
{{/if}}
- {{if $myaddr}} - {{$myaddr}} - - {{else}} - - {{/if}} - {{if $url}} - - {{/if}} + {{$myaddr}} + +
- {{if $submit}} - - {{/if}} +{{if $submit}} + +{{/if}}
diff --git a/view/theme/frio/templates/dfrn_request.tpl b/view/theme/frio/templates/dfrn_request.tpl index 45d4aeafd..65f84fd7c 100644 --- a/view/theme/frio/templates/dfrn_request.tpl +++ b/view/theme/frio/templates/dfrn_request.tpl @@ -3,56 +3,22 @@ {{if !$myaddr}}

- {{$page_desc}} + {{$page_desc nofilter}}

-

{{$invite_desc nofilter}}

-

- {{$desc}} -

{{/if}} -
- -{{if $photo}} - -{{/if}} -
-{{if $url}} -
{{$url_label}}
-
{{$url}}
-{{/if}} -{{if $location}} -
{{$location_label}}
-
{{$location}}
-{{/if}} -{{if $keywords}} -
{{$keywords_label}}
-
{{$keywords}}
-{{/if}} -{{if $about}} -
{{$about_label}}
-
{{$about}}
-{{/if}} -
- +
- {{if $myaddr}} +{{if $myaddr}} {{$myaddr}} - {{else}} +{{else}} - {{/if}} - {{if $url}} - - {{/if}} +{{/if}}
@@ -62,37 +28,12 @@
{{include file="field_checkbox.tpl" field=$does_know_you}} - {{* -

- {{$does_know}} -

-
- - - -
-
-
- - - -
-
- *}} - -

- {{$add_note}} -

-
- -
+ {{include file="field_textarea.tpl" field=$addnote_field}}
-{{if $submit}} -{{/if}}