Révision 7e72b748
Ajouté par Assos Assos il y a plus de 6 ans
drupal7/sites/all/modules/ctools/plugins/content_types/entity_context/entity_field.inc | ||
---|---|---|
157 | 157 |
|
158 | 158 |
$field_output = field_view_field($entity_type, $clone, $field_name, $field_settings, $language); |
159 | 159 |
|
160 |
if (!empty($field_output) && !empty($conf['override_title'])) { |
|
161 |
$field_output['#title'] = filter_xss_admin($conf['override_title_text']); |
|
160 |
if (!empty($field_output)) { |
|
161 |
if (!empty($conf['override_title'])) { |
|
162 |
$field_output['#title'] = filter_xss_admin($conf['override_title_text']); |
|
163 |
} |
|
164 |
$field_output['#ctools_context'] = $context; |
|
165 |
$field_output['#post_render'][] = 'ctools_entity_field_content_type_substitute_keywords'; |
|
162 | 166 |
} |
163 | 167 |
|
164 | 168 |
// Build the content type block. |
... | ... | |
174 | 178 |
return $block; |
175 | 179 |
} |
176 | 180 |
|
181 |
/** |
|
182 |
* Replace context keywords. |
|
183 |
*/ |
|
184 |
function ctools_entity_field_content_type_substitute_keywords($markup, array $element) { |
|
185 |
return ctools_context_keyword_substitute($markup, array(), array($element['#ctools_context'])); |
|
186 |
} |
|
187 |
|
|
177 | 188 |
/** |
178 | 189 |
* Returns an edit form for custom type settings. |
179 | 190 |
*/ |
... | ... | |
230 | 241 |
ctools_form_include($form_state, 'field_ui.admin', 'field_ui', ''); |
231 | 242 |
ctools_form_include($form_state, 'fields'); |
232 | 243 |
|
244 |
$form['ctools_keywords'] = array( |
|
245 |
'#type' => 'item', |
|
246 |
'#description' => t('You may use keywords for substitutions.'), |
|
247 |
); |
|
248 |
|
|
233 | 249 |
$form['ctools_field_list'] = array( |
234 | 250 |
'#type' => 'value', |
235 | 251 |
'#value' => array(), |
Formats disponibles : Unified diff
Weekly update of contrib modules