Files
iTop/templates/base/layouts/tab-container/layout.js.twig
Molkobain eea8ceda63 Refactor "sanitize_identifier" and "sanitize_variable_name"custom TWIG functions to "sanitize(FOO)"
Note: FOO is one of \utils::ENUM_SANITIZATION_FILTER_XXX
2021-02-15 16:28:34 +01:00

19 lines
734 B
Twig

{# @copyright Copyright (C) 2010-2020 Combodo SARL #}
{# @license http://opensource.org/licenses/AGPL-3.0 #}
{% if not aPage.isPrintable %}
$('#{{ oUIBlock.GetId() }}').tab_container();
{% else %}
{% for oTab in oUIBlock.GetSubBlocks() %}
oHiddeableChapters['tab_{{ oTab.GetId()|sanitize(constant('utils::ENUM_SANITIZATION_FILTER_ELEMENT_IDENTIFIER')) }}'] = '{{ oTab.GetTitle()|escape('js') }}';
{% if oTab.GetType() == constant('TabManager::ENUM_TAB_TYPE_AJAX') %}
$.post('{{ oTab.GetUrl()|raw }}', {printable: '1'}, function (data)
{
$('#tab_{{ oTab.GetId()|sanitize(constant('utils::ENUM_SANITIZATION_FILTER_ELEMENT_IDENTIFIER')) }} > .printable-tab-content').append(data);
});
{% endif %}
{% endfor %}
{% endif %}