You are here

public function OptionsFormHelperTrait::getButtonTextElement in FullCalendar 8.4

Same name and namespace in other branches
  1. 8.5 src/Plugin/fullcalendar/type/OptionsFormHelperTrait.php \Drupal\fullcalendar\Plugin\fullcalendar\type\OptionsFormHelperTrait::getButtonTextElement()
  2. 8.2 src/Plugin/fullcalendar/type/OptionsFormHelperTrait.php \Drupal\fullcalendar\Plugin\fullcalendar\type\OptionsFormHelperTrait::getButtonTextElement()

Get a button text element.

Parameters

mixed $default: The default value.

string $fieldset: The name of the fieldset.

string $title: The field title.

Return value

array Drupal FAPI array.

1 call to OptionsFormHelperTrait::getButtonTextElement()
FullCalendar::buildOptionsForm in src/Plugin/fullcalendar/type/FullCalendar.php

File

src/Plugin/fullcalendar/type/OptionsFormHelperTrait.php, line 256

Class

OptionsFormHelperTrait

Namespace

Drupal\fullcalendar\Plugin\fullcalendar\type

Code

public function getButtonTextElement($default, $fieldset, $title = '') {
  return [
    '#type' => 'textfield',
    '#title' => !empty($title) ? $title : $this
      ->t('Button text'),
    '#description' => $this
      ->t("Text that will be displayed on buttons of the header/footer. Use key:value pairs for view-specific formats e.g. buttonText: 'list day'. @more-info", [
      '@more-info' => Link::fromTextAndUrl($this
        ->t('More info'), Url::fromUri(self::FC_DOCS_URL . '/buttonText', [
        'attributes' => [
          'target' => '_blank',
        ],
      ]))
        ->toString(),
    ]),
    '#default_value' => $default,
    '#prefix' => '<div class="views-left-50">',
    '#suffix' => '</div>',
    '#size' => '60',
    '#fieldset' => $fieldset,
  ];
}