From: Hypolite Petovan Date: Wed, 26 Dec 2018 16:03:41 +0000 (-0500) Subject: Normalize uses of Strings::formatNetworkName to $network_link X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=620395378e2397de1a99877b2ebcf917742807d2;p=friendica.git Normalize uses of Strings::formatNetworkName to $network_link - Unescape HTML template variable $network_link --- diff --git a/mod/hovercard.php b/mod/hovercard.php index 6160642762..101ebd5af2 100644 --- a/mod/hovercard.php +++ b/mod/hovercard.php @@ -96,20 +96,20 @@ function hovercard_content() // Move the contact data to the profile array so we can deliver it to $profile = [ - 'name' => $contact['name'], - 'nick' => $contact['nick'], - 'addr' => defaults($contact, 'addr', $contact['url']), - 'thumb' => ProxyUtils::proxifyUrl($contact['thumb'], false, ProxyUtils::SIZE_THUMB), - 'url' => Contact::magicLink($contact['url']), - 'nurl' => $contact['nurl'], // We additionally store the nurl as identifier - 'location' => $contact['location'], - 'gender' => $contact['gender'], - 'about' => $contact['about'], - 'network' => Strings::formatNetworkName($contact['network'], $contact['url']), - 'tags' => $contact['keywords'], - 'bd' => $contact['birthday'] <= DBA::NULL_DATE ? '' : $contact['birthday'], + 'name' => $contact['name'], + 'nick' => $contact['nick'], + 'addr' => defaults($contact, 'addr', $contact['url']), + 'thumb' => ProxyUtils::proxifyUrl($contact['thumb'], false, ProxyUtils::SIZE_THUMB), + 'url' => Contact::magicLink($contact['url']), + 'nurl' => $contact['nurl'], // We additionally store the nurl as identifier + 'location' => $contact['location'], + 'gender' => $contact['gender'], + 'about' => $contact['about'], + 'network_link' => Strings::formatNetworkName($contact['network'], $contact['url']), + 'tags' => $contact['keywords'], + 'bd' => $contact['birthday'] <= DBA::NULL_DATE ? '' : $contact['birthday'], 'account_type' => Contact::getAccountType($contact), - 'actions' => $actions, + 'actions' => $actions, ]; if ($datatype == 'html') { $tpl = Renderer::getMarkupTemplate('hovercard.tpl'); diff --git a/src/Model/Profile.php b/src/Model/Profile.php index 887e35b721..132f9f3344 100644 --- a/src/Model/Profile.php +++ b/src/Model/Profile.php @@ -297,9 +297,9 @@ class Profile $profile['picdate'] = urlencode(defaults($profile, 'picdate', '')); if (($profile['network'] != '') && ($profile['network'] != Protocol::DFRN)) { - $profile['network_name'] = Strings::formatNetworkName($profile['network'], $profile['url']); + $profile['network_link'] = Strings::formatNetworkName($profile['network'], $profile['url']); } else { - $profile['network_name'] = ''; + $profile['network_link'] = ''; } Addon::callHooks('profile_sidebar_enter', $profile); diff --git a/src/Module/Contact.php b/src/Module/Contact.php index c030f60f46..410f5878bb 100644 --- a/src/Module/Contact.php +++ b/src/Module/Contact.php @@ -75,18 +75,17 @@ class Contact extends BaseModule $a->data['contact'] = $contact; if (($contact['network'] != '') && ($contact['network'] != Protocol::DFRN)) { - $networkname = Strings::formatNetworkName($contact['network'], $contact['url']); + $network_link = Strings::formatNetworkName($contact['network'], $contact['url']); } else { - $networkname = ''; + $network_link = ''; } - /// @TODO Add nice spaces $vcard_widget = Renderer::replaceMacros(Renderer::getMarkupTemplate('vcard-widget.tpl'), [ '$name' => $contact['name'], '$photo' => $contact['photo'], '$url' => Model\Contact::MagicLink($contact['url']), '$addr' => defaults($contact, 'addr', ''), - '$network_name' => $networkname, + '$network_link' => $network_link, '$network' => L10n::t('Network:'), '$account_type' => Model\Contact::getAccountType($contact) ]); diff --git a/view/templates/hovercard.tpl b/view/templates/hovercard.tpl index 0c259c440e..a688f57b20 100644 --- a/view/templates/hovercard.tpl +++ b/view/templates/hovercard.tpl @@ -12,7 +12,7 @@
{{$profile.addr}} - {{if $profile.network}} ({{$profile.network}}){{/if}} + {{if $profile.network_link}}({{$profile.network_link nofilter}}){{/if}}
{{*{{if $profile.about}}
{{$profile.about nofilter}}
{{/if}}*}} diff --git a/view/templates/profile_vcard.tpl b/view/templates/profile_vcard.tpl index f10a21ca6c..124fca154f 100644 --- a/view/templates/profile_vcard.tpl +++ b/view/templates/profile_vcard.tpl @@ -13,7 +13,7 @@
{{$profile.name}}
{{/if}} {{if $account_type}}
{{$account_type}}
{{/if}} - {{if $profile.network_name}}
{{$network}}
{{$profile.network_name nofilter}}
{{/if}} + {{if $profile.network_link}}
{{$network}}
{{$profile.network_link nofilter}}
{{/if}} {{if $location}}
{{$location}}
diff --git a/view/templates/vcard-widget.tpl b/view/templates/vcard-widget.tpl index 47b64b68da..240466460e 100644 --- a/view/templates/vcard-widget.tpl +++ b/view/templates/vcard-widget.tpl @@ -9,6 +9,6 @@
{{$name}}
{{/if}} {{if $account_type}}{{/if}} - {{if $network_name}}
{{$network}}
{{$network_name}}
{{/if}} + {{if $network_link}}
{{$network}}
{{$network_link nofilter}}
{{/if}}
diff --git a/view/theme/duepuntozero/templates/profile_vcard.tpl b/view/theme/duepuntozero/templates/profile_vcard.tpl index 5027507943..a7d0a0bc5a 100644 --- a/view/theme/duepuntozero/templates/profile_vcard.tpl +++ b/view/theme/duepuntozero/templates/profile_vcard.tpl @@ -10,7 +10,7 @@ {{if $account_type}}{{/if}} - {{if $profile.network_name}}
{{$network}}
{{$profile.network_name nofilter}}
{{/if}} + {{if $profile.network_link}}
{{$network}}
{{$profile.network_link nofilter}}
{{/if}} {{if $location}}
{{$location}}
diff --git a/view/theme/frio/templates/vcard-widget.tpl b/view/theme/frio/templates/vcard-widget.tpl index f65db725b2..0eae2841bd 100644 --- a/view/theme/frio/templates/vcard-widget.tpl +++ b/view/theme/frio/templates/vcard-widget.tpl @@ -32,7 +32,7 @@ {{if $account_type}}{{/if}} - {{if $network_name}}
{{$network}}
{{$network_name nofilter}}
{{/if}} + {{if $network_link}}
{{$network}}
{{$network_link nofilter}}
{{/if}} diff --git a/view/theme/quattro/templates/profile_vcard.tpl b/view/theme/quattro/templates/profile_vcard.tpl index 6e81bd90cf..68028fe91e 100644 --- a/view/theme/quattro/templates/profile_vcard.tpl +++ b/view/theme/quattro/templates/profile_vcard.tpl @@ -33,7 +33,7 @@ {{if $account_type}}{{/if}} - {{if $profile.network_name}}
{{$network}}
{{$profile.network_name nofilter}}
{{/if}} + {{if $profile.network_link}}
{{$network}}
{{$profile.network_link nofilter}}
{{/if}} {{if $location}}
{{$location}}
diff --git a/view/theme/vier/templates/profile_vcard.tpl b/view/theme/vier/templates/profile_vcard.tpl index 2acca2fd09..b37f5d2591 100644 --- a/view/theme/vier/templates/profile_vcard.tpl +++ b/view/theme/vier/templates/profile_vcard.tpl @@ -24,7 +24,7 @@ {{/if}} {{if $account_type}}{{/if}} - {{if $profile.network_name}}
{{$network}}
{{$profile.network_name nofilter}}
{{/if}} + {{if $profile.network_link}}
{{$network}}
{{$profile.network_link nofilter}}
{{/if}} {{if $location}}
{{$location}}