You are here

function theme_wsconfig_add_list in Web Service Data 7

Displays the list of available wsconfig types for wsconfig creation.

1 theme call to theme_wsconfig_add_list()
WsConfigUIController::addPage in modules/wsconfig/wsconfig.entity.inc
Create the markup for the add Web Service Configuration Entities page within the class so it can easily be extended/overriden.

File

modules/wsconfig/wsconfig.admin.inc, line 490
Admin forms for wsconfig

Code

function theme_wsconfig_add_list($variables) {
  $wsinfo = entity_get_info("wsconfig");
  $content = $variables['content'];
  $output = '';
  if ($content) {
    $output .= '<H1>' . t('Web Service Configuration') . '</H1>';
    $output .= '<dl class="wsconfig-type-list">';
    foreach ($content as $item) {
      $output .= '<dt>' . l($item->label, $wsinfo['admin ui']['path'] . '/add/' . $item->type) . '</dt>';
      $description = array();
      foreach ($item->data as $key => $val) {
        $description[] = drupal_ucfirst($key) . ": {$val}";
      }
      $output .= '<dd>' . filter_xss_admin(implode('<br>', $description)) . '</dd>';
    }
    $output .= '</dl>';
  }
  else {
    if (user_access('administer wsconfig types')) {
      $output = '<p>' . t('Web Service Configuration Entities cannot be added because you have not created any wsconfig types yet. Go to the <a href="@create-wsconfig-type">wsconfig type creation page</a> to add a new wsconfig type.', array(
        '@create-wsconfig-type' => url('admin/structure/wsconfig_types/add'),
      )) . '</p>';
    }
    else {
      $output = '<p>' . t('No web service configuration types have been created yet for you to use.') . '</p>';
    }
  }
  return $output;
}