You are here

function _multiple_registration_get_registration_pages in Multiple Registration 7

Get all role ids for whom registration forms was created.

Return value

mixed If registration forms exists, array of paths. In other situation - FALSE.

4 calls to _multiple_registration_get_registration_pages()
multiple_registration_form_field_ui_field_edit_form_alter in ./multiple_registration.module
Implements hook_form_FORM_ID_alter().
multiple_registration_form_user_login_block_alter in ./multiple_registration.module
Implements hook_form_FORM_ID_alter().
multiple_registration_menu in ./multiple_registration.module
Implements hook_menu().
multiple_registration_settings_form in ./multiple_registration.module
Form for managing all created registration pages.

File

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

Code

function _multiple_registration_get_registration_pages() {
  $roles = user_roles();
  ksort($roles);

  // Include only custom created roles.
  $allowed_roles = array_keys(array_slice($roles, variable_get('user_admin_role'), NULL, TRUE));
  if ($allowed_roles) {
    $reg_forms = array();
    foreach ($allowed_roles as $rid) {
      if ($url = variable_get('multiple_registration_url_' . $rid, '')) {
        $reg_forms[$rid] = $url;
      }
    }
    return $reg_forms;
  }
  return FALSE;
}