|
@@ -5,10 +5,13 @@
|
|
|
* Functions to support theming in the Seven theme.
|
|
|
*/
|
|
|
|
|
|
+use Drupal\breakpoint\Breakpoint;
|
|
|
use Drupal\Core\Form\FormStateInterface;
|
|
|
use \Drupal\Core\Url;
|
|
|
use Drupal\Core\Render\Markup;
|
|
|
|
|
|
+use function Psy\debug;
|
|
|
+
|
|
|
/**
|
|
|
* Implements hook_preprocess_HOOK() for HTML document templates.
|
|
|
*/
|
|
@@ -115,11 +118,46 @@ function ouatminimal_preprocess_toolbar(&$variables) {
|
|
|
}
|
|
|
|
|
|
function ouatminimal_preprocess_form_element(&$variables) {
|
|
|
+ $element = $variables['element'];
|
|
|
+
|
|
|
if(isset($variables['description_display'])){
|
|
|
$variables['description_display']="before";
|
|
|
}
|
|
|
}
|
|
|
|
|
|
function ouatminimal_preprocess_node_edit_form__node_concernement(&$variables) {
|
|
|
- $variables['form']['advanced']['#group'] = "group_admin";
|
|
|
+ // $variables['form']['advanced']['#group'] = "group_admin";
|
|
|
+ // $ph = $variables['form']['title']['widget'][0]['value']['#placeholder'];
|
|
|
+ // $variables['form']['title']['widget']['#description'] = $ph;
|
|
|
+ // $variables['form']['title']['widget'][0]['#description'] = $ph;
|
|
|
+ // $variables['form']['title']['widget'][0]['value']['#description'] = $ph;
|
|
|
+
|
|
|
+
|
|
|
+ // $variables['form']['title']['widget']['#title'] = $ph;
|
|
|
+ // $variables['form']['title']['widget'][0]['#title'] = $ph;
|
|
|
+ // $variables['form']['title']['widget'][0]['value']['#title'] = $ph;
|
|
|
+ // $variables['form']['title']['widget'][0]['value']['#placeholder'] = "";
|
|
|
+}
|
|
|
+
|
|
|
+function ouatminimal_preprocess_input(&$variables) {
|
|
|
+ $element = &$variables['element'];
|
|
|
+ if ($element['#type'] === "submit") {
|
|
|
+ // edit-field-entite-0-subform-field-entite-actions-ief-add
|
|
|
+ $name = $element['#name'];
|
|
|
+
|
|
|
+ // rename entité reference in paragraphe "add node" to "editer entité"
|
|
|
+ if (preg_match('/^ief-field_entite-\d+-subform-field_entite-form-add$/', $name)) {
|
|
|
+ $element['#value'] = $element['#attributes']['value'] = $variables['attributes']['value'] = "Editer l'entité";
|
|
|
+ }
|
|
|
+ // rename remove (paragraphe) to "supprimer"
|
|
|
+ if (preg_match('/field_entite_\d+_remove/', $name)) {
|
|
|
+ $element['#value'] = $element['#attributes']['value'] = $variables['attributes']['value'] = "Supprimer";
|
|
|
+ }
|
|
|
+
|
|
|
+ // hide remove node ref submit
|
|
|
+ if (preg_match('/^ief-field_entite-\d+-subform-field_entite-form-entity-remove-\d+$/', $name)) {
|
|
|
+ $element['#value'] = $element['#attributes']['value'] = $variables['attributes']['value'] = "test";
|
|
|
+ $variables['attributes']['class'][] = 'ief-submit-remove';
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|