mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-01 06:28:46 +02:00
Refactor "sanitize_identifier" and "sanitize_variable_name"custom TWIG functions to "sanitize(FOO)"
Note: FOO is one of \utils::ENUM_SANITIZATION_FILTER_XXX
This commit is contained in:
@@ -9,20 +9,23 @@
|
||||
{% for oTab in oUIBlock.GetSubBlocks() %}
|
||||
{% block iboTabContainerTab %}
|
||||
{% if oTab.GetType() == constant('TabManager::ENUM_TAB_TYPE_AJAX') %}
|
||||
<li class="ibo-tab-container--tab-header" data-role="ibo-tab-container--tab-header"
|
||||
data-tab-id="tab_{{ oTab.GetId()|sanitize_identifier }}" data-tab-type="{{ oTab.GetType() }}"
|
||||
data-cache="{{ oTab.GetCache() }}">
|
||||
<a href="{{ oTab.GetUrl() }}" class="ibo-tab-container--tab-toggler"
|
||||
data-role="ibo-tab-container--tab-toggler"><span>{{ oTab.GetTitle() }}</span></a>
|
||||
</li>
|
||||
{% elseif oTab.GetType() == constant('TabManager::ENUM_TAB_TYPE_HTML') %}
|
||||
<li class="ibo-tab-container--tab-header" data-role="ibo-tab-container--tab-header"
|
||||
data-tab-id="tab_{{ oTab.GetId()|sanitize_identifier }}" data-tab-type="{{ oTab.GetType() }}">
|
||||
<a href="#tab_{{ oTab.GetId()|sanitize_identifier }}" class="ibo-tab-container--tab-toggler" data-role="ibo-tab-container--tab-toggler">
|
||||
<span>{{ oTab.GetTitle() }}</span>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
<li class="ibo-tab-container--tab-header" data-role="ibo-tab-container--tab-header"
|
||||
data-tab-id="tab_{{ oTab.GetId()|sanitize(constant('utils::ENUM_SANITIZATION_FILTER_ELEMENT_IDENTIFIER')) }}"
|
||||
data-tab-type="{{ oTab.GetType() }}"
|
||||
data-cache="{{ oTab.GetCache() }}">
|
||||
<a href="{{ oTab.GetUrl() }}" class="ibo-tab-container--tab-toggler"
|
||||
data-role="ibo-tab-container--tab-toggler"><span>{{ oTab.GetTitle() }}</span></a>
|
||||
</li>
|
||||
{% elseif oTab.GetType() == constant('TabManager::ENUM_TAB_TYPE_HTML') %}
|
||||
<li class="ibo-tab-container--tab-header" data-role="ibo-tab-container--tab-header"
|
||||
data-tab-id="tab_{{ oTab.GetId()|sanitize(constant('utils::ENUM_SANITIZATION_FILTER_ELEMENT_IDENTIFIER')) }}"
|
||||
data-tab-type="{{ oTab.GetType() }}">
|
||||
<a href="#tab_{{ oTab.GetId()|sanitize(constant('utils::ENUM_SANITIZATION_FILTER_ELEMENT_IDENTIFIER')) }}"
|
||||
class="ibo-tab-container--tab-toggler" data-role="ibo-tab-container--tab-toggler">
|
||||
<span>{{ oTab.GetTitle() }}</span>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% endfor %}
|
||||
<li class="ibo-tab-container--extra-tabs-container ibo-tab-container--tab-header" data-role="ibo-tab-container--extra-tabs-container">
|
||||
@@ -30,11 +33,12 @@
|
||||
<span class="fas fa-ellipsis-v"></span>
|
||||
</a>
|
||||
<div class="ibo-tab-container--extra-tabs-list ibo-is-hidden" data-role="ibo-tab-container--extra-tabs-list">
|
||||
{% for oTab in oUIBlock.GetSubBlocks() %}
|
||||
<a href="#tab_{{ oTab.GetId()|sanitize_identifier }}" class="ibo-tab-container--extra-tab-toggler" data-role="ibo-tab-container--extra-tab-toggler">
|
||||
<span>{{ oTab.GetTitle() }}</span>
|
||||
</a>
|
||||
{% endfor %}
|
||||
{% for oTab in oUIBlock.GetSubBlocks() %}
|
||||
<a href="#tab_{{ oTab.GetId()|sanitize(constant('utils::ENUM_SANITIZATION_FILTER_ELEMENT_IDENTIFIER')) }}"
|
||||
class="ibo-tab-container--extra-tab-toggler" data-role="ibo-tab-container--extra-tab-toggler">
|
||||
<span>{{ oTab.GetTitle() }}</span>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</li>
|
||||
{% endblock %}
|
||||
@@ -45,30 +49,32 @@
|
||||
{% if not aPage.isPrintable %}
|
||||
<div id="{{ oUIBlock.GetId() }}--tab-container-list" class="ibo-tab-container--tab-container-list" data-role="ibo-tab-container--tab-container-list">
|
||||
{% for oTab in oUIBlock.GetSubBlocks() %}
|
||||
{% if oTab.GetType() == constant('TabManager::ENUM_TAB_TYPE_HTML') %}
|
||||
<div id="tab_{{ oTab.GetId()|sanitize_identifier }}" class="ibo-tab-container--tab-container">
|
||||
{% if oUIBlock.GetIsScrollable() %}
|
||||
<div class="ibo-tab-container--tab-container--label"><span>{{ oTab.GetTitle() }}</span></div>
|
||||
{% endif %}
|
||||
{{ render_block(oTab, {aPage: aPage}) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if oTab.GetType() == constant('TabManager::ENUM_TAB_TYPE_HTML') %}
|
||||
<div id="tab_{{ oTab.GetId()|sanitize(constant('utils::ENUM_SANITIZATION_FILTER_ELEMENT_IDENTIFIER')) }}"
|
||||
class="ibo-tab-container--tab-container">
|
||||
{% if oUIBlock.GetIsScrollable() %}
|
||||
<div class="ibo-tab-container--tab-container--label"><span>{{ oTab.GetTitle() }}</span></div>
|
||||
{% endif %}
|
||||
{{ render_block(oTab, {aPage: aPage}) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
|
||||
{% for oTab in oUIBlock.GetSubBlocks() %}
|
||||
<div id="tab_{{ oTab.GetId()|sanitize_identifier }}" class="ibo-tab-container--tab-container">
|
||||
<div class="ibo-title--text title">
|
||||
{{ oTab.GetTitle() }}
|
||||
</div>
|
||||
{% if oTab.GetType() == constant('TabManager::ENUM_TAB_TYPE_HTML') %}
|
||||
{{ render_block(oTab, {aPage: aPage}) }}
|
||||
{% else %}
|
||||
<div class="printable-tab-content"></div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% for oTab in oUIBlock.GetSubBlocks() %}
|
||||
<div id="tab_{{ oTab.GetId()|sanitize(constant('utils::ENUM_SANITIZATION_FILTER_ELEMENT_IDENTIFIER')) }}"
|
||||
class="ibo-tab-container--tab-container">
|
||||
<div class="ibo-title--text title">
|
||||
{{ oTab.GetTitle() }}
|
||||
</div>
|
||||
{% if oTab.GetType() == constant('TabManager::ENUM_TAB_TYPE_HTML') %}
|
||||
{{ render_block(oTab, {aPage: aPage}) }}
|
||||
{% else %}
|
||||
<div class="printable-tab-content"></div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user