function tripal_add_page

3.x TripalEntityUIController.inc tripal_add_page()

Provides a list of TripalEntity types (bundles) for the user to add.

This function is a callback in a menu item which is set in the TripalEntityUIController class.

1 string reference to 'tripal_add_page'
TripalEntityUIController::hook_menu in tripal/includes/TripalEntityUIController.inc
Overrides hook_menu() defaults. Main reason for doing this is that parent class hook_menu() is optimized for entity type administration.

File

tripal/includes/TripalEntityUIController.inc, line 692

Code

function tripal_add_page() {
  $item = menu_get_item();
  $content = system_admin_menu_block($item);
  // Bypass the node/add listing if only one content type is available.
  if (count($content) == 1) {
    $item = array_shift($content);
    drupal_goto($item['href']);
  }
  return theme('tripal_add_list', array('content' => $content));

}