{# # ------------------------------------------------------------------------- # News plugin for GLPI # ------------------------------------------------------------------------- # # LICENSE # # This file is part of News. # # News is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # News is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with News. If not, see . # ------------------------------------------------------------------------- # @copyright Copyright (C) 2015-2022 by News plugin team. # @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html # @link https://github.com/pluginsGLPI/news # ------------------------------------------------------------------------- #} {% macro checkboxesField(name, possible_values, current_values, label = '', options = {}) %} {% import 'components/form/fields_macros.html.twig' as fields %} {% set field %}
{% for key, label in possible_values %} {% endfor %}
{% endset %} {{ fields.field(name, field, label, options) }} {% endmacro %} {% macro iconField(name, main_values, value, label = '', options = {}) %} {% import 'components/form/fields_macros.html.twig' as fields %} {% set field %}
{% if options.display_emptychoice|default(false) %} {% endif %} {% for key, label in main_values %} {% endfor %}
{% endset %} {{ fields.field(name, field, label, options) }} {% endmacro %} {% macro colorField(name, colors, value, label = '', options = {}) %} {% import 'components/form/fields_macros.html.twig' as fields %} {% set field %}
{% for color, label in colors %}
{% endfor %}
{% endset %} {{ fields.field(name, field, label, options) }} {% endmacro %}