Révision 5d12d676
Ajouté par Assos Assos il y a environ 6 ans
drupal7/sites/all/modules/views/help/alter-exposed-filter.html | ||
---|---|---|
4 | 4 |
|
5 | 5 |
<pre> |
6 | 6 |
<?php |
7 |
if (empty($form_state['view']->exposed_input[$identifier])) . |
|
8 |
{ $form_state['input'][$identifier] = $default_value; } |
|
7 |
if (empty($form_state['view']->exposed_input[$identifier])) { |
|
8 |
$form_state['input'][$identifier] = $default_value; |
|
9 |
} |
|
9 | 10 |
?> |
10 | 11 |
</pre> |
11 | 12 |
|
... | ... | |
18 | 19 |
<pre> |
19 | 20 |
<?php |
20 | 21 |
function MODULENAME_form_views_exposed_form_alter(&$form, $form_state) { |
21 |
if(strpos($form['#id'], 'volunteer-directory') !== FALSE) { |
|
22 |
if (strpos($form['#id'], 'volunteer-directory') !== FALSE) {
|
|
22 | 23 |
$city_tid = geoip_redirect_get_tid(); |
23 |
if(is_numeric($city_tid) && $city_tid != 7660) { |
|
24 |
if (empty($form_state['view']->exposed_input['tid'])) {
|
|
24 |
if (is_numeric($city_tid) && $city_tid != 7660) {
|
|
25 |
if (empty($form_state['view']->exposed_input['tid'])) { |
|
25 | 26 |
$form_state['input']['tid'] = $city_tid; |
26 | 27 |
} |
27 | 28 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules