You are here

class FullCalendar in FullCalendar 8

Same name in this branch
  1. 8 src/Plugin/views/style/FullCalendar.php \Drupal\fullcalendar\Plugin\views\style\FullCalendar
  2. 8 src/Plugin/fullcalendar/type/FullCalendar.php \Drupal\fullcalendar\Plugin\fullcalendar\type\FullCalendar
Same name and namespace in other branches
  1. 8.5 src/Plugin/views/style/FullCalendar.php \Drupal\fullcalendar\Plugin\views\style\FullCalendar
  2. 8.2 src/Plugin/views/style/FullCalendar.php \Drupal\fullcalendar\Plugin\views\style\FullCalendar
  3. 8.3 src/Plugin/views/style/FullCalendar.php \Drupal\fullcalendar\Plugin\views\style\FullCalendar
  4. 8.4 src/Plugin/views/style/FullCalendar.php \Drupal\fullcalendar\Plugin\views\style\FullCalendar

Plugin annotation


@ViewsStyle(
  id = "fullcalendar",
  title = @Translation("FullCalendar"),
  help = @Translation("Displays items on a calendar."),
  theme = "fullcalendar",
  theme_file = "fullcalendar.theme.inc",
  display_types = {"normal"}
)

Hierarchy

Expanded class hierarchy of FullCalendar

7 string references to 'FullCalendar'
fullcalendar.info.yml in ./fullcalendar.info.yml
fullcalendar.info.yml
fullcalendar.links.menu.yml in ./fullcalendar.links.menu.yml
fullcalendar.links.menu.yml
fullcalendar.routing.yml in ./fullcalendar.routing.yml
fullcalendar.routing.yml
fullcalendar_colors.info.yml in fullcalendar_colors/fullcalendar_colors.info.yml
fullcalendar_colors/fullcalendar_colors.info.yml
fullcalendar_legend.info.yml in fullcalendar_legend/fullcalendar_legend.info.yml
fullcalendar_legend/fullcalendar_legend.info.yml

... See full list

File

src/Plugin/views/style/FullCalendar.php, line 29

Namespace

Drupal\fullcalendar\Plugin\views\style
View source
class FullCalendar extends StylePluginBase {

  /**
   * {@inheritdoc}
   */
  protected $usesFields = TRUE;

  /**
   * {@inheritdoc}
   */
  protected $usesGrouping = FALSE;

  /**
   * The module handler.
   *
   * @var \Drupal\Core\Extension\ModuleHandlerInterface
   */
  protected $moduleHandler;

  /**
   * Entity Field Manager.
   *
   * @var \Drupal\Core\Entity\EntityFieldManagerInterface
   */
  protected $fieldManager;

  /**
   * Stores the FullCalendar plugins used by this style plugin.
   *
   * @var \Drupal\fullcalendar\Plugin\FullcalendarPluginCollection
   */
  protected $pluginBag;

  /**
   * @var \Drupal\Core\Datetime\DateFormatter $dateFormatter
   *   The date formatter service.
   */
  protected $dateFormatter;

  /**
   * The messenger.
   *
   * @var \Drupal\Core\Messenger\MessengerInterface
   */
  protected $messenger;

  /**
   * {@inheritdoc}
   */
  public function evenEmpty() {
    return TRUE;
  }

  /**
   * TODO
   *
   * @return \Drupal\fullcalendar\Plugin\FullcalendarPluginCollection|\Drupal\fullcalendar\Plugin\FullcalendarInterface[]
   */
  public function getPlugins() {
    return $this->pluginBag;
  }

  /**
   * Constructs a new Fullcalendar object.
   *
   * @param array $configuration
   * @param string $plugin_id
   * @param mixed $plugin_definition
   * @param \Drupal\Component\Plugin\PluginManagerInterface $fullcalendar_manager
   *   FullCalendar Manager.
   * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
   *   The module handler.
   * @param \Drupal\Core\Entity\EntityFieldManagerInterface $field_manager
   *   Entity Field Manager.
   * @param \Drupal\Core\Datetime\DateFormatter $date_formatter
   *   The date formatter service.
   * @param \Drupal\Core\Messenger\MessengerInterface $messenger
   *   The messenger.
   */
  public function __construct(array $configuration, $plugin_id, $plugin_definition, PluginManagerInterface $fullcalendar_manager, ModuleHandlerInterface $module_handler, $field_manager, DateFormatter $date_formatter, MessengerInterface $messenger) {
    parent::__construct($configuration, $plugin_id, $plugin_definition);
    $this->pluginBag = new FullcalendarPluginCollection($fullcalendar_manager, $this);
    $this->moduleHandler = $module_handler;
    $this->fieldManager = $field_manager;
    $this->dateFormatter = $date_formatter;
    $this->messenger = $messenger;
  }

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
    return new static($configuration, $plugin_id, $plugin_definition, $container
      ->get('plugin.manager.fullcalendar'), $container
      ->get('module_handler'), $container
      ->get('entity_field.manager'), $container
      ->get('date.formatter'), $container
      ->get('messenger'));
  }

  /**
   * {@inheritdoc}
   */
  protected function defineOptions() {
    $options = parent::defineOptions();

    /* @var \Drupal\fullcalendar\Plugin\fullcalendar\type\FullCalendar $plugin */
    foreach ($this
      ->getPlugins() as $plugin) {
      if ($plugin instanceof FullcalendarBase) {
        $options += $plugin
          ->defineOptions();
      }
    }
    return $options;
  }

  /**
   * {@inheritdoc}
   */
  public function buildOptionsForm(&$form, FormStateInterface $form_state) {
    parent::buildOptionsForm($form, $form_state);

    /* @var \Drupal\fullcalendar\Plugin\fullcalendar\type\FullCalendar $plugin */
    foreach ($this
      ->getPlugins() as $plugin) {
      if ($plugin instanceof FullcalendarBase) {
        $plugin
          ->buildOptionsForm($form, $form_state);
      }
    }
  }

  /**
   * {@inheritdoc}
   */
  public function validateOptionsForm(&$form, FormStateInterface $form_state) {
    parent::validateOptionsForm($form, $form_state);

    // Cast all submitted values to their proper type.
    // TODO Remove once https://drupal.org/node/1653026 is in.
    if ($form_state
      ->getValue('style_options')) {
      $this
        ->castNestedValues($form_state
        ->getValue('style_options'), $form);
    }
  }

  /**
   * Casts form values to a given type, if defined.
   *
   * @param array $values
   *   An array of fullcalendar option values.
   * @param array $form
   *   The fullcalendar option form definition.
   * @param string|null $current_key
   *   (optional) The current key being processed. Defaults to NULL.
   * @param array $parents
   *   (optional) An array of parent keys when recursing through the nested
   *   array. Defaults to an empty array.
   */
  protected function castNestedValues(array &$values, array $form, $current_key = NULL, array $parents = []) {
    foreach ($values as $key => &$value) {

      // We are leaving a recursive loop, remove the last parent key.
      if (empty($current_key)) {
        array_pop($parents);
      }

      // In case we recurse into an array, or need to specify the key for
      // drupal_array_get_nested_value(), add the current key to $parents.
      $parents[] = $key;
      if (is_array($value)) {

        // Enter another recursive loop.
        $this
          ->castNestedValues($value, $form, $key, $parents);
      }
      else {

        // Get the form definition for this key.
        $form_value = NestedArray::getValue($form, $parents);

        // Check to see if #data_type is specified, if so, cast the value.
        if (isset($form_value['#data_type'])) {
          settype($value, $form_value['#data_type']);
        }

        // Remove the current key from $parents to move on to the next key.
        array_pop($parents);
      }
    }
  }

  /**
   * {@inheritdoc}
   */
  public function submitOptionsForm(&$form, FormStateInterface $form_state) {
    parent::submitOptionsForm($form, $form_state);

    /* @var \Drupal\fullcalendar\Plugin\fullcalendar\type\FullCalendar $plugin */
    foreach ($this
      ->getPlugins() as $plugin) {
      if ($plugin instanceof FullcalendarBase) {
        $plugin
          ->submitOptionsForm($form, $form_state);
      }
    }
  }

  /**
   * Extracts date fields from the view.
   */
  public function parseFields($include_gcal = TRUE) {
    $this->view
      ->initHandlers();
    $labels = $this->displayHandler
      ->getFieldLabels();
    $date_fields = [];

    /** @var \Drupal\views\Plugin\views\field\EntityField $field */
    foreach ($this->view->field as $id => $field) {
      if (fullcalendar_field_is_date($field, $include_gcal)) {
        $date_fields[$id] = $labels[$id];
      }
    }
    return $date_fields;
  }

  /**
   * {@inheritdoc}
   */
  public function validate() {
    if ($this->displayHandler->display['display_plugin'] != 'default' && !$this
      ->parseFields()) {
      $this->messenger
        ->addWarning($this
        ->t('Display "@display" requires at least one date field.', [
        '@display' => $this->displayHandler->display['display_title'],
      ]), 'error');
    }
    return parent::validate();
  }

  /**
   * {@inheritdoc}
   */
  public function render() {
    $this->options['#attached'] = $this
      ->prepareAttached();
    return [
      '#theme' => $this
        ->themeFunctions(),
      '#view' => $this->view,
      '#options' => $this->options,
    ];
  }

  /**
   * Load libraries.
   *
   * @throws \Exception
   */
  protected function prepareAttached() {

    /* @var \Drupal\fullcalendar\Plugin\fullcalendar\type\FullCalendar $plugin */
    $attached['library'][] = 'fullcalendar/drupal.fullcalendar';
    foreach ($this
      ->getPlugins() as $plugin_id => $plugin) {
      $definition = $plugin
        ->getPluginDefinition();
      foreach ([
        'css',
        'js',
      ] as $type) {
        if ($definition[$type]) {
          $attached['library'][] = $definition['provider'] . '/drupal.' . $plugin_id . '.' . $type;
        }
      }
    }
    if ($this->displayHandler
      ->getOption('use_ajax')) {
      $attached['library'][] = 'fullcalendar/drupal.fullcalendar.ajax';
    }
    $settings = $this
      ->prepareSettings();
    $attached['drupalSettings']['fullcalendar'] = [
      '.js-view-dom-id-' . $this->view->dom_id => $settings,
    ];
    if (!empty($settings['fullcalendar']['modalWindow'])) {

      // FIXME all of these libraries are needed?
      $attached['library'][] = 'core/drupal.ajax';
      $attached['library'][] = 'core/drupal.dialog';
      $attached['library'][] = 'core/drupal.dialog.ajax';
    }
    return $attached;
  }

  /**
   * Prepare JavaScript settings.
   *
   * @throws \Exception
   */
  protected function prepareSettings() {
    $settings =& drupal_static(__METHOD__, []);
    if (empty($settings)) {
      $weights = [];
      $delta = 0;

      /* @var \Drupal\fullcalendar\Plugin\fullcalendar\type\FullCalendar $plugin */
      foreach ($this
        ->getPlugins() as $plugin_id => $plugin) {
        $definition = $plugin
          ->getPluginDefinition();
        $plugin
          ->process($settings);
        if (isset($definition['weight']) && !isset($weights[$definition['weight']])) {
          $weights[$definition['weight']] = $plugin_id;
        }
        else {
          while (isset($weights[$delta])) {
            $delta++;
          }
          $weights[$delta] = $plugin_id;
        }
      }
      ksort($weights);
      $settings['weights'] = array_values($weights);

      // TODO
      $settings['fullcalendar']['disableResizing'] = TRUE;

      // Force to disable dates in the previous or next month in order to get
      // the (real) first and last day of the current month after using pager in
      // 'month' view. So, disabling this results a valid date-range for the
      // current month, instead of the date-range +/- days from the previous and
      // next month. It's very important, because we set default date-range in
      // the same way in fullcalendar_views_pre_view().
      // @see https://fullcalendar.io/docs/display/showNonCurrentDates/
      $settings['fullcalendar']['showNonCurrentDates'] = FALSE;
      $settings['fullcalendar']['fixedWeekCount'] = FALSE;

      // Need to reverse this value.
      if (empty($settings['fullcalendar']['editable'])) {
        $settings['fullcalendar']['editable'] = TRUE;
      }
      else {
        $settings['fullcalendar']['editable'] = FALSE;
      }
      $settings['fullcalendar']['locale'] = \Drupal::languageManager()
        ->getCurrentLanguage()
        ->getId();
    }
    $settings['fullcalendar']['_events'] = $this
      ->prepareEvents();
    return $settings;
  }

  /**
   * Prepare events for calendar.
   *
   * @return array
   *   Array of events ready for fullcalendar.
   *
   * @throws \Exception
   */
  protected function prepareEvents() {
    $events = [];
    foreach ($this->view->result as $delta => $row) {

      /** @var \Drupal\Core\Entity\EntityInterface $entity */
      $entity = $row->_entity;

      // Collect all fields for the customize options.
      $fields = [];

      // Collect only date fields.
      $date_fields = [];

      // Collect prepared events.
      $event = [];

      /* @var \Drupal\views\Plugin\views\field\Field $field */
      foreach ($this->view->field as $field_name => $field) {
        $fields[$field_name] = $this
          ->getField($delta, $field_name);
        if (fullcalendar_field_is_date($field)) {
          $field_storage_definitions = $this->fieldManager
            ->getFieldStorageDefinitions($field->definition['entity_type']);
          $field_definition = $field_storage_definitions[$field->definition['field_name']];
          $date_fields[$field_name] = [
            'value' => $field
              ->getItems($row),
            'field_alias' => $field->field_alias,
            'field_name' => $field_definition
              ->getName(),
            'field_info' => $field_definition,
            'timezone_override' => $field->options['settings']['timezone_override'],
          ];
        }
      }

      // If using a custom date field, filter the fields to process.
      if (!empty($this->options['fields']['date'])) {
        $date_fields = array_intersect_key($date_fields, $this->options['fields']['date_field']);
      }

      // If there are no date fields (gcal only), return.
      if (empty($date_fields)) {
        return $events;
      }
      foreach ($date_fields as $field) {

        // Filter fields without value.
        if (empty($field['value'])) {
          continue;
        }

        /** @var \Drupal\Core\Field\FieldStorageDefinitionInterface $field_definition */
        $field_definition = $field['field_info'];

        // Get 'min' and 'max' dates appear in the Calendar.
        $date_range = $this
          ->getExposedDates($field['field_name']);

        // "date_recur" field (with recurring date).
        if ($field_definition
          ->getType() == 'date_recur') {

          /** @var \Drupal\date_recur\Plugin\Field\FieldType\DateRecurFieldItemList $field_items */
          $field_items = $row->_entity->{$field['field_name']};
          $isRecurring = FALSE;

          /** @var \Drupal\date_recur\Plugin\Field\FieldType\DateRecurItem $item */
          foreach ($field_items as $index => $item) {

            // Get DateRecur Occurrence Handler.
            $occurrenceHandler = $item
              ->getOccurrenceHandler();

            // If this field is a DateRecur field.
            if ($occurrenceHandler
              ->isRecurring()) {

              // Get a list of occurrences for display.
              $occurrences = $occurrenceHandler
                ->getOccurrencesForDisplay($date_range['min'], $date_range['max']);
              foreach ($occurrences as $occurrence) {

                /** @var \DateTime $start */
                $start = $occurrence['value'];

                /** @var \DateTime $end */
                $end = $occurrence['end_value'];
                $event = $this
                  ->prepareEvent($entity, $field, $index, $start, $end);
              }
              $isRecurring = TRUE;
            }
          }
          if ($isRecurring === TRUE) {

            // At this point, all DateRecur occurrences are merged into $rows
            // so we can continue adding date items with the next field.
            continue;
          }
        }

        // "datetime" and "daterange" fields or "date_recur" field (without
        // recurring date).
        foreach ($field['value'] as $index => $item) {

          // Start time is required!
          if (empty($item['raw']->value)) {
            continue;
          }
          $event_start = new DateTime();
          $event_start
            ->setTimestamp(strtotime($item['raw']->value));

          // Set event timezone override if configured in views.
          if (!empty($field['timezone_override'])) {
            $event_start
              ->setTimeZone(new DateTimeZone($field['timezone_override']));
          }
          $event_end = new DateTime();

          // By default, we use the start-time + 1 hour as end-time.
          $event_end
            ->setTimestamp($event_start
            ->getTimestamp() + 3600);

          // If the field has end_value, override default end-time.
          if (!empty($item['raw']->end_value)) {
            $event_end
              ->setTimestamp(strtotime($item['raw']->end_value));

            // Set event timezone override if configured in views.
            if (!empty($field['timezone_override'])) {
              $event_end
                ->setTimeZone(new DateTimeZone($field['timezone_override']));
            }
          }
          $event_start
            ->setTimestamp($event_start
            ->getTimestamp() + $event_start
            ->getOffset());
          $event_end
            ->setTimestamp($event_end
            ->getTimestamp() + $event_end
            ->getOffset());
          $event = $this
            ->prepareEvent($entity, $field, $index, $event_start, $event_end);
        }
      }
      if (!empty($event)) {
        $events[$delta] = $event;
      }
    }
    return $events;
  }

  /**
   * Helper method to prepare event.
   *
   * @param \Drupal\Core\Entity\EntityInterface $entity
   *   Event entity.
   * @param $field
   *
   * @param int $delta
   *   Field delta.
   * @param \DateTime $event_start
   *   Start date of the event.
   * @param \DateTime $event_end
   *   End date of the event.
   *
   * @return array
   * @throws \Exception
   */
  private function prepareEvent($entity, $field, $delta, $event_start, $event_end) {
    $classes = $this->moduleHandler
      ->invokeAll('fullcalendar_classes', [
      $entity,
    ]);
    $this->moduleHandler
      ->alter('fullcalendar_classes', $classes, $entity);
    $classes = array_map([
      '\\Drupal\\Component\\Utility\\Html',
      'getClass',
    ], $classes);
    $class = count($classes) ? implode(' ', array_unique($classes)) : '';
    $palette = $this->moduleHandler
      ->invokeAll('fullcalendar_palette', [
      $entity,
    ]);
    $this->moduleHandler
      ->alter('fullcalendar_palette', $palette, $entity);
    $request_time = \Drupal::time()
      ->getRequestTime();
    $current_time = new DateTime();
    $current_time
      ->setTimestamp($request_time);

    // Get 'min' and 'max' dates appear in the Calendar.
    $date_range = $this
      ->getExposedDates($field['field_name']);

    // All-day option (for agenda views) is FALSE by default.
    $all_day = FALSE;

    // If the event starts before and ends after the current date-range
    // appears in the Calendar, set event to all-day event.
    if ($event_start <= $date_range['min'] && $event_end >= $date_range['max']) {
      $all_day = TRUE;
    }

    // Add a class if the event was in the past or is in the future, based
    // on the end time. We can't do this in hook_fullcalendar_classes()
    // because the date hasn't been processed yet.
    if ($all_day && $event_start < $current_time || !$all_day && $event_end < $current_time) {
      $time_class = 'fc-event-past';
    }
    elseif ($event_start > $current_time) {
      $time_class = 'fc-event-future';
    }
    else {
      $time_class = 'fc-event-now';
    }
    if (!empty($settings['fullcalendar']['editable'])) {
      $editable = $entity
        ->access('update', NULL, TRUE)
        ->isAllowed();
    }
    else {
      $editable = FALSE;
    }
    return [
      'allDay' => (int) $all_day,
      'start' => $this->dateFormatter
        ->format($event_start
        ->getTimestamp(), 'custom', DateTimeItemInterface::DATETIME_STORAGE_FORMAT),
      'end' => $this->dateFormatter
        ->format($event_end
        ->getTimestamp(), 'custom', DateTimeItemInterface::DATETIME_STORAGE_FORMAT),
      'editable' => !empty($editable) ? 'true' : 'false',
      'field' => $field['field_name'],
      'index' => $delta,
      'eid' => $entity
        ->id(),
      'entity_type' => $entity
        ->getEntityTypeId(),
      'className' => $class . ' ' . $time_class,
      'title' => strip_tags(htmlspecialchars_decode($entity
        ->label(), ENT_QUOTES)),
      'url' => $entity
        ->toUrl('canonical', [
        'language' => \Drupal::languageManager()
          ->getCurrentLanguage(),
      ])
        ->toString(),
      'backgroundColor' => !empty($palette['backgroundColor']) ? $palette['backgroundColor'] : '',
      'borderColor' => !empty($palette['borderColor']) ? $palette['borderColor'] : '',
      'textColor' => !empty($palette['textColor']) ? $palette['textColor'] : '',
    ];
  }

  /**
   * Get 'min' and 'max' dates appear in the calendar.
   *
   * @param string $field_name
   *   Field machine name.
   *
   * @return mixed
   * @throws \Exception
   */
  public function getExposedDates($field_name) {
    $dates =& drupal_static(__METHOD__, []);
    if (empty($dates[$field_name])) {
      $entity_type = $this->view
        ->getBaseEntityType();
      $entity_type_id = $entity_type
        ->id();
      $settings = $this->view->style_plugin->options;

      /** @var \Drupal\Core\Entity\EntityFieldManagerInterface $field_manager */
      $field_manager = \Drupal::getContainer()
        ->get('entity_field.manager');

      /** @var \Drupal\Core\Field\FieldStorageDefinitionInterface[] $field_storages */
      $field_storages = $field_manager
        ->getFieldStorageDefinitions($entity_type_id);

      /** @var \Drupal\Core\Field\FieldStorageDefinitionInterface $field_storage */
      $field_storage = $field_storages[$field_name];
      $field_value = $field_storage
        ->getName() . '_value';
      $exposed_input = $this->view
        ->getExposedInput();

      // Min and Max dates for exposed filter.
      $dateMin = new DateTime();
      $dateMax = new DateTime();

      // First, we try to set initial Min and Max date values based on the
      // exposed form values.
      if (isset($exposed_input[$field_value])) {
        $dateMin
          ->setTimestamp(strtotime($exposed_input[$field_value]['min']));
        $dateMax
          ->setTimestamp(strtotime($exposed_input[$field_value]['max']));
      }
      elseif (!empty($settings['date']['month']) && !empty($settings['date']['year'])) {
        $ts = mktime(0, 0, 0, $settings['date']['month'] + 1, 1, $settings['date']['year']);
        $dateMin
          ->setTimestamp($ts);
        $dateMax
          ->setTimestamp($ts);
        $dateMin
          ->modify('first day of this month');
        $dateMax
          ->modify('first day of next month');
      }
      else {
        $dateMin
          ->modify('first day of this month');
        $dateMax
          ->modify('first day of next month');
      }
      $dates[$field_name] = [
        'min' => $dateMin,
        'max' => $dateMax,
      ];
    }
    return $dates[$field_name];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DependencySerializationTrait::$_entityStorages protected property An array of entity type IDs keyed by the property name of their storages.
DependencySerializationTrait::$_serviceIds protected property An array of service IDs keyed by property name used for serialization.
DependencySerializationTrait::__sleep public function 1
DependencySerializationTrait::__wakeup public function 2
FullCalendar::$dateFormatter protected property The date formatter service.
FullCalendar::$fieldManager protected property Entity Field Manager.
FullCalendar::$messenger protected property The messenger. Overrides MessengerTrait::$messenger
FullCalendar::$moduleHandler protected property The module handler.
FullCalendar::$pluginBag protected property Stores the FullCalendar plugins used by this style plugin.
FullCalendar::$usesFields protected property Does the style plugin for itself support to add fields to its output. Overrides StylePluginBase::$usesFields
FullCalendar::$usesGrouping protected property Does the style plugin support grouping of rows. Overrides StylePluginBase::$usesGrouping
FullCalendar::buildOptionsForm public function Provide a form to edit options for this plugin. Overrides StylePluginBase::buildOptionsForm
FullCalendar::castNestedValues protected function Casts form values to a given type, if defined.
FullCalendar::create public static function Creates an instance of the plugin. Overrides PluginBase::create
FullCalendar::defineOptions protected function Information about options for all kinds of purposes will be held here. Overrides StylePluginBase::defineOptions
FullCalendar::evenEmpty public function Should the output of the style plugin be rendered even if it's a empty view. Overrides StylePluginBase::evenEmpty
FullCalendar::getExposedDates public function Get 'min' and 'max' dates appear in the calendar.
FullCalendar::getPlugins public function TODO
FullCalendar::parseFields public function Extracts date fields from the view.
FullCalendar::prepareAttached protected function Load libraries.
FullCalendar::prepareEvent private function Helper method to prepare event.
FullCalendar::prepareEvents protected function Prepare events for calendar.
FullCalendar::prepareSettings protected function Prepare JavaScript settings.
FullCalendar::render public function Render the display in this style. Overrides StylePluginBase::render
FullCalendar::submitOptionsForm public function Handle any special handling on the validate form. Overrides PluginBase::submitOptionsForm
FullCalendar::validate public function Validate that the plugin is correct and can be saved. Overrides StylePluginBase::validate
FullCalendar::validateOptionsForm public function Validate the options form. Overrides StylePluginBase::validateOptionsForm
FullCalendar::__construct public function Constructs a new Fullcalendar object. Overrides PluginBase::__construct
MessengerTrait::messenger public function Gets the messenger. 29
MessengerTrait::setMessenger public function Sets the messenger.
PluginBase::$configuration protected property Configuration information passed into the plugin. 1
PluginBase::$definition public property Plugins's definition
PluginBase::$displayHandler public property The display object this plugin is for.
PluginBase::$options public property Options for this plugin will be held here.
PluginBase::$pluginDefinition protected property The plugin implementation definition. 1
PluginBase::$pluginId protected property The plugin_id.
PluginBase::$renderer protected property Stores the render API renderer. 3
PluginBase::$view public property The top object of a view. 1
PluginBase::calculateDependencies public function Calculates dependencies for the configured plugin. Overrides DependentPluginInterface::calculateDependencies 14
PluginBase::DERIVATIVE_SEPARATOR constant A string which is used to separate base plugin IDs from the derivative ID.
PluginBase::doFilterByDefinedOptions protected function Do the work to filter out stored options depending on the defined options.
PluginBase::filterByDefinedOptions public function Filter out stored options depending on the defined options. Overrides ViewsPluginInterface::filterByDefinedOptions
PluginBase::getAvailableGlobalTokens public function Returns an array of available token replacements. Overrides ViewsPluginInterface::getAvailableGlobalTokens
PluginBase::getBaseId public function Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface::getBaseId
PluginBase::getDerivativeId public function Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface::getDerivativeId
PluginBase::getPluginDefinition public function Gets the definition of the plugin implementation. Overrides PluginInspectionInterface::getPluginDefinition 3
PluginBase::getPluginId public function Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface::getPluginId
PluginBase::getProvider public function Returns the plugin provider. Overrides ViewsPluginInterface::getProvider
PluginBase::getRenderer protected function Returns the render API renderer. 1
PluginBase::globalTokenForm public function Adds elements for available core tokens to a form. Overrides ViewsPluginInterface::globalTokenForm
PluginBase::globalTokenReplace public function Returns a string with any core tokens replaced. Overrides ViewsPluginInterface::globalTokenReplace
PluginBase::INCLUDE_ENTITY constant Include entity row languages when listing languages.
PluginBase::INCLUDE_NEGOTIATED constant Include negotiated languages when listing languages.
PluginBase::isConfigurable public function Determines if the plugin is configurable.
PluginBase::listLanguages protected function Makes an array of languages, optionally including special languages.
PluginBase::pluginTitle public function Return the human readable name of the display. Overrides ViewsPluginInterface::pluginTitle
PluginBase::preRenderAddFieldsetMarkup public static function Moves form elements into fieldsets for presentation purposes. Overrides ViewsPluginInterface::preRenderAddFieldsetMarkup
PluginBase::preRenderFlattenData public static function Flattens the structure of form elements. Overrides ViewsPluginInterface::preRenderFlattenData
PluginBase::queryLanguageSubstitutions public static function Returns substitutions for Views queries for languages.
PluginBase::setOptionDefaults protected function Fills up the options of the plugin with defaults.
PluginBase::summaryTitle public function Returns the summary of the settings in the display. Overrides ViewsPluginInterface::summaryTitle 6
PluginBase::themeFunctions public function Provide a full list of possible theme templates used by this style. Overrides ViewsPluginInterface::themeFunctions 1
PluginBase::unpackOptions public function Unpack options over our existing defaults, drilling down into arrays so that defaults don't get totally blown away. Overrides ViewsPluginInterface::unpackOptions
PluginBase::usesOptions public function Returns the usesOptions property. Overrides ViewsPluginInterface::usesOptions 8
PluginBase::viewsTokenReplace protected function Replaces Views' tokens in a given string. The resulting string will be sanitized with Xss::filterAdmin. 1
PluginBase::VIEWS_QUERY_LANGUAGE_SITE_DEFAULT constant Query string to indicate the site default language.
StringTranslationTrait::$stringTranslation protected property The string translation service. 1
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.
StylePluginBase::$defaultFieldLabels protected property Should field labels be enabled by default. 1
StylePluginBase::$groupingTheme protected property The theme function used to render the grouping set.
StylePluginBase::$rendered_fields protected property Stores the rendered field values, keyed by the row index and field name.
StylePluginBase::$rowTokens protected property Store all available tokens row rows.
StylePluginBase::$usesOptions protected property Denotes whether the plugin has an additional options form. Overrides PluginBase::$usesOptions
StylePluginBase::$usesRowClass protected property Does the style plugin support custom css class for the rows. 3
StylePluginBase::$usesRowPlugin protected property Whether or not this style uses a row plugin. 10
StylePluginBase::buildSort public function Called by the view builder to see if this style handler wants to interfere with the sorts. If so it should build; if it returns any non-TRUE value, normal sorting will NOT be added to the query. 1
StylePluginBase::buildSortPost public function Called by the view builder to let the style build a second set of sorts that will come after any other sorts in the view. 1
StylePluginBase::defaultFieldLabels public function Return TRUE if this style enables field labels by default. 1
StylePluginBase::destroy public function Clears a plugin. Overrides PluginBase::destroy
StylePluginBase::elementPreRenderRow public function #pre_render callback for view row field rendering.
StylePluginBase::getField public function Gets a rendered field.
StylePluginBase::getFieldValue public function Get the raw field value.
StylePluginBase::getRowClass public function Return the token replaced row class for the specified row.
StylePluginBase::init public function Overrides \Drupal\views\Plugin\views\PluginBase::init(). Overrides PluginBase::init
StylePluginBase::preRender public function Allow the style to do stuff before each row is rendered.
StylePluginBase::query public function Add anything to the query that we might need to. Overrides PluginBase::query 1
StylePluginBase::renderFields protected function Renders all of the fields for a given style and store them on the object.
StylePluginBase::renderGrouping public function Group records as needed for rendering.
StylePluginBase::renderGroupingSets public function Render the grouping sets.
StylePluginBase::renderRowGroup protected function Renders a group of rows of the grouped view.
StylePluginBase::tokenizeValue public function Take a value and apply token replacement logic to it.
StylePluginBase::trustedCallbacks public static function Lists the trusted callbacks provided by the implementing class. Overrides PluginBase::trustedCallbacks
StylePluginBase::usesFields public function Return TRUE if this style also uses fields. 3
StylePluginBase::usesGrouping public function Returns the usesGrouping property. 3
StylePluginBase::usesRowClass public function Returns the usesRowClass property. 3
StylePluginBase::usesRowPlugin public function Returns the usesRowPlugin property. 10
StylePluginBase::usesTokens public function Return TRUE if this style uses tokens.
StylePluginBase::wizardForm public function Provide a form in the views wizard if this style is selected.
StylePluginBase::wizardSubmit public function Alter the options of a display before they are added to the view. 1
TrustedCallbackInterface::THROW_EXCEPTION constant Untrusted callbacks throw exceptions.
TrustedCallbackInterface::TRIGGER_SILENCED_DEPRECATION constant Untrusted callbacks trigger silenced E_USER_DEPRECATION errors.
TrustedCallbackInterface::TRIGGER_WARNING constant Untrusted callbacks trigger E_USER_WARNING errors.