Merge pull request #13019 from MrPetovan/bug/deprecated

Move calls to json_encode from Smarty templates to variable lists
This commit is contained in:
Tobias Diekershoff 2023-04-23 08:07:38 +02:00 committed by GitHub
commit 8b1887fc66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 8 deletions

View File

@ -66,7 +66,7 @@ class ACL
$tpl = Renderer::getMarkupTemplate('acl/message_recipient.tpl'); $tpl = Renderer::getMarkupTemplate('acl/message_recipient.tpl');
$o = Renderer::replaceMacros($tpl, [ $o = Renderer::replaceMacros($tpl, [
'$contacts' => $contacts, '$contacts' => json_encode($contacts),
'$selected' => $selected, '$selected' => $selected,
]); ]);
@ -327,9 +327,9 @@ class ACL
'$emtitle' => DI::l10n()->t('Example: bob@example.com, mary@example.com'), '$emtitle' => DI::l10n()->t('Example: bob@example.com, mary@example.com'),
'$jotnets_summary' => DI::l10n()->t('Connectors'), '$jotnets_summary' => DI::l10n()->t('Connectors'),
'$visibility' => $visibility, '$visibility' => $visibility,
'$acl_contacts' => $acl_contacts, '$acl_contacts' => json_encode($acl_contacts),
'$acl_groups' => $acl_groups, '$acl_groups' => json_encode($acl_groups),
'$acl_list' => $acl_list, '$acl_list' => json_encode($acl_list),
'$contact_allow' => implode(',', $default_permissions['allow_cid']), '$contact_allow' => implode(',', $default_permissions['allow_cid']),
'$group_allow' => implode(',', $default_permissions['allow_gid']), '$group_allow' => implode(',', $default_permissions['allow_gid']),
'$contact_deny' => implode(',', $default_permissions['deny_cid']), '$contact_deny' => implode(',', $default_permissions['deny_cid']),

View File

@ -126,19 +126,19 @@
// Custom visibility tags inputs // Custom visibility tags inputs
let acl_groups = new Bloodhound({ let acl_groups = new Bloodhound({
local: {{$acl_groups|@json_encode nofilter}}, local: {{$acl_groups nofilter}},
identify: function(obj) { return obj.type + '-' + obj.id.toString(); }, identify: function(obj) { return obj.type + '-' + obj.id.toString(); },
datumTokenizer: Bloodhound.tokenizers.obj.whitespace(['name']), datumTokenizer: Bloodhound.tokenizers.obj.whitespace(['name']),
queryTokenizer: Bloodhound.tokenizers.whitespace, queryTokenizer: Bloodhound.tokenizers.whitespace,
}); });
let acl_contacts = new Bloodhound({ let acl_contacts = new Bloodhound({
local: {{$acl_contacts|@json_encode nofilter}}, local: {{$acl_contacts nofilter}},
identify: function(obj) { return obj.type + '-' + obj.id.toString(); }, identify: function(obj) { return obj.type + '-' + obj.id.toString(); },
datumTokenizer: Bloodhound.tokenizers.obj.whitespace(['name', 'addr']), datumTokenizer: Bloodhound.tokenizers.obj.whitespace(['name', 'addr']),
queryTokenizer: Bloodhound.tokenizers.whitespace, queryTokenizer: Bloodhound.tokenizers.whitespace,
}); });
let acl = new Bloodhound({ let acl = new Bloodhound({
local: {{$acl_list|@json_encode nofilter}}, local: {{$acl_list nofilter}},
identify: function(obj) { return obj.type + '-' + obj.id.toString(); }, identify: function(obj) { return obj.type + '-' + obj.id.toString(); },
datumTokenizer: Bloodhound.tokenizers.obj.whitespace(['name', 'addr']), datumTokenizer: Bloodhound.tokenizers.obj.whitespace(['name', 'addr']),
queryTokenizer: Bloodhound.tokenizers.whitespace, queryTokenizer: Bloodhound.tokenizers.whitespace,

View File

@ -9,7 +9,7 @@
let $recipient_input = $('[name="recipient"]'); let $recipient_input = $('[name="recipient"]');
let acl = new Bloodhound({ let acl = new Bloodhound({
local: {{$contacts|@json_encode nofilter}}, local: {{$contacts nofilter}},
identify: function(obj) { return obj.id.toString(); }, identify: function(obj) { return obj.id.toString(); },
datumTokenizer: Bloodhound.tokenizers.obj.whitespace(['name', 'addr']), datumTokenizer: Bloodhound.tokenizers.obj.whitespace(['name', 'addr']),
queryTokenizer: Bloodhound.tokenizers.whitespace, queryTokenizer: Bloodhound.tokenizers.whitespace,