You are here

function _fpa_ctools in Fast Permissions Administration 6.2

Same name and namespace in other branches
  1. 7.2 fpa.module \_fpa_ctools()
1 string reference to '_fpa_ctools'
fpa_menu in ./fpa.module

File

./fpa.module, line 117

Code

function _fpa_ctools($js = NULL) {

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

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