You are here

function _fpa_ctools in Fast Permissions Administration 7.2

Same name and namespace in other branches
  1. 6.2 fpa.module \_fpa_ctools()

Page callback for CTools modal path.

1 string reference to '_fpa_ctools'
fpa_menu in ./fpa.module
Implements hook_menu().

File

./fpa.module, line 141
Main module file for FPA.

Code

function _fpa_ctools($js = NULL) {

  // Need to include the file that contains the permissions form.
  module_load_include('inc', 'user', 'user.admin');
  $form_id = 'user_admin_permissions';

  // Fall back if $js is not set.
  if (!$js) {
    return drupal_get_form($form_id);
  }
  ctools_include('modal');
  ctools_include('ajax');
  $form_state = array(
    'title' => t('Permissions'),
    'ajax' => TRUE,
  );
  switch ($_GET['fpa_method']) {
    case 'ctools':
      $output = ctools_modal_form_wrapper($form_id, $form_state);
      break;
  }
  if (!empty($form_state['executed'])) {
    $output = array();
    $output[] = ctools_ajax_command_reload();
  }
  echo ajax_render($output);
  exit;
}