Admin: Add config fullcalendar_settings BT#18748

In order to edit the FullCalendar v3 JS settings.
pull/3872/head
Julio Montoya 4 years ago
parent 299382241f
commit 7ae25268fa
  1. 8
      main/calendar/agenda_js.php
  2. 13
      main/install/configuration.dist.php
  3. 5
      main/template/default/agenda/month.tpl

@ -299,6 +299,14 @@ if (!empty($onHoverInfo)) {
}
$tpl->assign('on_hover_info', $options);
$settings = api_get_configuration_value('fullcalendar_settings');
$extraSettings = '';
if (!empty($settings) && isset($settings['settings']) && !empty($settings['settings'])) {
$encoded = json_encode($settings['settings']);
$extraSettings = substr($encoded, 1, -1).',';
}
$tpl->assign('fullcalendar_settings', $extraSettings);
$templateName = $tpl->get_template('agenda/month.tpl');
$content = $tpl->fetch($templateName);
$tpl->assign('content', $content);

@ -1902,6 +1902,19 @@ ALTER TABLE gradebook_comment ADD CONSTRAINT FK_C3B70763AD3ED51C FOREIGN KEY (gr
// Enable X-Sendfile headers on forced download files going through document/download.php
//$_configuration['enable_x_sendfile_headers'] = false;
// Extra settings for the agenda (FullCalendar)
/*$_configuration['fullcalendar_settings'] = [
'settings' => [
'businessHours' => [
// days of week. an array of zero-based day of week integers (0=Sunday)
'dow' => [0, 1, 2, 3, 4], // Monday - Friday
'start' => '10:00',
'end' => '18:00',
],
'firstDay' => 0, // 0 = Sunday, 1 = Monday
]
];*/
// KEEP THIS AT THE END
// -------- Custom DB changes
// Add user activation by confirmation email

@ -239,7 +239,10 @@ $(function() {
defaultDate: defaultStartDate,
firstHour: 8,
firstDay: 1,
selectable : true,
{% if fullcalendar_settings %}
{{ fullcalendar_settings }}
{% endif %}
selectable : true,
selectHelper: true,
viewDisplay: function(view) {
/* When changing the view update the qtips */

Loading…
Cancel
Save