Le support aux utilisateurs et les demandes de création de comptes externes doivent être faites depuis les issues du projet GitLab HEFR (https://gitlab.forge.hefr.ch/forge-hefr/gitlab-hefr)

team.theme 3.72 KB
Newer Older
Sébastien Javet's avatar
Sébastien Javet committed
1
2
3
4
<?php

/**
 * @file
Sébastien Javet's avatar
update    
Sébastien Javet committed
5
 * Functions to support theming in the team theme.
Sébastien Javet's avatar
Sébastien Javet committed
6
7
8
9
10
 */

/**
 * Implements hook_preprocess_HOOK() for html.html.twig.
 */
Sébastien Javet's avatar
update    
Sébastien Javet committed
11
function team_preprocess_html(array &$variables) {
Sébastien Javet's avatar
Sébastien Javet committed
12
13
14
15
16
17
18
19
20
21
22
23
  /* Add class to html tag */
  //$variables['html_attributes']->addClass('no-js');

  // Don't display the site name twice on the front page (and potentially others)
  /*if (isset($variables['head_title_array']['title']) && isset($variables['head_title_array']['name']) && ($variables['head_title_array']['title'] == $variables['head_title_array']['name'])) {
    $variables['head_title'] = $variables['head_title_array']['name'];
  }*/
}

/**
 * Implements hook_page_attachments_alter().
 */
Sébastien Javet's avatar
update    
Sébastien Javet committed
24
function team_page_attachments_alter(array &$page) {
Sébastien Javet's avatar
Sébastien Javet committed
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
  // Tell IE to use latest rendering engine (not to use compatibility mode).
  /*$ie_edge = [
    '#type' => 'html_tag',
    '#tag' => 'meta',
    '#attributes' => [
    'http-equiv' => 'X-UA-Compatible',
    'content' => 'IE=edge',
    ],
  ];
  $page['#attached']['html_head'][] = [$ie_edge, 'ie_edge'];*/
}

/**
 * Implements hook_preprocess_page() for page.html.twig.
 */
Sébastien Javet's avatar
update    
Sébastien Javet committed
40
function team_preprocess_page(array &$variables) {
Sébastien Javet's avatar
Sébastien Javet committed
41
42
43
44
45
46

}

/**
 * Implements hook_theme_suggestions_page_alter().
 */
Sébastien Javet's avatar
update    
Sébastien Javet committed
47
function team_theme_suggestions_page_alter(array &$suggestions, array $variables) {
Sébastien Javet's avatar
Sébastien Javet committed
48
49
50
51
52
53

}

/**
 * Implements hook_theme_suggestions_node_alter().
 */
Sébastien Javet's avatar
update    
Sébastien Javet committed
54
function team_theme_suggestions_node_alter(array &$suggestions, array $variables) {
Sébastien Javet's avatar
Sébastien Javet committed
55
56
57
58
59
60
61
62
63
64
  /*$node = $variables['elements']['#node'];

  if ($variables['elements']['#view_mode'] == "full") {

  }*/
}

/**
 * Implements hook_preprocess_HOOK() for Block document templates.
 */
Sébastien Javet's avatar
update    
Sébastien Javet committed
65
function team_preprocess_block(array &$variables) {
Sébastien Javet's avatar
Sébastien Javet committed
66
67
68
69
70
71

}

/**
 * Implements hook_theme_suggestions_field_alter().
 */
Sébastien Javet's avatar
update    
Sébastien Javet committed
72
function team_theme_suggestions_field_alter(array &$suggestions, array $variables) {
Sébastien Javet's avatar
Sébastien Javet committed
73
74
75
76
77
78
79
80
  /*$element = $variables['element'];
  $suggestions[] = 'field__' . $element['#view_mode'];
  $suggestions[] = 'field__' . $element['#view_mode'] . '__' . $element['#field_name'];*/
}

/**
 * Implements hook_theme_suggestions_field_alter().
 */
Sébastien Javet's avatar
update    
Sébastien Javet committed
81
function team_theme_suggestions_fieldset_alter(array &$suggestions, array $variables) {
Sébastien Javet's avatar
Sébastien Javet committed
82
83
84
85
86
87
88
89
90
  /*$element = $variables['element'];
  if (isset($element['#attributes']['class']) && in_array('form-composite', $element['#attributes']['class'])) {
    $suggestions[] = 'fieldset__form_composite';
  }*/
}

/**
 * Implements hook_preprocess_node().
 */
Sébastien Javet's avatar
update    
Sébastien Javet committed
91
function team_preprocess_node(array &$variables) {
Sébastien Javet's avatar
Sébastien Javet committed
92
93
94
95
96
97
98
  // Default to turning off byline/submitted.
  //$variables['display_submitted'] = FALSE;
}

/**
 * Implements hook_theme_suggestions_views_view_alter().
 */
Sébastien Javet's avatar
update    
Sébastien Javet committed
99
function team_theme_suggestions_views_view_alter(array &$suggestions, array $variables) {
Sébastien Javet's avatar
Sébastien Javet committed
100
101
102
103
104
105

}

/**
 * Implements hook_preprocess_form().
 */
Sébastien Javet's avatar
update    
Sébastien Javet committed
106
function team_preprocess_form(array &$variables) {
Sébastien Javet's avatar
Sébastien Javet committed
107
108
109
110
111
112
  //$variables['attributes']['novalidate'] = 'novalidate';
}

/**
 * Implements hook_preprocess_select().
 */
Sébastien Javet's avatar
update    
Sébastien Javet committed
113
function team_preprocess_select(array &$variables) {
Sébastien Javet's avatar
Sébastien Javet committed
114
115
116
117
118
119
  //$variables['attributes']['class'][] = 'select-chosen';
}

/**
 * Implements hook_preprocess_field().
 */
Sébastien Javet's avatar
update    
Sébastien Javet committed
120
function team_preprocess_field(array &$variables, $hook) {
Sébastien Javet's avatar
Sébastien Javet committed
121
122
123
124
125
126
127
  /*switch ($variables['element']['#field_name']) {
  }*/
}

/**
 * Implements hook_preprocess_details().
 */
Sébastien Javet's avatar
update    
Sébastien Javet committed
128
function team_preprocess_details(array &$variables) {
Sébastien Javet's avatar
Sébastien Javet committed
129
130
131
132
133
134
135
  /*$variables['attributes']['class'][] = 'details';
  $variables['summary_attributes']['class'] = 'summary';*/
}

/**
 * Implements hook_theme_suggestions_details_alter().
 */
Sébastien Javet's avatar
update    
Sébastien Javet committed
136
function team_theme_suggestions_details_alter(array &$suggestions, array $variables) {
Sébastien Javet's avatar
Sébastien Javet committed
137
138
139
140
141
142

}

/**
 * Implements hook_preprocess_menu_local_task().
 */
Sébastien Javet's avatar
update    
Sébastien Javet committed
143
function team_preprocess_menu_local_task(array &$variables) {
Sébastien Javet's avatar
Sébastien Javet committed
144
145
  //$variables['element']['#link']['url']->setOption('attributes', ['class'=>'rounded']);
}