You are here

class TimelineTitleSlide in Views TimelineJS integration 7.3

Defines a TimelineJS3 title slide.

Hierarchy

Expanded class hierarchy of TimelineTitleSlide

File

src/TimelineTitleSlide.php, line 6

View source
class TimelineTitleSlide extends TimelineSlide {
  public function __construct(TimelineTextInterface $text = NULL) {
    if (!empty($text)) {
      $this->text = $text;
    }
  }

  /**
   * {@inheritdoc}
   */
  public function buildArray() {
    $slide = array();
    if (!empty($this->text)) {
      $slide['text'] = $this->text
        ->buildArray();
    }
    if (!empty($this->media)) {
      $slide['media'] = $this->media
        ->buildArray();
    }
    if (!empty($this->background)) {
      $slide['background'] = $this->background
        ->buildArray();
    }
    if (!$this->autolink) {
      $slide['autolink'] = FALSE;
    }
    if (!empty($this->unique_id)) {
      $slide['unique_id'] = $this->unique_id;
    }

    // Filter any empty values before returning.
    return array_filter($slide);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
TimelineSlide::$autolink protected property The slide autolink property
TimelineSlide::$background protected property The slide background url and color.
TimelineSlide::$display_date protected property The slide display date.
TimelineSlide::$end_date protected property The slide end date.
TimelineSlide::$group protected property The slide group.
TimelineSlide::$media protected property The slide media and its metadata.
TimelineSlide::$start_date protected property The slide start date.
TimelineSlide::$text protected property The slide headline and text.
TimelineSlide::$unique_id protected property The slide unique id.
TimelineSlide::disableAutolink public function Sets the slide's autolink property to FALSE. Overrides TimelineSlideInterface::disableAutolink
TimelineSlide::enableAutolink public function Sets the slide's autolink property to TRUE. Overrides TimelineSlideInterface::enableAutolink
TimelineSlide::setBackground public function Sets the background for this slide. Overrides TimelineSlideInterface::setBackground
TimelineSlide::setDisplayDate public function Sets the display date for this slide. Overrides TimelineSlideInterface::setDisplayDate
TimelineSlide::setGroup public function Sets the group for this slide. Overrides TimelineSlideInterface::setGroup
TimelineSlide::setMedia public function Sets the media for this slide. Overrides TimelineSlideInterface::setMedia
TimelineSlide::setUniqueId public function Sets the unique ID for this slide. Overrides TimelineSlideInterface::setUniqueId
TimelineTitleSlide::buildArray public function Creates an array representing the TimelineJS javascript object. Overrides TimelineSlide::buildArray
TimelineTitleSlide::__construct public function Overrides TimelineSlide::__construct