You are here

function theme_rooms_unit_add_list in Rooms - Drupal Booking for Hotels, B&Bs and Vacation Rentals 7

Displays the list of available room types for room creation.

1 theme call to theme_rooms_unit_add_list()
RoomsUnitUIController::addPage in modules/rooms_unit/rooms_unit.admin.inc
Creates the markup for the add Bookable Unit Entities page within the class so it can easily be extended/overridden.

File

modules/rooms_unit/rooms_unit.admin.inc, line 589
Rooms editing UI.

Code

function theme_rooms_unit_add_list($variables) {
  $content = $variables['content'];
  $output = '';
  if ($content) {
    $output = '<dl class="unit-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 unit types')) {
      $output = '<p>' . t('Bookable Units cannot be added because you have not created any unit types yet. Go to the <a href="@create-unit-type">unit type creation page</a> to add a new unit type.', array(
        '@create-unit-type' => url('admin/rooms/units/unit-types/add'),
      )) . '</p>';
    }
    else {
      $output = '<p>' . t('No bookable unit types have been created yet for you to use.') . '</p>';
    }
  }
  return $output;
}