You are here

function theme_bat_unit_add_list in Booking and Availability Management Tools for Drupal 7

Displays the list of available unit types for unit creation.

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

File

modules/bat_unit/bat_unit.admin.inc, line 448
BatUnit editing UI.

Code

function theme_bat_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('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/bat/config/units/unit-types/add'),
      )) . '</p>';
    }
    else {
      $output = '<p>' . t('No unit types have been created yet for you to use.') . '</p>';
    }
  }
  return $output;
}