You are here

public static function FPAFormBuilder::buildFPAPage in Fast Permissions Administration 8.2

Same name and namespace in other branches
  1. 3.0.x src/FPAFormBuilder.php \Drupal\fpa\FPAFormBuilder::buildFPAPage()
1 call to FPAFormBuilder::buildFPAPage()
FPAController::permissionsList in src/Controller/FPAController.php

File

src/FPAFormBuilder.php, line 50
Contains Drupal\fpa\FPAFormBuilder.

Class

FPAFormBuilder
Class FPAFormBuilder.

Namespace

Drupal\fpa

Code

public static function buildFPAPage() {
  $form = \Drupal::service('form_builder')
    ->getForm('\\Drupal\\user\\Form\\UserPermissionsForm');
  $render = static::buildTable($form);
  $render['#attached']['library'][] = 'fpa/fpa.permissions';
  $render['#attached']['drupalSettings']['fpa'] = [
    'attr' => [
      'permission' => FPA_ATTR_PERMISSION,
      'module' => FPA_ATTR_MODULE,
      'role' => FPA_ATTR_ROLE,
      'checked' => FPA_ATTR_CHECKED,
      'not_checked' => FPA_ATTR_NOT_CHECKED,
      'system_name' => FPA_ATTR_SYSTEM_NAME,
    ],
  ];
  return $render;
}