You are here

public function Picture::buildOptionsForm in Views (for Drupal 7) 8.3

Default options form that provides the label widget that all fields should have.

Overrides FieldPluginBase::buildOptionsForm

File

lib/Views/user/Plugin/views/field/Picture.php, line 66
Definition of Views\user\Plugin\views\field\Picture.

Class

Picture
Field handler to provide simple renderer that allows using a themed user link.

Namespace

Views\user\Plugin\views\field

Code

public function buildOptionsForm(&$form, &$form_state) {
  parent::buildOptionsForm($form, $form_state);
  $form['link_photo_to_profile'] = array(
    '#title' => t("Link to user's profile"),
    '#description' => t("Link the user picture to the user's profile"),
    '#type' => 'checkbox',
    '#default_value' => $this->options['link_photo_to_profile'],
  );
  if (module_exists('image')) {
    $styles = image_styles();
    $style_options = array(
      '' => t('Default'),
    );
    foreach ($styles as $style) {
      $style_options[$style['name']] = $style['name'];
    }
    $form['image_style'] = array(
      '#title' => t('Image style'),
      '#description' => t('Using <em>Default</em> will use the site-wide image style for user pictures set in the <a href="!account-settings">Account settings</a>.', array(
        '!account-settings' => url('admin/config/people/accounts', array(
          'fragment' => 'edit-personalization',
        )),
      )),
      '#type' => 'select',
      '#options' => $style_options,
      '#default_value' => $this->options['image_style'],
    );
  }
}