Révision c304a780
Ajouté par Assos Assos il y a environ 6 ans
drupal7/sites/all/modules/ctools/plugins/contexts/entity.inc | ||
---|---|---|
2 | 2 |
|
3 | 3 |
/** |
4 | 4 |
* @file |
5 |
* |
|
6 | 5 |
* Plugin to provide a node context. A node context is a node wrapped in a |
7 | 6 |
* context object that can be utilized by anything that accepts contexts. |
8 | 7 |
*/ |
... | ... | |
90 | 89 |
} |
91 | 90 |
|
92 | 91 |
if (!empty($data)) { |
93 |
$context->data = $data;
|
|
92 |
$context->data = $data; |
|
94 | 93 |
if (!empty($entity['entity keys']['label'])) { |
95 |
$context->title = $data->{$entity['entity keys']['label']};
|
|
94 |
$context->title = $data->{$entity['entity keys']['label']}; |
|
96 | 95 |
} |
97 | 96 |
$context->argument = $id; |
98 | 97 |
|
... | ... | |
161 | 160 |
* Validate a node. |
162 | 161 |
*/ |
163 | 162 |
function ctools_context_entity_settings_form_validate($form, &$form_state) { |
164 |
// Validate the autocomplete |
|
163 |
// Validate the autocomplete.
|
|
165 | 164 |
if (empty($form_state['values']['entity_id']) && empty($form_state['values']['entity'])) { |
166 | 165 |
form_error($form['entity'], t('You must select an entity.')); |
167 | 166 |
return; |
... | ... | |
171 | 170 |
return; |
172 | 171 |
} |
173 | 172 |
|
174 |
$id = $form_state['values']['entity']; |
|
173 |
$id = $form_state['values']['entity'];
|
|
175 | 174 |
$preg_matches = array(); |
176 | 175 |
$match = preg_match('/\[id: (\d+)\]/', $id, $preg_matches); |
177 | 176 |
if (!$match) { |
Formats disponibles : Unified diff
Weekly update of contrib modules