Beispiel #1
0
 public function buildOptionsForm(&$form, &$form_state)
 {
     parent::buildOptionsForm($form, $form_state);
     $perms = array();
     $module_info = system_get_info('module');
     // Get list of permissions
     foreach (\Drupal::moduleHandler()->getImplementations('permission') as $module) {
         $permissions = \Drupal::moduleHandler()->invoke($module, 'permission');
         foreach ($permissions as $name => $perm) {
             $perms[$module_info[$module]['name']][$name] = strip_tags($perm['title']);
         }
     }
     ksort($perms);
     $form['perm'] = array('#type' => 'select', '#options' => $perms, '#title' => t('Permission'), '#default_value' => $this->options['perm'], '#description' => t('Only users with the selected permission flag will be able to access this display. Note that users with "access all views" can see any view, regardless of other permissions.'));
 }
Beispiel #2
0
 public function buildOptionsForm(&$form, FormStateInterface $form_state)
 {
     parent::buildOptionsForm($form, $form_state);
     $form['role'] = array('#type' => 'checkboxes', '#title' => $this->t('Role'), '#default_value' => $this->options['role'], '#options' => array_map('\\Drupal\\Component\\Utility\\Html::escape', user_role_names()), '#description' => $this->t('Only the checked roles will be able to access this display.'));
 }
Beispiel #3
0
 public function buildOptionsForm(&$form, FormStateInterface $form_state)
 {
     parent::buildOptionsForm($form, $form_state);
     // Get list of permissions
     $perms = [];
     $permissions = $this->permissionHandler->getPermissions();
     foreach ($permissions as $perm => $perm_item) {
         $provider = $perm_item['provider'];
         $display_name = $this->moduleHandler->getName($provider);
         $perms[$display_name][$perm] = strip_tags($perm_item['title']);
     }
     $form['perm'] = array('#type' => 'select', '#options' => $perms, '#title' => $this->t('Permission'), '#default_value' => $this->options['perm'], '#description' => $this->t('Only users with the selected permission flag will be able to access this display.'));
 }
 public function buildOptionsForm(&$form, FormStateInterface $form_state)
 {
     parent::buildOptionsForm($form, $form_state);
     $module_info = system_get_info('module');
     // Get list of permissions
     $perms = [];
     $permissions = $this->permissionHandler->getPermissions();
     foreach ($permissions as $perm => $perm_item) {
         $provider = $perm_item['provider'];
         $display_name = $module_info[$provider]['name'];
         $perms[$display_name][$perm] = String::checkPlain(strip_tags($perm_item['title']));
     }
     $form['perm'] = array('#type' => 'select', '#options' => $perms, '#title' => $this->t('Permission'), '#default_value' => $this->options['perm'], '#description' => $this->t('Only users with the selected permission flag will be able to access this display. Note that users with "access all views" can see any view, regardless of other permissions.'));
 }
Beispiel #5
0
 public function buildOptionsForm(&$form, &$form_state)
 {
     parent::buildOptionsForm($form, $form_state);
     $form['role'] = array('#type' => 'checkboxes', '#title' => t('Role'), '#default_value' => $this->options['role'], '#options' => array_map('\\Drupal\\Component\\Utility\\String::checkPlain', user_role_names()), '#description' => t('Only the checked roles will be able to access this display. Note that users with "access all views" can see any view, regardless of role.'));
 }