Commit 651bea0b authored by Mingsong Hu's avatar Mingsong Hu

Improve documentation

parent 166f84cc
......@@ -6,14 +6,14 @@ CONTENTS OF THIS FILE
* Requirements
* Installation
* Configuration
* Features
* API
INTRODUCTION
------------
The Full Calendar View Plugin module is a lightweight Views plugin module that
provides a calendar view format generated by FullCalendar JavaScript library
version 3.8.0.
This is a View plugin module that provides a calendar view format powered by FullCalendar JavaScript library
* For a full description of the module visit:
https://www.drupal.org/project/fullcalendar_view
......@@ -47,13 +47,20 @@ CONFIGURATION
6. Other view settings (optional), such as filter criteria, pager.
To configure a recurring event:
1. Navigate to Administration > Extend and enable the Calendar Recurring
Event sub-module.
2. Add at least one of two fields (monthly event field and weekly event
field) shipped with the sub-module into the content type (for example
event) displayed in the view.
Features:
1. Add a long plain text field to present the RRULE string for recurring logic of an event. For example,
DTSTART:20200302T100000Z EXDATE:20200309T100000Z EXDATE:20200311T100000Z RRULE:FREQ=WEEKLY;UNTIL=20200331T120000Z;INTERVAL=1;WKST=MO;BYDAY=MO,WE
The rule above means a recurring event start from 2020-03-02 to 2020-03-31 and occurs every Monday and Wednesday except 2020-03-09 and 2020-03-11. The RRULE supports excluded time as well.
More information about the RRULE, please see https://github.com/jakubroztocil/rrule.
2. Then go the view setting page to specify the field as the RRUle field which is under Format:Full Calendar Display->Settings->Recurring Event Settings->RRule Field for recurring events.
3. The duration field is optional, which specifying the end time of each recurring event instance. The field value should be a string in the format hh:mm:ss.sss, hh:mm:sss or hh:mm. For example, "05:00" signifies 5 hours.
FEATURES:
-------------
* Day, week, month view
* Creating a new event by double clicking
......@@ -65,3 +72,73 @@ Features:
* Supports Multilingual
* Off-Canvas editing
* Popup Tooltip for event's description
API:
-------------
* Service
* View preprocess service (Drupal\fullcalendar_view\FullcalendarViewPreprocess)
This service implements the business logic of the calendar. Other module can decorate or override this service to define their own business logic.
* Timezone conversion service (Drupal\fullcalendar_view\TimezoneService)
* Taxonomy color service (Drupal\fullcalendar_view\TaxonomyColor)
* Plugin type
* View processor plugin (FullcalendarViewProcessor)
This plugin type provides the capability to alter the view preprocess working with other modules.
* Drupal JavaScript Settings (drupalSettings)
* languageSelector
Allow client to select language, if it is 1.
* updateConfirm
Event update confirmation pop-up dialog. If it is 1, a confirmation dialog will pop-up after dragging and dropping an event.
* dialogWindow
Open event links in dialog window. If it is 1, event links in the calendar will open in a dialog window.
* eventBundleType
The bundle (content) type of a new event.
* startField
The machine name of start date field.
* endField
The machine name of end date field.
* dblClickToCreate
Allow to create a new event by double clicking.
* entityType
Entity type.
* addForm
URL of the new event form.
* token
CSRF token.
* openEntityInNewTab
Show an event details in a new window (tab).
* calendar_options
The options of the Fullcalendar object.
* dialog_options
The options of the pop-up dialog object.
......@@ -336,20 +336,34 @@ class FullcalendarViewPreprocess {
$variables['#attached']['library'][] = 'fullcalendar_view/libraries.jsframe';
}
// Pass data to js file.
$variables['#attached']['drupalSettings'] = [
$variables['#attached']['drupalSettings'] = [
// Allow client to select language, if it is 1.
'languageSelector' => $options['languageSelector'],
'updateConfirm' => $options['updateConfirm'],
// Event update confirmation pop-up dialog.
// If it is 1, a confirmation dialog will pop-up after dragging and dropping an event.
'updateConfirm' => $options['updateConfirm'],
// Open event links in dialog window.
// If it is 1, event links in the calendar will open in a dialog window.
'dialogWindow' => $options['dialogWindow'],
// 'linkToEntity' => $link_to_entity,
// The bundle (content) type of a new event.
'eventBundleType' => $event_bundle_type,
// The machine name of start date field.
'startField' => $start_field,
// The machine name of end date field.
'endField' => $end_field,
// Allow to create a new event by double clicking.
'dblClickToCreate' => $dbl_click_to_create,
// Entity type.
'entityType' => $entity_type->id(),
// URL of the new event form.
'addForm' => isset($add_form) ? $add_form : '',
// CSRF token.
'token' => $token,
'openEntityInNewTab' => $options['openEntityInNewTab'],
// Show an event details in a new window (tab).
'openEntityInNewTab' => $options['openEntityInNewTab'],
// The options of the Fullcalendar object.
'calendar_options' => json_encode($calendar_options),
// The options of the pop-up dialog object.
'dialog_options' => json_encode($dialog_optoins),
];
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment