1
0
mirror of https://github.com/phpmyadmin/phpmyadmin.git synced 2026-10-29 21:24:44 +03:00
Files
phpmyadmin/templates/scripts.twig
William Desportes b475cfdd6c Use apply tag instead of filter and fix for loop
https://twig.symfony.com/doc/1.x/tags/apply.html
https://twig.symfony.com/doc/2.x/deprecated.html#tags
"The filter tag is deprecated in Twig 2.9. Use the apply tag instead (the Twig\TokenParser\FilterTokenParser classes is also deprecated)."
and "Adding an if condition on a for tag is deprecated in Twig 2.10. Use a filter filter or an "if" condition inside the "for" body instead (if your condition depends on a variable updated inside the loop)"
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-12-16 21:03:44 +01:00

25 lines
673 B
Twig

{% for file in files %}
<script data-cfasync="false" type="text/javascript" src="js/{{ file.filename }}
{{- '.php' in file.filename ? get_common(file.params|merge({'v': version})) : '?v=' ~ version|url_encode }}"></script>
{% endfor %}
<script data-cfasync="false" type="text/javascript">
// <![CDATA[
{{ code|raw }}
{% if files is not empty %}
AJAX.scriptHandler
{% for file in files %}
.add('{{ file.filename|escape_js_string }}', {{ file.has_onload ? 1 : 0 }})
{% endfor %}
;
$(function() {
{% for file in files %}
{% if file.has_onload %}
AJAX.fireOnload('{{ file.filename|escape_js_string }}');
{% endif %}
{% endfor %}
});
{% endif %}
// ]]>
</script>