You are here

function theme_bat_booking_add_list in Booking and Availability Management Tools for Drupal 7

Displays the list of available booking types for booking creation.

1 theme call to theme_bat_booking_add_list()
BatBookingUIController::addPage in modules/bat_booking/bat_booking.admin.inc
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 387
BatBooking editing UI.

Code

function theme_bat_booking_add_list($variables) {
  $content = $variables['content'];
  $output = '';
  if ($content) {
    $output = '<dl class="booking-type-list">';
    foreach ($content as $item) {
      $output .= '<dt>' . l($item['title'], $item['href']) . '</dt>';
      $output .= '<dd>' . filter_xss_admin($item['description']) . '</dd>';
    }
    $output .= '</dl>';
  }
  else {
    if (user_access('administer bat_booking_type entities')) {
      $output = '<p>' . t('Bookings cannot be added because you have not created any booking types yet. Go to the <a href="@create-booking-type">booking type creation page</a> to add a new booking type.', array(
        '@create-booking-type' => url('admin/bat/config/booking-types/add'),
      )) . '</p>';
    }
    else {
      $output = '<p>' . t('No booking types have been created yet for you to use.') . '</p>';
    }
  }
  return $output;
}