Creates the Twig\PmaGlobalVariable class to handle the 'pma' Twig global
variable.
The idea of this global variable is to automatically inject in all
templates some useful information.
For now it only includes `pma.version` to get the phpMyAdmin version
and `pma.text_dir` to get the text direction ('ltr' or 'rtl').
Adding new variables to the `pma` global variable should be done with
caution.
- https://twig.symfony.com/doc/3.x/advanced.html#globals
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
25 lines
830 B
Twig
25 lines
830 B
Twig
{% for file in files %}
|
|
<script data-cfasync="false" src="{{ base_dir }}{{ not (file.filename starts with 'index.php') ? 'js/' -}}
|
|
{{- file.filename starts with 'vendor/' or file.filename starts with 'index.php' ? file.filename : 'dist/' ~ file.filename -}}
|
|
{{- '.php' in file.filename ? get_common(file.params|merge({'v': pma.version})) : '?v=' ~ pma.version|url_encode }}"></script>
|
|
{% endfor %}
|
|
|
|
<script data-cfasync="false">
|
|
// <![CDATA[
|
|
{{ code|raw }}
|
|
{% if files is not empty %}
|
|
{% for file in files %}
|
|
window.AJAX.scriptHandler.add('{{ file.filename|escape('js') }}', {{ file.has_onload ? 'true' : 'false' }});
|
|
{% endfor %}
|
|
|
|
$(function() {
|
|
{% for file in files %}
|
|
{% if file.has_onload %}
|
|
window.AJAX.fireOnload('{{ file.filename|escape('js') }}');
|
|
{% endif %}
|
|
{% endfor %}
|
|
});
|
|
{% endif %}
|
|
// ]]>
|
|
</script>
|