You are here

function boxes_add_page in Boxes 7.2

Menu Callback to list available box types to add

1 string reference to 'boxes_add_page'
boxes_menu in ./boxes.module
Implements hook_menu().

File

includes/boxes.pages.inc, line 31
Box Functions

Code

function boxes_add_page() {
  $box_types = boxes_get_types();

  // Bypass the block/add listing if only one block type is available.
  if (count($box_types) == 1) {
    $box_type = array_shift($box_types);
    drupal_goto('block/add/' . $box_type
      ->buildURL());
  }
  return theme('boxes_add_list', array(
    'content' => $box_types,
  ));
}