reha_mod.module 829 B

123456789101112131415161718192021222324252627
  1. <?php
  2. /**
  3. * @file
  4. * Primary module hooks for reha module.
  5. */
  6. function reha_mod_form_user_register_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
  7. $form['actions']['submit']['#value'] = "valider";
  8. }
  9. function reha_mod_form_user_login_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
  10. $form['persistent_login']['#title'] = "rester connecté";
  11. }
  12. function reha_mod_form_node_operation_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
  13. $route = \Drupal::routeMatch();
  14. $params = $route->getParameters();
  15. /** @var Drupal\node\Entity\NodeType **/
  16. $node_type = $route->getParameter('node_type');
  17. $type = $node_type->id();
  18. if($type === 'operation'){
  19. $form['field_adresse']['widget'][0]['#type'] = 'container';
  20. }
  21. }