edlptheme.theme 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /**
  3. * @file
  4. * Functions to support theming in the edlp theme.
  5. */
  6. use Drupal\Core\Form\FormStateInterface;
  7. // function edlptheme_preprocess_input(&$vars){
  8. // dsm($vars, 'vars');
  9. // $vars['attributes']['placeholder'] = "salut";
  10. // }
  11. /**
  12. * Implements hook_form_alter
  13. */
  14. function edlptheme_form_user_login_form_alter(&$form, FormStateInterface $form_state, $form_id) {
  15. // dpm($form_id, 'form_id');
  16. // dpm($form, 'form');
  17. $form['name']['#attributes']['placeholder'] = (string) $form['name']['#title'];
  18. unset($form['name']['#title']);
  19. $form['pass']['#attributes']['placeholder'] = (string) $form['pass']['#title'];
  20. unset($form['pass']['#title']);
  21. }
  22. function edlptheme_preprocess_edlp_productions(&$vars){
  23. foreach($vars['nodes'] as &$node){
  24. switch($node['vm']){
  25. case "image_2_columns":
  26. $cols = 4;
  27. break;
  28. case "image_1_columns":
  29. $cols = 2;
  30. break;
  31. case "text_1_column":
  32. $cols = 2;
  33. break;
  34. };
  35. $node['cols'] = $cols;
  36. }
  37. // dpm($vars);
  38. }