예제 #1
0
  /**
   * {@inheritdoc}
   */
  public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
    $form = parent::buildConfigurationForm($form, $form_state);

    $form['include_unpublished'] = [
      '#title' => t('Include unpublished nodes'),
      '#type' => 'checkbox',
      '#default_value' => $this->configuration['include_unpublished'],
      '#description' => t('In order to see unpublished nodes, the requesting user must also have permissions to do so.'),
    ];

    return $form;
  }
예제 #2
0
  /**
   * {@inheritdoc}
   */
  public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
    $form = parent::buildConfigurationForm($form, $form_state);

    $form['roles'] = array(
      '#type' => 'checkboxes',
      '#title' => $this->t('Restrict to the selected roles'),
      '#options' => array_diff_key(user_role_names(TRUE), array(RoleInterface::AUTHENTICATED_ID => RoleInterface::AUTHENTICATED_ID)),
      '#default_value' =>  $this->configuration['roles'],
      '#description' => $this->t('If none of the checkboxes is checked, allow all roles.'),
      '#element_validate' => [[get_class($this), 'elementValidateFilter']],
    );

    $form['include_blocked'] = [
      '#title' => t('Include blocked user'),
      '#type' => 'checkbox',
      '#default_value' => $this->configuration['include_blocked'],
      '#description' => t('In order to see blocked users, the requesting user must also have permissions to do so.'),
    ];

    return $form;
  }
예제 #3
0
  /**
   * {@inheritdoc}
   */
  public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
    $form = parent::buildConfigurationForm($form, $form_state);

    $form['images'] = array(
      '#type' => 'details',
      '#title' => t('Image file settings'),
      '#description' => t('Extra settings for image files in the result.'),
      '#tree' => TRUE,
    );

    $form['images']['show_dimensions'] = [
      '#title' => t('Show pixel dimensions'),
      '#type' => 'checkbox',
      '#default_value' => $this->configuration['images']['show_dimensions'],
    ];

    if ($this->moduleHandler->moduleExists('image')) {
      $form['images']['show_thumbnail'] = [
        '#title' => t('Show thumbnail'),
        '#type' => 'checkbox',
        '#default_value' => $this->configuration['images']['show_thumbnail'],
      ];

      $form['images']['thumbnail_image_style'] = [
        '#title' => t('Thumbnail image style'),
        '#type' => 'select',
        '#default_value' => $this->configuration['images']['thumbnail_image_style'],
        '#options' => image_style_options(FALSE),
        '#states' => [
          'visible' => [
            ':input[name="images[show_thumbnail]"]' => ['checked' => TRUE],
          ],
        ],
      ];
    }

    return $form;
  }
예제 #4
0
 /**
  * {@inheritdoc}
  */
 public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
   $form = parent::buildConfigurationForm($form, $form_state);
   $this->insertTokenList($form, ['term']);
   return $form;
 }