add more subnavigation for customer-email section; correctly display next_to elements when type=label in formfields
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -285,7 +285,26 @@ if ($page == 'overview' || $page == 'emails') {
|
|||||||
|
|
||||||
UI::view('user/form.html.twig', [
|
UI::view('user/form.html.twig', [
|
||||||
'formaction' => $linker->getLink(['section' => 'email', 'id' => $id]),
|
'formaction' => $linker->getLink(['section' => 'email', 'id' => $id]),
|
||||||
'formdata' => $account_add_data['emails_addaccount']
|
'formdata' => $account_add_data['emails_addaccount'],
|
||||||
|
'actions_links' => [
|
||||||
|
[
|
||||||
|
'class' => 'btn-secondary',
|
||||||
|
'href' => $linker->getLink([
|
||||||
|
'section' => 'email',
|
||||||
|
'page' => 'emails',
|
||||||
|
'action' => 'edit',
|
||||||
|
'id' => $id
|
||||||
|
]),
|
||||||
|
'label' => lng('emails.emails_edit'),
|
||||||
|
'icon' => 'fa-solid fa-pen'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'class' => 'btn-secondary',
|
||||||
|
'href' => $linker->getLink(['section' => 'email', 'page' => 'emails']),
|
||||||
|
'label' => lng('menue.email.emails'),
|
||||||
|
'icon' => 'fa-solid fa-envelope'
|
||||||
|
]
|
||||||
|
],
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -324,7 +343,26 @@ if ($page == 'overview' || $page == 'emails') {
|
|||||||
|
|
||||||
UI::view('user/form.html.twig', [
|
UI::view('user/form.html.twig', [
|
||||||
'formaction' => $linker->getLink(['section' => 'email', 'id' => $id]),
|
'formaction' => $linker->getLink(['section' => 'email', 'id' => $id]),
|
||||||
'formdata' => $account_changepw_data['emails_accountchangepasswd']
|
'formdata' => $account_changepw_data['emails_accountchangepasswd'],
|
||||||
|
'actions_links' => [
|
||||||
|
[
|
||||||
|
'class' => 'btn-secondary',
|
||||||
|
'href' => $linker->getLink([
|
||||||
|
'section' => 'email',
|
||||||
|
'page' => 'emails',
|
||||||
|
'action' => 'edit',
|
||||||
|
'id' => $id
|
||||||
|
]),
|
||||||
|
'label' => lng('emails.emails_edit'),
|
||||||
|
'icon' => 'fa-solid fa-pen'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'class' => 'btn-secondary',
|
||||||
|
'href' => $linker->getLink(['section' => 'email', 'page' => 'emails']),
|
||||||
|
'label' => lng('menue.email.emails'),
|
||||||
|
'icon' => 'fa-solid fa-envelope'
|
||||||
|
]
|
||||||
|
],
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -358,7 +396,26 @@ if ($page == 'overview' || $page == 'emails') {
|
|||||||
|
|
||||||
UI::view('user/form.html.twig', [
|
UI::view('user/form.html.twig', [
|
||||||
'formaction' => $linker->getLink(['section' => 'email', 'id' => $id]),
|
'formaction' => $linker->getLink(['section' => 'email', 'id' => $id]),
|
||||||
'formdata' => $quota_edit_data['emails_accountchangequota']
|
'formdata' => $quota_edit_data['emails_accountchangequota'],
|
||||||
|
'actions_links' => [
|
||||||
|
[
|
||||||
|
'class' => 'btn-secondary',
|
||||||
|
'href' => $linker->getLink([
|
||||||
|
'section' => 'email',
|
||||||
|
'page' => 'emails',
|
||||||
|
'action' => 'edit',
|
||||||
|
'id' => $id
|
||||||
|
]),
|
||||||
|
'label' => lng('emails.emails_edit'),
|
||||||
|
'icon' => 'fa-solid fa-pen'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'class' => 'btn-secondary',
|
||||||
|
'href' => $linker->getLink(['section' => 'email', 'page' => 'emails']),
|
||||||
|
'label' => lng('menue.email.emails'),
|
||||||
|
'icon' => 'fa-solid fa-envelope'
|
||||||
|
]
|
||||||
|
],
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -425,7 +482,26 @@ if ($page == 'overview' || $page == 'emails') {
|
|||||||
|
|
||||||
UI::view('user/form.html.twig', [
|
UI::view('user/form.html.twig', [
|
||||||
'formaction' => $linker->getLink(['section' => 'email', 'id' => $id]),
|
'formaction' => $linker->getLink(['section' => 'email', 'id' => $id]),
|
||||||
'formdata' => $forwarder_add_data['emails_addforwarder']
|
'formdata' => $forwarder_add_data['emails_addforwarder'],
|
||||||
|
'actions_links' => [
|
||||||
|
[
|
||||||
|
'class' => 'btn-secondary',
|
||||||
|
'href' => $linker->getLink([
|
||||||
|
'section' => 'email',
|
||||||
|
'page' => 'emails',
|
||||||
|
'action' => 'edit',
|
||||||
|
'id' => $id
|
||||||
|
]),
|
||||||
|
'label' => lng('emails.emails_edit'),
|
||||||
|
'icon' => 'fa-solid fa-pen'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'class' => 'btn-secondary',
|
||||||
|
'href' => $linker->getLink(['section' => 'email', 'page' => 'emails']),
|
||||||
|
'label' => lng('menue.email.emails'),
|
||||||
|
'icon' => 'fa-solid fa-envelope'
|
||||||
|
]
|
||||||
|
],
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,10 @@
|
|||||||
{% if em %}
|
{% if em %}
|
||||||
<mark>
|
<mark>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{ field.label.title|raw }}{% if field.mandatory is defined and field.mandatory %}<span class="text-danger">*</span>{% endif %}
|
{{ field.label.title|raw }}
|
||||||
|
{% if field.mandatory is defined and field.mandatory %}
|
||||||
|
<span class="text-danger">*</span>
|
||||||
|
{% endif %}
|
||||||
{% if em %}
|
{% if em %}
|
||||||
</mark>
|
</mark>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -19,7 +22,10 @@
|
|||||||
{% if em %}
|
{% if em %}
|
||||||
<mark>
|
<mark>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{ field.label|raw }}{% if field.mandatory is defined and field.mandatory %}<span class="text-danger">*</span>{% endif %}
|
{{ field.label|raw }}
|
||||||
|
{% if field.mandatory is defined and field.mandatory %}
|
||||||
|
<span class="text-danger">*</span>
|
||||||
|
{% endif %}
|
||||||
{% if em %}
|
{% if em %}
|
||||||
</mark>
|
</mark>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -66,18 +72,18 @@
|
|||||||
{# installation specific format #}
|
{# installation specific format #}
|
||||||
{% macro field(id, field, norow = true, nohide = false, em = false) %}
|
{% macro field(id, field, norow = true, nohide = false, em = false) %}
|
||||||
{% if field.type == 'checkbox' %}
|
{% if field.type == 'checkbox' %}
|
||||||
<div class="form-check form-switch mb-3">
|
<div class="form-check form-switch mb-3">
|
||||||
<input type="hidden" value="0" name="{{ id }}" />
|
<input type="hidden" value="0" name="{{ id }}"/>
|
||||||
<input type="checkbox" {% if (field.visible is defined and field.visible == false) or (field.disabled is defined and field.disabled == true) %} disabled {% endif %} value="{{ field.value }}" id="{{ id }}" name="{{ id }}" class="form-check-input {% if field.valid is defined and field.valid == false %}is-invalid{% endif %}" {% if field.checked is defined and field.checked == 1 %} checked="checked" {% endif %}>
|
<input type="checkbox" {% if (field.visible is defined and field.visible == false) or (field.disabled is defined and field.disabled == true) %} disabled {% endif %} value="{{ field.value }}" id="{{ id }}" name="{{ id }}" class="form-check-input {% if field.valid is defined and field.valid == false %}is-invalid{% endif %}" {% if field.checked is defined and field.checked == 1 %} checked="checked" {% endif %}>
|
||||||
<label for="{{ id }}" class="form-check-label">{{ field.label|raw }}</label>
|
<label for="{{ id }}" class="form-check-label">{{ field.label|raw }}</label>
|
||||||
</div>
|
</div>
|
||||||
{% elseif field.type == 'hidden' %}
|
{% elseif field.type == 'hidden' %}
|
||||||
{{ _self.fieldrow(id, field, norow, nohide, em) }}
|
{{ _self.fieldrow(id, field, norow, nohide, em) }}
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="form-floating mb-3">
|
<div class="form-floating mb-3">
|
||||||
{{ _self.fieldrow(id, field, norow, nohide, em) }}
|
{{ _self.fieldrow(id, field, norow, nohide, em) }}
|
||||||
<label for="{{ id }}" class="form-label">{{ field.label|raw }}</label>
|
<label for="{{ id }}" class="form-label">{{ field.label|raw }}</label>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
@@ -85,7 +91,7 @@
|
|||||||
{% if field.is_array is defined and field.is_array == 1 and field.values is not empty %}
|
{% if field.is_array is defined and field.is_array == 1 and field.values is not empty %}
|
||||||
{% for subfield in field.values %}
|
{% for subfield in field.values %}
|
||||||
<div class="form-check form-switch">
|
<div class="form-check form-switch">
|
||||||
<input type="checkbox" {% if (field.visible is defined and field.visible == false) or (field.disabled is defined and field.disabled == true) %} disabled {% endif %} value="{{ subfield.value }}" name="{{ id }}[]" class="form-check-input" {% if field.value is defined and subfield.value in field.value %} checked="checked" {% endif %}{% if field.mandatory is defined and field.mandatory %} required {% endif %}>
|
<input type="checkbox" {% if (field.visible is defined and field.visible == false) or (field.disabled is defined and field.disabled == true) %} disabled {% endif %} value="{{ subfield.value }}" name="{{ id }}[]" class="form-check-input" {% if field.value is defined and subfield.value in field.value %} checked="checked" {% endif %} {% if field.mandatory is defined and field.mandatory %} required {% endif %}>
|
||||||
<label class="form-check-label">
|
<label class="form-check-label">
|
||||||
{{ subfield.label|raw }}
|
{{ subfield.label|raw }}
|
||||||
</label>
|
</label>
|
||||||
@@ -93,8 +99,8 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="form-check form-switch">
|
<div class="form-check form-switch">
|
||||||
<input type="hidden" value="0" name="{{ id }}" />
|
<input type="hidden" value="0" name="{{ id }}"/>
|
||||||
<input type="checkbox" {% if (field.visible is defined and field.visible == false) or (field.disabled is defined and field.disabled == true) %} disabled {% endif %} value="{{ field.value }}" id="{{ id }}" name="{{ id }}" class="form-check-input {% if field.valid is defined and field.valid == false %}is-invalid{% endif %}" {% if field.checked is defined and field.checked == 1 %} checked="checked" {% endif %}{% if field.mandatory is defined and field.mandatory %} required {% endif %}>
|
<input type="checkbox" {% if (field.visible is defined and field.visible == false) or (field.disabled is defined and field.disabled == true) %} disabled {% endif %} value="{{ field.value }}" id="{{ id }}" name="{{ id }}" class="form-check-input {% if field.valid is defined and field.valid == false %}is-invalid{% endif %}" {% if field.checked is defined and field.checked == 1 %} checked="checked" {% endif %} {% if field.mandatory is defined and field.mandatory %} required {% endif %}>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
@@ -116,18 +122,14 @@
|
|||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
{% macro plain(id, field) %}
|
{% macro plain(id, field) %}
|
||||||
|
<input type="text" readonly class="form-control-plaintext" id="{{ id }}" name="{{ id }}" value="{{ field.value|raw }}">
|
||||||
{% if field.next_to is defined %}
|
{% if field.next_to is defined %}
|
||||||
<div class="input-group">
|
{% for nid, nfield in field.next_to %}
|
||||||
{% endif %}
|
{% if nfield.next_to_prefix is defined %}
|
||||||
<input type="text" readonly class="form-control-plaintext" id="{{ id }}" name="{{ id }}" value="{{ field.value|raw }}">
|
<span class="input-group-text">{{ nfield.next_to_prefix }}</span>
|
||||||
{% if field.next_to is defined %}
|
{% endif %}
|
||||||
{% for nid, nfield in field.next_to %}
|
{{ _self.fieldrow(nid, nfield, true) }}
|
||||||
{% if nfield.next_to_prefix is defined %}
|
{% endfor %}
|
||||||
<span class="input-group-text">{{ nfield.next_to_prefix }}</span>
|
|
||||||
{% endif %}
|
|
||||||
{{ _self.fieldrow(nid, nfield, true) }}
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user