You are here

public function BatBookingUIController::addPage in Booking and Availability Management Tools for Drupal 7

Creates the markup for the add Booking Entities page within the class so it can easily be extended/overridden.

File

modules/bat_booking/bat_booking.admin.inc, line 142
BatBooking editing UI.

Class

BatBookingUIController
UI controller.

Code

public function addPage() {
  $item = menu_get_item();
  $booking_types = bat_booking_get_types();
  if (count($booking_types) == 1) {
    $booking_type = reset($booking_types);
    drupal_goto($this->path . '/add/' . $booking_type->type);
  }
  $items = array();
  foreach ($booking_types as $booking_type) {
    $items[] = array(
      'title' => t('Add @booking_type_label booking', array(
        '@booking_type_label' => $booking_type->label,
      )),
      'href' => $this->path . '/add/' . $booking_type->type,
      'description' => '',
    );
  }
  return array(
    '#theme' => 'bat_booking_add_list',
    '#content' => $items,
  );
}