You are here

function radioactivity_http_ports_list in Radioactivity 5

1 string reference to 'radioactivity_http_ports_list'
radioactivity_http_menu in plugins/radioactivity_http.module

File

plugins/radioactivity_http.module, line 61

Code

function radioactivity_http_ports_list() {
  $form = array();
  $form[] = array(
    '#value' => '<h2>' . t('Configured HTTP ports') . '</h2>',
  );

  // create the table
  $rows = array();
  $ports = _radioactivity_http_get_ports();
  if (count($ports)) {
    foreach ($ports as $id => $port) {
      $rows[] = array(
        check_plain($id),
        check_plain($port['path']),
        l(t('Edit'), 'admin/settings/radioactivity/http_port/' . $id) . ' ' . l(t('Delete'), 'admin/settings/radioactivity/http_port_delete/' . $id),
      );
    }
  }
  else {
    $rows[] = array(
      array(
        'colspan' => 3,
        'data' => t('No ports configured'),
      ),
    );
  }
  $table = theme('table', array(
    t('Port id'),
    t('Port URL'),
    t('Actions'),
  ), $rows);
  $form['ports'] = array(
    '#value' => $table,
  );
  $form['create_port'] = array(
    '#value' => l(t('Create new port'), 'admin/settings/radioactivity/http_port/new'),
  );
  return $form;
}