You are here

public function AddToCalendarApiWidget::__construct in Add To Calendar Button (AddEvent.com) 8.4

Same name and namespace in other branches
  1. 8.3 src/AddToCalendarApiWidget.php \Drupal\addtocalendar\AddToCalendarApiWidget::__construct()

Constructs a new AddToCalendarApiWidget object.

File

src/AddToCalendarApiWidget.php, line 38

Class

AddToCalendarApiWidget
Class AddToCalendarApiWidget.

Namespace

Drupal\addtocalendar

Code

public function __construct() {
  $this->atcDisplayText = 'Add to calendar';
  $this->atcTitle = 'Some event title';
  $this->atcDescription = 'Some event description';
  $this->atcLocation = 'Some event location';

  // Fetching site name and site email id.
  $config = \Drupal::config('system.site');
  $site_name = $config
    ->get('name');
  $site_mail = $config
    ->get('mail');
  $this->atcOrganizer = $site_name;
  $this->atcOrganizerEmail = $site_mail;
  $this->atcDateStart = 'now';
  $this->atcDateEnd = 'now';
  $this->timeZone = drupal_get_user_timezone();
}