-
Notifications
You must be signed in to change notification settings - Fork 59
/
Copy path_form-open.twig
23 lines (23 loc) · 1.19 KB
/
_form-open.twig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{% set formMethod = (formMethod == 'get') ? 'get' : 'post' %}
{% set tag = (tag is empty) ? '' : tag %}
<form {% if method == 'edit' or method == 'editiframe' -%}
id="ACEditor" name="ACEditor" enctype="multipart/form-data"
{%- endif %}action="{{ url({tag:tag,handler:method}) }}" method="{{ formMethod }}"
{%- if class is not empty %} class="{{ class }}"{% endif -%}
>
{%- if (method == 'edit' or method == 'editiframe') and
(config.password_for_editing is not empty and
request.post.password_for_editing is not empty and
not (request.post.password_for_editing is iterable)) ~%}
<input type="hidden" name="password_for_editing" value="{{ request.post.password_for_editing|e('html_attr') }}" />
{%- endif ~%}
{%- if not config.rewrite_mode and formMethod == 'get' ~%}
<input
type="hidden"
name="wiki"
value="{{ url({tag:tag ?? ''})|replace({
(url({tag:'not-existing-tag',handler:'iframe'})|slice(0,-'not-existing-tag/iframe'|length)):'',
(url({tag:'not-existing-tag'})|slice(0,-'not-existing-tag'|length)):''
}) }}"/>
{# TODO define MiniHref in TemplateEngine #}
{%- endif ~%}