26 lines
691 B
Plaintext
26 lines
691 B
Plaintext
|
<?php
|
||
|
{%- from "nextcloud/map.jinja" import nextcloud with context %}
|
||
|
{%- macro mac(value,last) -%}
|
||
|
{%- if value is mapping %}
|
||
|
{%- for k, v in value.items() %}
|
||
|
"{{ k }}" => "{{ v }}"{% if last %},{% else %}{% endif %}
|
||
|
{%- endfor %}
|
||
|
{%- elif value is sequence and value is not string -%}
|
||
|
array(
|
||
|
{%- for value2 in value %}
|
||
|
{{ mac(value2,loop.last) }}
|
||
|
{%- endfor -%}
|
||
|
),
|
||
|
{%- elif value is true or value is false -%}
|
||
|
{{ value|lower }},
|
||
|
{%- elif value is number -%}
|
||
|
{{ value }},
|
||
|
{%- else -%}
|
||
|
"{{ value }}",
|
||
|
{%- endif %}
|
||
|
{%- endmacro %}
|
||
|
$CONFIG = array(
|
||
|
{%- for key, value in nextcloud.config.items() %}
|
||
|
"{{ key }}" => {{ mac(value,loop.last) }}
|
||
|
{%- endfor %}
|
||
|
);
|