You are here

function node_registration_types_form in Node registration 7

Admin: registration types form.

This is a form, because a form can be altered by other modules and then rendered/themed by this module. No buttons or handlers.

1 string reference to 'node_registration_types_form'
node_registration_menu in ./node_registration.module
Implements hook_menu().

File

includes/node_registration.forms.inc, line 39
New registration forms. Public and admin.

Code

function node_registration_types_form($form, $form_state) {
  $module_path = _node_registration_type_to_uri('node_registration');
  $form['#theme'] = 'node_registration_types_form';
  $form['types'] = array(
    '#tree' => TRUE,
  );
  foreach (node_type_get_names() as $type => $name) {
    $enabled = _node_registration_node_type_enabled($type);
    $operations = array();
    if ($enabled) {
      $operations['settings'] = array(
        '#title' => t('settings'),
        '#type' => 'link',
        '#href' => 'admin/structure/' . $module_path . '/manage/' . $type . '/settings',
      );
      $operations['fields'] = array(
        '#title' => t('fields'),
        '#type' => 'link',
        '#href' => 'admin/structure/' . $module_path . '/manage/' . $type . '/fields',
      );
      $operations['display'] = array(
        '#title' => t('display'),
        '#type' => 'link',
        '#href' => 'admin/structure/' . $module_path . '/manage/' . $type . '/display',
      );
    }
    $form['types'][$type] = array(
      '#name' => $name,
      '#enabled' => $enabled,
      '#operations' => $operations,
    );
  }
  return $form;
}