You are here

function signup_node_admin_summary_form in Signup 6.2

Same name and namespace in other branches
  1. 5.2 signup.module \signup_node_admin_summary_form()
  2. 6 includes/node_admin_summary.inc \signup_node_admin_summary_form()
  3. 7 includes/node_admin_summary.inc \signup_node_admin_summary_form()

@file Code related to the signup administration tab on each node.

1 call to signup_node_admin_summary_form()
signup_admin_form in includes/admin.signup_administration.inc
Form builder for the main form on the signup administration page.
1 string reference to 'signup_node_admin_summary_form'
signup_node_admin_page in includes/node_admin.inc
Print the signup administration tab for a single node.

File

includes/node_admin_summary.inc, line 9
Code related to the signup administration tab on each node.

Code

function signup_node_admin_summary_form($form_state, $node) {
  $form = array();
  if ($node->signup_close_signup_limit && $node->signup_effective_total >= $node->signup_close_signup_limit) {
    $form['status'] = array(
      '#type' => 'item',
      '#title' => t('Signups are'),
      '#value' => t('Closed (limit reached)'),
    );
  }
  else {
    $form['status'] = array(
      '#type' => 'select',
      '#title' => t('Signups are'),
      '#options' => array(
        0 => t('Closed'),
        1 => t('Open'),
      ),
      '#default_value' => $node->signup_status,
    );
    $form['submit'] = array(
      '#type' => 'submit',
      '#value' => t('Update'),
      '#submit' => array(
        'signup_node_admin_summary_form_submit',
      ),
    );
  }
  $form['total_signups'] = array(
    '#type' => 'item',
    '#title' => t('Total signups'),
    '#value' => isset($node->signup_total) ? $node->signup_total : 0,
  );
  $form['slots_used'] = array(
    '#type' => 'item',
    '#title' => t('Signup slots used'),
    '#value' => isset($node->signup_effective_total) ? $node->signup_effective_total : 0,
  );
  $form['limit'] = array(
    '#type' => 'item',
    '#title' => t('Signup limit'),
    '#value' => l($node->signup_close_signup_limit, 'node/' . $node->nid . '/signups/settings', array(
      'fragment' => 'signup-limit',
    )),
  );
  $form['nid'] = array(
    '#type' => 'value',
    '#value' => $node->nid,
  );
  return $form;
}