Révision fc2c1c7a
Ajouté par Assos Assos il y a plus de 8 ans
drupal7/sites/all/modules/entity/entity.module | ||
---|---|---|
184 | 184 |
* Gets the page title for the passed operation. |
185 | 185 |
*/ |
186 | 186 |
function entity_ui_get_page_title($op, $entity_type, $entity = NULL) { |
187 |
module_load_include('inc', 'entity', 'includes/entity.ui'); |
|
188 |
$label = entity_label($entity_type, $entity); |
|
187 |
if (isset($entity)) { |
|
188 |
module_load_include('inc', 'entity', 'includes/entity.ui'); |
|
189 |
$label = entity_label($entity_type, $entity); |
|
190 |
list(, , $bundle) = entity_extract_ids($entity_type, $entity); |
|
191 |
} |
|
192 |
else { |
|
193 |
$info = entity_get_info($entity_type); |
|
194 |
$label = $info['label']; |
|
195 |
$bundle = NULL; |
|
196 |
} |
|
197 |
|
|
189 | 198 |
switch ($op) { |
190 | 199 |
case 'view': |
191 | 200 |
return $label; |
... | ... | |
200 | 209 |
case 'export': |
201 | 210 |
return t('Export @label', array('@label' => $label)); |
202 | 211 |
} |
203 |
if (isset($entity)) { |
|
204 |
list(, , $bundle) = entity_extract_ids($entity_type, $entity); |
|
205 |
} |
|
206 |
else { |
|
207 |
$bundle = NULL; |
|
208 |
} |
|
212 |
|
|
209 | 213 |
return entity_ui_get_action_title($op, $entity_type, $bundle); |
210 | 214 |
} |
211 | 215 |
|
... | ... | |
1076 | 1080 |
// case of enabling or disabling modules we already rebuild defaults in |
1077 | 1081 |
// entity_modules_enabled() and entity_modules_disabled(), so we do not need |
1078 | 1082 |
// to do it again. |
1079 |
if (current_path() != 'admin/modules/list/confirm') { |
|
1083 |
// Also check if rebuilding on cache flush is explicitly disabled. |
|
1084 |
if (current_path() != 'admin/modules/list/confirm' && variable_get('entity_rebuild_on_flush', TRUE)) { |
|
1080 | 1085 |
entity_defaults_rebuild(); |
1081 | 1086 |
} |
1082 | 1087 |
|
Formats disponibles : Unified diff
Weekly update of contrib modules