Révision 503b3f7b
Ajouté par Assos Assos il y a environ 10 ans
drupal7/sites/all/modules/entity/includes/entity.ui.inc | ||
---|---|---|
724 | 724 |
entity_ui_controller($form_state['entity_type'])->$method($form, $form_state); |
725 | 725 |
} |
726 | 726 |
|
727 |
/** |
|
728 |
* Gets the page/menu title for local action operations. |
|
729 |
* |
|
730 |
* @param $op |
|
731 |
* The current operation. One of 'add' or 'import'. |
|
732 |
* @param $entity_type |
|
733 |
* The entity type. |
|
734 |
* @param $bundle_name |
|
735 |
* (Optional) The name of the bundle. May be NULL if the bundle name is not |
|
736 |
* relevant to the current page. If the entity type has only one bundle, or no |
|
737 |
* bundles, this will be the same as the entity type. |
|
738 |
*/ |
|
739 |
function entity_ui_get_action_title($op, $entity_type, $bundle_name = NULL) { |
|
740 |
$info = entity_get_info($entity_type); |
|
741 |
switch ($op) { |
|
742 |
case 'add': |
|
743 |
if (isset($bundle_name) && $bundle_name != $entity_type) { |
|
744 |
return t('Add @bundle_name @entity_type', array( |
|
745 |
'@bundle_name' => drupal_strtolower($info['bundles'][$bundle_name]['label']), |
|
746 |
'@entity_type' => drupal_strtolower($info['label']), |
|
747 |
)); |
|
748 |
} |
|
749 |
else { |
|
750 |
return t('Add @entity_type', array('@entity_type' => drupal_strtolower($info['label']))); |
|
751 |
} |
|
752 |
case 'import': |
|
753 |
return t('Import @entity_type', array('@entity_type' => drupal_strtolower($info['label']))); |
|
754 |
} |
|
755 |
} |
|
756 |
|
|
757 | 727 |
/** |
758 | 728 |
* Submit builder for the main entity form, which extracts the form values and updates the entity. |
759 | 729 |
* |
Formats disponibles : Unified diff
Weekly update of contrib modules