diff --git a/action/jsinfo.php b/action/jsinfo.php --- a/action/jsinfo.php +++ b/action/jsinfo.php @@ -1,50 +1,53 @@ register_hook('DOKUWIKI_STARTED', 'AFTER', $this, 'add_jsinfo_information'); } /** * Add the language variable to the JSINFO variable */ function add_jsinfo_information(&$event, $param) { global $conf; global $JSINFO; $lang = $conf['lang']; switch($lang) { case 'de': case 'de-informal': $lc = 'de'; break; case 'nl': $lc = 'nl'; break; + case 'fr': + $lc = 'fr'; + break; default: $lc = 'en'; } $JSINFO['plugin']['davcal']['language'] = $lc; if(isset($_SERVER['REMOTE_USER']) && !is_null($_SERVER['REMOTE_USER'])) { $JSINFO['plugin']['davcal']['disable_sync'] = $this->getConf('disable_sync'); $JSINFO['plugin']['davcal']['disable_settings'] = $this->getConf('hide_settings'); } else { $JSINFO['plugin']['davcal']['disable_settings'] = 1; $JSINFO['plugin']['davcal']['disable_sync'] = 1; } $JSINFO['plugin']['davcal']['disable_ics'] = $this->getConf('disable_ics'); } } diff --git a/lang/de-informal/settings.php b/lang/de-informal/settings.php --- a/lang/de-informal/settings.php +++ b/lang/de-informal/settings.php @@ -1,13 +1,14 @@ */ $lang['hide_settings'] = 'Verstecke den Knopf Einstellungen unterhalb des Kalenders'; $lang['disable_sync'] = 'Deaktiviere CalDAV Synchronisation (aber erlaube Private URL)'; $lang['disable_ics'] = 'Deaktiviere Private URL Synchronisation (aber erlaube CalDAV Synchronisierung)'; $lang['monday'] = 'Wochenbeginn ist am Montag statt am Sonntag'; $lang['timezone'] = 'Setze die Zeitzone des Kalenders (zB "Europe/Vienna" oder "local" für Browser-basierende Zeit)'; $lang['workweek'] = 'Zeige nur die Arbeitswoche'; $lang['weeknumbers'] = 'Zeige Wochennummern'; +$lang['timeformat'] = 'Zeitformat, \'lang\' bedeutet sprachbasiert'; diff --git a/lang/de/settings.php b/lang/de/settings.php --- a/lang/de/settings.php +++ b/lang/de/settings.php @@ -1,14 +1,15 @@ */ $lang['hide_settings'] = 'Verstecke den Knopf Einstellungen unterhalb des Kalenders'; $lang['disable_sync'] = 'Deaktiviere CalDAV Synchronisation (aber erlaube Private URL)'; $lang['disable_ics'] = 'Deaktiviere Private URL Synchronisation (aber erlaube CalDAV Synchronisierung)'; $lang['monday'] = 'Wochenbeginn ist am Montag statt am Sonntag'; $lang['timezone'] = 'Setze die Zeitzone des Kalenders (zB "Europe/Vienna" oder "local" für Browser-basierende Zeit)'; $lang['workweek'] = 'Zeige nur die Arbeitswoche'; $lang['weeknumbers'] = 'Zeige Wochennummern'; +$lang['timeformat'] = 'Zeitformat, \'lang\' bedeutet sprachbasiert'; diff --git a/lang/en/settings.php b/lang/en/settings.php --- a/lang/en/settings.php +++ b/lang/en/settings.php @@ -1,13 +1,14 @@ */ $lang['hide_settings'] = 'Hide the settings button beneath the calendar'; $lang['disable_sync'] = 'Disable CalDAV synchronisation (but still allow private ICS URL)'; $lang['disable_ics'] = 'Disable private ICS URL synchronisation (but still allow CalDAV sync)'; $lang['monday'] = 'Start week on Monday instead of Sunday'; $lang['timezone'] = 'Set the timezone of the calendar (e.g. "Europe/Vienna" or "local" for browser-based)'; $lang['workweek'] = 'Show only workweek'; $lang['weeknumbers'] = 'Show week numbers'; +$lang['timeformat'] = 'Time format to use, lang means based on language'; diff --git a/lang/fr/settings.php b/lang/fr/settings.php --- a/lang/fr/settings.php +++ b/lang/fr/settings.php @@ -1,13 +1,14 @@ '); jQuery.post( DOKU_BASE + 'lib/exe/ajax.php', { call: 'plugin_davcal', id: dw_davcal__modals.page, page: dw_davcal__modals.page, action: 'saveSettings', params: postArray }, function(data) { var result = data['result']; var html = data['html']; jQuery('#dw_davcal__ajaxsettings').html(html); if(result === true) { location.reload(); } } ); }; } dialogButtons[LANG.plugins.davcal['cancel']] = function () { dw_davcal__modals.hideSettingsDialog(); }; var settingsHtml = '
'; if(JSINFO.plugin.davcal['disable_settings'] && JSINFO.plugin.davcal['disable_sync'] && JSINFO.plugin.davcal['disable_ics']) { settingsHtml += LANG.plugins.davcal['nothing_to_show']; } if(!JSINFO.plugin.davcal['disable_settings']) { settingsHtml += '' + '' + '' + '' + ''; } if(!JSINFO.plugin.davcal['disable_sync']) { settingsHtml += ''; settingsHtml += ''; } if(!JSINFO.plugin.davcal['disable_ics']) { settingsHtml += ''; } settingsHtml += '
' + LANG.plugins.davcal['timezone'] + '
' + LANG.plugins.davcal['timeformat'] + '
' + LANG.plugins.davcal['weeknumbers'] + '
' + LANG.plugins.davcal['only_workweek'] + '
' + LANG.plugins.davcal['start_monday'] + '
' + LANG.plugins.davcal['sync_url'] + '
' + LANG.plugins.davcal['sync_ical'] + '
' + LANG.plugins.davcal['private_url'] + '
' + '
' + '
'; dw_davcal__modals.$settingsDialog = jQuery(document.createElement('div')) .dialog({ autoOpen: false, draggable: true, title: LANG.plugins.davcal['settings'], resizable: true, buttons: dialogButtons, }) .html( settingsHtml ) .parent() .attr('id','dw_davcal__settings') .show() .appendTo('.dokuwiki:first'); jQuery('#dw_davcal__settings').position({ my: "center", at: "center", of: window }); // Initialize current settings if(!JSINFO.plugin.davcal['disable_settings']) { var $tzdropdown = jQuery('#dw_davcal__settings_timezone'); jQuery('#fullCalendarTimezoneList option').each(function() { jQuery(''); } if(edit || (dw_davcal__modals.settings['calids'].length < 1)) { $dropdown.prop('disabled', true); } // Set up existing/predefined values jQuery('#dw_davcal__tz_edit').val(dw_davcal__modals.detectedTz); jQuery('#dw_davcal__currenttz_edit').val(dw_davcal__modals.currentTz); jQuery('#dw_davcal__uid_edit').val(calEvent.id); jQuery('#dw_davcal__eventname_edit').val(calEvent.title); jQuery('#dw_davcal__eventfrom_edit').val(calEvent.start.format('YYYY-MM-DD')); jQuery('#dw_davcal__eventfromtime_edit').val(calEvent.start.format('HH:mm')); jQuery('#dw_davcal__eventdescription_edit').val(calEvent.description); if(calEvent.attachments && (calEvent.attachments !== null)) { for(var i=0; i' + url + '' + LANG.plugins.davcal['delete'] + ''; jQuery('#dw_davcal__editevent_attachments > tbody:last').append(row); } } dw_davcal__modals.attachAttachmentDeleteHandlers(); jQuery('#dw_davcal__editevent_attach').on("click", function(e) { e.preventDefault(); var url = jQuery('#dw_davcal__editevent_attachment').val(); jQuery('#dw_davcal__editevent_attachment').val('http://'); var row = '' + url + '' + LANG.plugins.davcal['delete'] + ''; jQuery('#dw_davcal__editevent_attachments > tbody:last').append(row); dw_davcal__modals.attachAttachmentDeleteHandlers(); return false; }); if(calEvent.allDay && (calEvent.end === null)) { jQuery('#dw_davcal__eventto_edit').val(calEvent.start.format('YYYY-MM-DD')); jQuery('#dw_davcal__eventtotime_edit').val(calEvent.start.format('HH:mm')); } else if(calEvent.allDay) { endEvent = moment(calEvent.end); endEvent.subtract(1, 'days'); jQuery('#dw_davcal__eventto_edit').val(endEvent.format('YYYY-MM-DD')); jQuery('#dw_davcal__eventotime_edit').val(endEvent.format('HH:mm')); } else { jQuery('#dw_davcal__eventto_edit').val(calEvent.end.format('YYYY-MM-DD')); jQuery('#dw_davcal__eventtotime_edit').val(calEvent.end.format('HH:mm')); } jQuery('#dw_davcal__allday_edit').prop('checked', calEvent.allDay); // attach event handlers jQuery('#dw_davcal__edit .ui-dialog-titlebar-close').click(function(){ dw_davcal__modals.hideEditEventDialog(); }); jQuery('#dw_davcal__eventfrom_edit').datetimepicker({format:'YYYY-MM-DD', formatDate:'YYYY-MM-DD', datepicker: true, timepicker: false, }); jQuery('#dw_davcal__eventfromtime_edit').datetimepicker({format:'HH:mm', formatTime:'HH:mm', datepicker: false, timepicker: true, step: 15}); jQuery('#dw_davcal__eventto_edit').datetimepicker({format:'YYYY-MM-DD', formatDate:'YYYY-MM-DD', datepicker: true, timepicker: false, }); jQuery('#dw_davcal__eventtotime_edit').datetimepicker({format:'HH:mm', formatTime:'HH:mm', datepicker: false, timepicker: true, step:15}); jQuery('#dw_davcal__allday_edit').change(function() { if(jQuery(this).is(":checked")) { jQuery('#dw_davcal__eventfromtime_edit').prop('readonly', true); jQuery('#dw_davcal__eventtotime_edit').prop('readonly', true); } else { jQuery('#dw_davcal__eventfromtime_edit').prop('readonly', false); jQuery('#dw_davcal__eventtotime_edit').prop('readonly', false); } }); jQuery('#dw_davcal__allday_edit').change(); }, /** * Attach handles to delete the attachments to all 'delete' links */ attachAttachmentDeleteHandlers: function() { jQuery("#dw_davcal__editevent_attachments .deleteLink").on("click", function(e) { e.preventDefault(); var tr = jQuery(this).closest('tr'); tr.css("background-color", "#FF3700"); tr.fadeOut(400, function() { tr.remove(); }); return false; }); }, /** * Show an info/confirmation dialog * @param {Object} confirm Whether a confirmation dialog (true) or an info dialog (false) is requested */ showDialog : function(confirm) { if(dw_davcal__modals.$confirmDialog) return; var dialogButtons = {}; var title = ''; if(confirm) { title = LANG.plugins.davcal['confirmation']; var pageid = dw_davcal__modals.page; if(dw_davcal__modals.settings['multi']) { pageid = jQuery("#dw_davcal__editevent_calendar option:selected").val(); } dialogButtons[LANG.plugins.davcal['yes']] = function() { jQuery.post( DOKU_BASE + 'lib/exe/ajax.php', { call: 'plugin_davcal', id: pageid, page: dw_davcal__modals.page, action: dw_davcal__modals.action, params: { uid: dw_davcal__modals.uid } }, function(data) { dw_davcal__modals.completeCb(data); } ); dw_davcal__modals.hideDialog(); }; dialogButtons[LANG.plugins.davcal['cancel']] = function() { dw_davcal__modals.hideDialog(); }; } else { title = LANG.plugins.davcal['info']; dialogButtons[LANG.plugins.davcal['ok']] = function() { dw_davcal__modals.hideDialog(); }; } dw_davcal__modals.$dialog = jQuery(document.createElement('div')) .dialog({ autoOpen: false, draggable: true, title: title, resizable: true, buttons: dialogButtons, }) .html( '
' + dw_davcal__modals.msg + '
' ) .parent() .attr('id','dw_davcal__confirm') .show() .appendTo('.dokuwiki:first'); jQuery('#dw_davcal__confirm').position({ my: "center", at: "center", of: window }); // attach event handlers jQuery('#dw_davcal__confirm .ui-dialog-titlebar-close').click(function(){ dw_davcal__modals.hideDialog(); }); }, /** * Hide the edit event dialog */ hideEditEventDialog : function() { dw_davcal__modals.$editEventDialog.empty(); dw_davcal__modals.$editEventDialog.remove(); dw_davcal__modals.$editEventDialog = null; }, /** * Hide the confirm/info dialog */ hideDialog: function() { dw_davcal__modals.$dialog.empty(); dw_davcal__modals.$dialog.remove(); dw_davcal__modals.$dialog = null; }, /** * Hide the settings dialog */ hideSettingsDialog: function() { dw_davcal__modals.$settingsDialog.empty(); dw_davcal__modals.$settingsDialog.remove(); dw_davcal__modals.$settingsDialog = null; } };