You are here

function assets_add_page in Asset 7

Page callback for asset add page.

1 string reference to 'assets_add_page'
asset_menu in ./asset.module
Implements hook_menu().

File

includes/asset.admin.inc, line 210
Asset admin page callbacks.

Code

function assets_add_page() {
  $item = menu_get_item();
  $content = system_admin_menu_block($item);
  if (isset($_GET['destination'])) {
    $destination = array(
      'destination' => $_GET['destination'],
    );
    foreach ($content as $mlid => $item) {
      $content[$mlid]['localized_options']['query'] = $destination;
    }
  }

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