Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IBX-1543: Replaced deprecated twig functions #77

Merged
merged 21 commits into from
Dec 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
642a1e9
IBX-1543: Replaced ez_content_name function
ViniTou Nov 25, 2021
08a6fcf
IBX-1543: Replaced ez_render_field function
ViniTou Nov 25, 2021
0fa31ad
IBX-1543: Replaced ez_field_value function
ViniTou Nov 25, 2021
354f02b
IBX-1543: Replaced ez_field function
ViniTou Nov 25, 2021
36689b9
IBX-1543: Replaced ez_field_is_empty function
ViniTou Nov 25, 2021
2910275
IBX-1543: Replaced image related twig funtions
ViniTou Nov 29, 2021
a0569ff
IBX-1543: Replaced URL twig functions
ViniTou Nov 29, 2021
d98609a
IBX-1543: Replaced all time & date related Twig filters
ViniTou Nov 29, 2021
2f7b59e
IBX-1543: Replaced timediff filter
ViniTou Nov 29, 2021
226788d
IBX-1543: Replaced ez_render_field_definition_edit
ViniTou Nov 29, 2021
e2bedc0
IBX-1543: Replaced ez_udw_config function
ViniTou Nov 29, 2021
fcc49a9
IBX-1543: Replaced components twig functions
ViniTou Nov 29, 2021
0c8c56d
IBX-1543: Replaced ez_render_limitation_value function
ViniTou Nov 29, 2021
c049d6f
IBX-1543: Replaced ez_content_type_icon
ViniTou Nov 29, 2021
0dd4019
IBX-1543: Replaced rest of core extensions and filters function
ViniTou Nov 29, 2021
3abe249
IBX-1543: Replaced richtext related twig functions
ViniTou Nov 29, 2021
08219a8
IBX-1543: Dropped removed `getName` function implementation
ViniTou Nov 30, 2021
ea7daec
IBX-1543: Replaced ez_admin_ui_config global
ViniTou Nov 30, 2021
6739e85
IBX-1543: Replaced ez_user_settings function
ViniTou Nov 30, 2021
4fd7f27
IBX-1543: Replaced ez_richtext_config global
ViniTou Nov 30, 2021
906782f
IBX-1543: Fixed code style
ViniTou Dec 1, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@

{% set col_icon %}
<svg class="ibexa-icon ibexa-icon--small">
<use xlink:href="{{ ez_content_type_icon(bookmark.contentType.identifier) }}"></use>
<use xlink:href="{{ ibexa_content_type_icon(bookmark.contentType.identifier) }}"></use>
</svg>
{% endset %}

{% set col_name %}
<a href="{{ path('_ez_content_view', { 'contentId': bookmark.contentInfo.id, 'locationId': bookmark.id }) }}">
{{ ez_content_name(bookmark.contentInfo) }}
{{ ibexa_content_name(bookmark.contentInfo) }}
</a>
{% endset %}

Expand All @@ -41,7 +41,7 @@
{% for location in bookmark.pathLocations %}
{% if loop.revindex > 1 %}
<a href="{{ path('_ez_content_view', { 'contentId': location.contentId, 'locationId': location.id}) }}">
{{ ez_content_name(location.contentInfo) }}
{{ ibexa_content_name(location.contentInfo) }}
</a>
{% if loop.revindex > 2 %}/{% endif %}
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<h2 class="ibexa-login__actions-headline">{{ 'base.get_started'|trans|desc('Get started') }}</h2>

{% block login_form %}
{{ ez_render_component_group('login-form-before') }}
{{ ibexa_render_component_group('login-form-before') }}

<form action="{{ path( 'login_check' ) }}" method="post" role="form">
<fieldset>
Expand Down Expand Up @@ -67,7 +67,7 @@
</fieldset>
</form>

{{ ez_render_component_group('login-form-after') }}
{{ ibexa_render_component_group('login-form-after') }}
{% endblock %}

{{ encore_entry_script_tags('ezplatform-admin-ui-login-js', null, 'ezplatform') }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
{% block date %}
{% include '@ezdesign/ui/component/table/table_body_cell.html.twig' with {
class: 'ez-notifications-modal__description',
content: notification.created|ez_full_datetime,
content: notification.created|ibexa_full_datetime,
} %}
{% endblock %}
{% endset %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
<div class="ibexa-content-field">
<div class="ibexa-content-field__name">{{ field_definition.name }}:</div>
<div class="ibexa-content-field__value">
{% if ez_field_is_empty(content, field_definition.identifier) and field_definition.fieldTypeIdentifier is not same as('ezboolean') %}
{% if ibexa_field_is_empty(content, field_definition.identifier) and field_definition.fieldTypeIdentifier is not same as('ezboolean') %}
<em>{{ 'fieldview.field.empty'|trans({}, 'fieldview')|desc('This field is empty') }}</em>
{% else %}
{{ ez_render_field(content, field_definition.identifier, {location: location}) }}
{{ ibexa_render_field(content, field_definition.identifier, {location: location}) }}
{% endif %}
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
{% endblock %}

{% block form_before %}
{{ ez_render_component_group('content-create-form-before', {
{{ ibexa_render_component_group('content-create-form-before', {
'parent_location': parent_location,
'content_type': content_type,
'language': language
Expand All @@ -47,7 +47,7 @@
{% endblock %}

{% block form_after %}
{{ ez_render_component_group('content-create-form-after', {
{{ ibexa_render_component_group('content-create-form-after', {
'parent_location': parent_location,
'content_type': content_type,
'language': language
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

{% set col_raw %}
<svg class="ibexa-icon ibexa-icon--small">
<use xlink:href="{{ ez_content_type_icon(row.contentType.identifier) }}"></use>
<use xlink:href="{{ ibexa_content_type_icon(row.contentType.identifier) }}"></use>
</svg>
{% endset %}
{% set body_row_cols = body_row_cols|merge([{
Expand All @@ -58,9 +58,9 @@

{% set body_row_cols = body_row_cols|merge([
{ content: row.contentType.name },
{ content: ez_admin_ui_config.languages.mappings[row.versionInfo.initialLanguageCode].name },
{ content: ibexa_admin_ui_config.languages.mappings[row.versionInfo.initialLanguageCode].name },
{ content: row.versionInfo.versionNo },
{ content: row.versionInfo.modificationDate|ez_full_datetime },
{ content: row.versionInfo.modificationDate|ibexa_full_datetime },
]) %}

{% set col_raw %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% trans_default_domain 'content' %}

{% set is_autosave_enabled = ez_user_settings['autosave'] is same as('enabled') %}
{% set is_autosave_enabled = ibexa_user_settings['autosave'] is same as('enabled') %}
{% set form_has_autosave = form.autosave is defined %}

<div class="ibexa-content-edit-header">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{% if content is defined %}
{% if creator is defined and creator is not empty %}
<div>{{ 'content.details.created_by'|trans({'%name%': ez_content_name(creator)})|desc('Created by %name%') }}</div>
<div>{{ 'content.details.created_by'|trans({'%name%': ibexa_content_name(creator)})|desc('Created by %name%') }}</div>
{% endif %}

<div>{{ content.versionInfo.contentInfo.publishedDate|ez_full_datetime }}</div>
<div>{{ content.versionInfo.contentInfo.publishedDate|ibexa_full_datetime }}</div>
<div>
{{ 'content.details.content_id'|trans({'%contentId%': content.id})|desc('Content ID: %contentId%') }} |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
{% endblock %}

{% block form_before %}
{{ ez_render_component_group('content-edit-form-before', {
{{ ibexa_render_component_group('content-edit-form-before', {
'content': content,
'content_type': content_type,
'location': location,
Expand All @@ -50,7 +50,7 @@
{% endblock %}

{% block form_after %}
{{ ez_render_component_group('content-edit-form-after', {
{{ ibexa_render_component_group('content-edit-form-after', {
'content': content,
'content_type': content_type,
'location': location,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

{% set grouped_fields = grouped_fields|default([]) %}
{% set anchor_params = { items: grouped_fields|keys } %}
{% set is_autosave_enabled = ez_user_settings['autosave'] is same as('enabled') %}
{% set is_autosave_enabled = ibexa_user_settings['autosave'] is same as('enabled') %}
{% set form_has_autosave = form.autosave is defined %}
{% set default_form_templates = ez_admin_ui_config.contentEditFormTemplates %}
{% set default_form_templates = ibexa_admin_ui_config.contentEditFormTemplates %}
{% set form_templates = form_templates is defined ? default_form_templates|merge(form_templates) : default_form_templates %}
{% set extra_main_class = grouped_fields|length < 2
? 'ibexa-main-container--without-anchor-menu-items'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
{% set content_tree_width_style = "width: #{content_tree_width}px;" %}

<div class="ibexa-content-tree-container"
data-tree-root-location-id="{{ content_tree_module_root|default(ez_admin_ui_config['contentTree']['treeRootLocationId']) }}"
data-tree-root-location-id="{{ content_tree_module_root|default(ibexa_admin_ui_config['contentTree']['treeRootLocationId']) }}"
data-current-location-path="{{ location_path|default('') }}"
style="{{ content_tree_width_style }}"
>
Expand All @@ -33,7 +33,7 @@
{% for path_location in path_locations %}
{% if not loop.last %}
{% set items = items|merge([{
'value': ez_content_name(path_location.contentInfo),
'value': ibexa_content_name(path_location.contentInfo),
'url': path('_ez_content_view', {
'contentId': path_location.contentId,
'locationId': path_location.id
Expand All @@ -42,7 +42,7 @@
{% endif %}
{% endfor %}

{% set items = items|merge([{ 'value': ez_content_name(content) }]) %}
{% set items = items|merge([{ 'value': ibexa_content_name(content) }]) %}

{% include '@ezdesign/ui/breadcrumbs.html.twig' with { items: items } %}
{% endblock %}
Expand All @@ -63,7 +63,7 @@
{% if form_location_trash is defined and form_user_delete is not defined %}
{% include '@ezdesign/content/modal/location_trash.html.twig' with {
'form': form_location_trash,
'content_name': ez_content_name(content)
'content_name': ibexa_content_name(content)
} only %}
{% endif %}
{% if form_user_delete is defined %}
Expand All @@ -79,7 +79,7 @@
{% set icon_name = content_type.identifier %}
{% set content_type_name = content_type.name %}
{% embed '@ezdesign/ui/page_title.html.twig' with {
title: ez_content_name(content),
title: ibexa_content_name(content),
} %}
{% block top_side %}
{% if location is defined and location_is_bookmarked is defined %}
Expand All @@ -98,7 +98,7 @@
</svg>
{% elseif content_type_identifier is defined %}
<svg class="ibexa-icon ibexa-icon--small ibexa-icon--base-dark ibexa-icon--{{ content_type_identifier }}">
<use xlink:href="{{ ez_content_type_icon(content_type_identifier) }}"></use>
<use xlink:href="{{ ibexa_content_type_icon(content_type_identifier) }}"></use>
</svg>
{% endif %}
{{ content_type_name }}
Expand All @@ -118,7 +118,7 @@
} only %}
</div>
{% endif %}
{{ ez_render_component_group(
{{ ibexa_render_component_group(
'location-view-content-alerts',
{
'versionInfo': content.versionInfo,
Expand All @@ -141,7 +141,7 @@
<div class="panel panel-primary">
<div class="panel-body">
{# 'is_location_visible': location.invisible - param deprecated since EZP-32395 #}
{{ ez_render_component_group('location-view-tab-groups', {
{{ ibexa_render_component_group('location-view-tab-groups', {
'content': content,
'location': location,
'contentType': content_type,
Expand All @@ -157,7 +157,7 @@
{% if content_type.isContainer %}
{{ form_start(form_subitems_content_edit, { 'action': path('ezplatform.content.edit'), 'attr': { 'hidden': 'hidden' }}) }}
{{ form_end(form_subitems_content_edit) }}
{% set udwConfigSingle = ez_udw_config('single_container', {}) %}
{% set udwConfigSingle = ibexa_udw_config('single_container', {}) %}
<div class="ez-sil"
data-location="{{ location.id }}"
data-mfu-create-permissions-config="{{ subitems_module.content_create_permissions_for_mfu|json_encode() }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@

{% include '@ezdesign/ui/component/table/table_body_cell.html.twig' with { content: name_cell_raw, raw: true } %}
{% include '@ezdesign/ui/component/table/table_body_cell.html.twig' with { content: contentType.getName() } %}
{% include '@ezdesign/ui/component/table/table_body_cell.html.twig' with { content: content.versionInfo.creationDate|ez_short_datetime } %}
{% include '@ezdesign/ui/component/table/table_body_cell.html.twig' with { content: content.versionInfo.creationDate|ibexa_short_datetime } %}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
{% form_theme form_location_update '@ezdesign/ui/form_fields.html.twig' %}

{% set body_row_cols = [
{ content: creator is not empty ? ez_content_name(creator) : 'tab.details.creator.not_found'|trans|desc('Can\'t fetch creator') },
{ content: last_contributor is not empty ? ez_content_name(last_contributor) : 'tab.details.last_contributor.not_found'|trans|desc('Can\'t fetch last contributor') },
{ content: creator is not empty ? ibexa_content_name(creator) : 'tab.details.creator.not_found'|trans|desc('Can\'t fetch creator') },
{ content: last_contributor is not empty ? ibexa_content_name(last_contributor) : 'tab.details.last_contributor.not_found'|trans|desc('Can\'t fetch last contributor') },
{ content: version_info.versionNo },
] %}
{% set col_raw %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{{ form_widget(form.swap, {'attr': {
'disabled': not can_swap,
'class': 'btn ibexa-btn ibexa-btn--secondary ibexa-btn--udw-swap ml-5',
'data-udw-config': ez_udw_config('single_container', {})
'data-udw-config': ibexa_udw_config('single_container', {})
}}) }}
{{ form_widget(form.current_location) }}
{{ form_widget(form.new_location) }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@

{% macro table_header_tools(form_add, form_remove, can_add) %}
<button
data-udw-config="{{ ez_udw_config('add_location', {}) }}"
data-udw-config="{{ ibexa_udw_config('add_location', {}) }}"
class="btn ibexa-btn ibexa-btn--ghost ibexa-btn--small ibexa-btn--no-text ibexa-btn--udw-add"
title="{{ 'tab.locations.action.add'|trans|desc('Add Location') }}"
{{ not can_add ? 'disabled' }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@

{% set col_raw %}
{%- if policy.role_assignment.usergroup is defined -%}
{{ ez_content_name( policy.role_assignment.usergroup ) }}
{{ ibexa_content_name( policy.role_assignment.usergroup ) }}
{%- else -%}
{{ ez_content_name( policy.role_assignment.user ) }}
{{ ibexa_content_name( policy.role_assignment.user ) }}
{%- endif -%}
{% endset %}
{% set body_row_cols = body_row_cols|merge([{
Expand All @@ -44,7 +44,7 @@
>
{{ ('policy.limitation.identifier.' ~ limitation.identifier|lower)|trans({'%identifier%': limitation.identifier}, 'ezplatform_content_forms_policies')|desc('%identifier%') }}:
</span>
{{ ez_render_limitation_value(limitation, {'template': '@ezdesign/content/tab/policies/limitation_values.html.twig'}) }}
{{ ibexa_render_limitation_value(limitation, {'template': '@ezdesign/content/tab/policies/limitation_values.html.twig'}) }}
</li>
{%- endfor -%}
</ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
{% set col_raw %}
{% if destination.mainLocationId is not null %}
<a href="{{ path('_ez_content_view', { 'contentId': destination.id, 'locationId': relation.resolvedDestinationLocation.id }) }}">
{{ ez_content_name(destination) }}
{{ ibexa_content_name(destination) }}
</a>
{% else %}
{{ ez_content_name(destination) }}
{{ ibexa_content_name(destination) }}
{% endif %}
{% endset %}
{% set body_row_cols = body_row_cols|merge([{
Expand Down Expand Up @@ -43,7 +43,7 @@

{% include '@ezdesign/ui/component/table/table.html.twig' with {
headline: 'tab.relations.related_content'|trans({
'%contentName%' : ez_content_name(content)
'%contentName%' : ibexa_content_name(content)
})|desc('Related content (Content items used by %contentName%)'),
head_cols: [
{ content: 'tab.relations.table.name'|trans()|desc('Name') },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
{% set col_raw %}
{% if source.mainLocationId is not null %}
<a href="{{ path('_ez_content_view', { 'contentId': source.id, 'locationId': relation.resolvedSourceLocation.id }) }}">
{{ ez_content_name(source) }}
{{ ibexa_content_name(source) }}
</a>
{% else %}
{{ ez_content_name(source) }}
{{ ibexa_content_name(source) }}
{% endif %}
{% endset %}
{% set body_row_cols = body_row_cols|merge([{
Expand Down Expand Up @@ -54,7 +54,7 @@

{% include '@ezdesign/ui/component/table/table.html.twig' with {
headline: 'tab.relations.reverse_relations'|trans({
'%contentName%' : ez_content_name(content)
'%contentName%' : ibexa_content_name(content)
})|desc('Reverse relations (Content items using %contentName%)'),
head_cols: [
{ content: 'tab.relations.table.name'|trans()|desc('Name') },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
{% set col_raw %}
{%- set limitation = role_assignment.rolelimitation -%}
{%- if limitation -%}
{{ ez_render_limitation_value(limitation, {'template': '@ezdesign/content/tab/roles/limitation_values.html.twig'}) }}
{{ ibexa_render_limitation_value(limitation, {'template': '@ezdesign/content/tab/roles/limitation_values.html.twig'}) }}
<span title="{{ 'policy.limitation.identifier_tooltip' | trans({'%identifier%': limitation.identifier})|desc('"%identifier%" Limitation') }}">
({{ ('policy.limitation.identifier.' ~ limitation.identifier|lower)|trans({'%identifier%': limitation.identifier}, 'ezplatform_content_forms_policies')|desc('%identifier%') }})
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

{% set col_raw %}
{% for language_code in custom_url.languageCodes %}
{{ ez_admin_ui_config.languages.mappings[language_code].name }}<br>
{{ ibexa_admin_ui_config.languages.mappings[language_code].name }}<br>
{% endfor %}
{% endset %}
{% set body_row_cols = body_row_cols|merge([{
Expand All @@ -41,7 +41,7 @@
{% endif %}

{% embed '@ezdesign/ui/component/table/table.html.twig' with {
headline: 'tab.urls.custom_url_aliases'|trans({'%contentName%' : ez_content_name(content)})|desc('Custom URL aliases for %contentName%'),
headline: 'tab.urls.custom_url_aliases'|trans({'%contentName%' : ibexa_content_name(content)})|desc('Custom URL aliases for %contentName%'),
head_cols: [
{ has_checkbox: true },
{ content: 'tab.urls.url'|trans|desc('URL') },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
]) %}

{% set col_raw %}
{% for language_code in system_url.languageCodes %}{{ ez_admin_ui_config.languages.mappings[language_code].name }}<br>{% endfor %}
{% for language_code in system_url.languageCodes %}{{ ibexa_admin_ui_config.languages.mappings[language_code].name }}<br>{% endfor %}
{% endset %}
{% set body_row_cols = body_row_cols|merge([{
content: col_raw,
Expand Down