M config/versions.yaml => config/versions.yaml +2 -1
@@ 1,6 1,6 @@
core:
grav:
- version: 1.7.47
+ version: 1.7.48
schema: 1.7.0_2020-11-20_1
history:
- { version: 1.7.10, date: '2021-04-07 18:02:54' }
@@ 46,3 46,4 @@ core:
- { version: 1.7.45, date: '2024-03-18 20:56:53' }
- { version: 1.7.46, date: '2024-05-16 12:37:34' }
- { version: 1.7.47, date: '2024-10-23 18:28:09' }
+ - { version: 1.7.48, date: '2024-10-28 22:22:16' }
M plugins/form/CHANGELOG.md => plugins/form/CHANGELOG.md +7 -0
@@ 1,3 1,10 @@
+# v7.4.2
+## 10/28/2024
+
+1. [](#improved)
+ * Enhanced the `input` tag to include a disabled attribute [$601](https://github.com/getgrav/grav-plugin-form/pull/601)
+ * Updated logging methods to support Monolog2+
+
# v7.4.1
## 10/22/2024
M plugins/form/blueprints.yaml => plugins/form/blueprints.yaml +1 -1
@@ 1,7 1,7 @@
name: Form
slug: form
type: plugin
-version: 7.4.1
+version: 7.4.2
description: Enables forms handling and processing
icon: check-square
author:
M plugins/form/form.php => plugins/form/form.php +4 -4
@@ 506,7 506,7 @@ class FormPlugin extends Plugin
'message' => $message
]));
- $this->grav['log']->addWarning('Form reCAPTCHA Errors: [' . $uri->route() . '] ' . json_encode($errors));
+ $this->grav['log']->warning('Form reCAPTCHA Errors: [' . $uri->route() . '] ' . json_encode($errors));
$event->stopPropagation();
@@ 556,7 556,7 @@ class FormPlugin extends Plugin
'message' => $message
]));
- $this->grav['log']->addWarning('Form Turnstile invalid: [' . $uri->route() . '] ' . json_encode($content));
+ $this->grav['log']->warning('Form Turnstile invalid: [' . $uri->route() . '] ' . json_encode($content));
$event->stopPropagation();
return;
}
@@ 1262,7 1262,7 @@ class FormPlugin extends Plugin
if ($forms) {
$this->forms = Utils::arrayMergeRecursiveUnique($this->forms, $forms);
if ($this->config()['debug']) {
- $this->grav['log']->addDebug(sprintf("<<<< Loaded cached forms: %s\n%s", $this->getFormCacheId(), $this->arrayToString($this->forms)));
+ $this->grav['log']->debug(sprintf("<<<< Loaded cached forms: %s\n%s", $this->getFormCacheId(), $this->arrayToString($this->forms)));
}
}
@@ 1286,7 1286,7 @@ class FormPlugin extends Plugin
$cache->save($cache_id, $this->forms);
if ($this->config()['debug']) {
- $this->grav['log']->addDebug(sprintf(">>>> Saved cached forms: %s\n%s", $this->getFormCacheId(), $this->arrayToString($this->forms)));
+ $this->grav['log']->debug(sprintf(">>>> Saved cached forms: %s\n%s", $this->getFormCacheId(), $this->arrayToString($this->forms)));
}
}
M plugins/form/templates/forms/fields/checkboxes/checkboxes.html.twig => plugins/form/templates/forms/fields/checkboxes/checkboxes.html.twig +25 -25
@@ 12,30 12,30 @@
{% set value = field.default|merge(value) %}
{% endif %}
- {% for key, text in field.options %}
-
- {% set id = field.id|default(field.name)|hyphenize ~ '-' ~ key %}
- {% set name = field.use == 'keys' ? key : id %}
- {% set val = field.use == 'keys' ? '1' : key %}
- {% set checked = (field.use == 'keys' ? value[key] : key in value) %}
- {% set help = (key in field.help_options|keys ? field.help_options[key] : false) %}
-
<div class="checkboxes {{ form_field_wrapper_classes }} {{ field.wrapper_classes }}">
- <input type="checkbox"
- id="{{ id|e }}"
- value="{{ val|e }}"
- name="{{ (scope ~ field.name)|fieldName ~ '[' ~ name ~ ']' }}"
- class="{{ form_field_checkbox_classes }} {{ field.classes }}"
- {% if checked %}checked="checked"{% endif %}
- {% if field.disabled or isDisabledToggleable %}disabled="disabled"{% endif %}
- >
- <label style="display: inline" for="{{ id|e }}">
- {% if help %}
- <span class="hint--bottom" data-hint="{{ help|t|e('html_attr') }}">{{ text|t|e }}</span>
- {% else %}
- {{ text|t|e }}
- {% endif %}
- </label>
+ {% for key, text in field.options %}
+ {% set id = field.id|default(field.name)|hyphenize ~ '-' ~ key %}
+ {% set name = field.use == 'keys' ? key : id %}
+ {% set val = field.use == 'keys' ? '1' : key %}
+ {% set checked = (field.use == 'keys' ? value[key] : key in value) %}
+ {% set help = (key in field.help_options|keys ? field.help_options[key] : false) %}
+ {% set disabled = key in field.disabled_options %}
+ <input type="checkbox"
+ id="{{ id|e }}"
+ value="{{ val|e }}"
+ name="{{ (scope ~ field.name)|fieldName ~ '[' ~ name ~ ']' }}"
+ class="{{ form_field_checkbox_classes }} {{ field.classes }}"
+ {% if checked %}checked="checked"{% endif %}
+ {% if disabled %}disabled="disabled"{% endif %}
+ >
+ <label style="display: inline; {% if disabled %}opacity: 0.6; cursor: no-drop;{% endif %}" for="{{ id|e }}">
+ {% if help %}
+ <span class="hint--bottom" data-hint="{{ help|t|e('html_attr') }}">{{ text|t|e }}</span>
+ {% else %}
+ {{ text|t|e }}
+ {% endif %}
+ </label>
+ {% endfor %}
</div>
- {% endfor %}
-{% endblock %}
+
+{% endblock %}<
\ No newline at end of file