You are here

function multiple_registration_settings_form in Multiple Registration 7

Form for managing all created registration pages.

1 string reference to 'multiple_registration_settings_form'
multiple_registration_menu in ./multiple_registration.module
Implements hook_menu().

File

./multiple_registration.module, line 178
Add ability to create several registration pages.

Code

function multiple_registration_settings_form() {
  $register_pages = _multiple_registration_get_registration_pages();
  $roles = user_roles();
  if ($register_pages) {
    $rids = array_keys($register_pages);
    foreach ($rids as $rid) {
      $row = array();
      $row[] = $roles[$rid];
      $row[] = variable_get('multiple_registration_path_' . $rid, '');
      $row[] = l(t('Edit'), 'admin/config/people/multiple_registration/' . $rid . '/add', array(
        'query' => array(
          'destination' => current_path(),
        ),
      ));
      $row[] = l(t('Remove'), 'admin/config/people/multiple_registration/' . $rid . '/remove', array(
        'query' => array(
          'destination' => current_path(),
        ),
      ));
      $rows[] = array(
        'data' => $row,
      );
    }
    $header = array(
      t('Role'),
      t('Registration page path'),
      array(
        'data' => t('Operations'),
        'colspan' => 2,
      ),
    );
    $output = array(
      '#theme' => 'table',
      '#header' => $header,
      '#rows' => $rows,
      '#attributes' => array(
        'id' => 'user-roles-reg-pages',
      ),
    );
  }
  else {
    $output = array(
      '#markup' => t('There are no additional registration pages created yet. You can add new pages !here', array(
        '!here' => l(t('here'), 'admin/people/permissions/roles'),
      )),
    );
  }
  $output['#suffix'] = '<p>' . l(t('Go to Roles managing page '), 'admin/people/permissions/roles') . '<p></p>' . l(t(' Manage default registration form status'), 'admin/config/people/multiple_registration/default_form') . '</p>';
  $form['user_register_pages'] = $output;
  return $form;
}