You are here

function entity_ui_get_page_title in Entity API 7

Gets the page title for the passed operation.

1 call to entity_ui_get_page_title()
entity_ui_form_defaults in includes/entity.ui.inc
Form wrapper callback for all entity ui forms.
1 string reference to 'entity_ui_get_page_title'
EntityContentUIController::hook_menu in includes/entity.ui.inc
Provides definitions for implementing hook_menu().

File

./entity.module, line 185

Code

function entity_ui_get_page_title($op, $entity_type, $entity = NULL) {
  if (isset($entity)) {
    module_load_include('inc', 'entity', 'includes/entity.ui');
    $label = entity_label($entity_type, $entity);
    list(, , $bundle) = entity_extract_ids($entity_type, $entity);
  }
  else {
    $info = entity_get_info($entity_type);
    $label = $info['label'];
    $bundle = NULL;
  }
  switch ($op) {
    case 'view':
      return $label;
    case 'edit':
      return t('Edit @label', array(
        '@label' => $label,
      ));
    case 'clone':
      return t('Clone @label', array(
        '@label' => $label,
      ));
    case 'revert':
      return t('Revert @label', array(
        '@label' => $label,
      ));
    case 'delete':
      return t('Delete @label', array(
        '@label' => $label,
      ));
    case 'export':
      return t('Export @label', array(
        '@label' => $label,
      ));
  }
  return entity_ui_get_action_title($op, $entity_type, $bundle);
}