You are here

function theme_signup_node_settings_form_panes in Signup 6.2

Theme function for the panes table in the node settings form.

1 theme call to theme_signup_node_settings_form_panes()
signup_node_settings_form in includes/node_settings.inc
Returns the form for the per-node signup settings.

File

includes/node_settings.inc, line 246
Code related to the per-node signup settings form.

Code

function theme_signup_node_settings_form_panes($form) {

  // Based on taxonomy.admin.inc
  foreach (element_children($form) as $key) {
    $row = array();
    $row[] = drupal_render($form[$key]['enabled']);
    if (isset($form[$key]['weight'])) {
      $form[$key]['weight']['#attributes']['class'] = 'signup-pane-weight';
      $row[] = drupal_render($form[$key]['weight']);
    }
    $row[] = drupal_render($form[$key]['label']);
    $row[] = drupal_render($form[$key]['description']);

    // Render all the operation links as a themed list of links.
    // Changing what's in #value here seems a bit hackish, but AFAIK it's the only
    // way to do the theming here rather than in the form builder.
    // These all go in a single table cell because calculating colspan for a variable
    // number of operations is not pretty and not worth it.
    if (isset($form[$key]['operations'])) {
      $form[$key]['operations']['#value'] = theme('links', $form[$key]['operations']['#value']);
      $row[] = drupal_render($form[$key]['operations']);
    }
    else {
      $row[] = '';
    }
    $rows[] = array(
      'data' => $row,
      'class' => 'draggable',
    );
  }

  // A message if there are no rows.
  // @todo: figure out why the form label doesn't show in this case.
  if (!count($rows)) {
    $rows[] = array(
      array(
        'data' => t('No form panes are available.'),
        'colspan' => 3,
      ),
    );
  }
  $header[] = t('Enabled');
  if (isset($form[$key]['weight'])) {
    $header[] = t('Weight');
  }
  $header[] = t('Name');
  $header[] = t('Description');
  $header[] = t('Operations');
  if (isset($form[$key]['weight'])) {
    drupal_add_tabledrag('signup-node-settings-panes', 'order', 'sibling', 'signup-pane-weight');
  }
  $output = drupal_render($form);

  // ???
  $output .= theme('table', $header, $rows, array(
    'id' => 'signup-node-settings-panes',
  ));
  return $output;
}