Move mod/cal.php and mod/events.php to Module

This commit is contained in:
Philipp 2022-11-06 02:35:09 +01:00
parent 89fde911f9
commit f13c91b320
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
41 changed files with 1054 additions and 1109 deletions

View file

@ -22,7 +22,7 @@ $(document).ready(function () {
week: aStr.week,
day: aStr.day,
},
events: baseurl + moduleUrl + "/json/",
events: calendar_api,
header: {
left: "",
// center: 'title',
@ -35,7 +35,7 @@ $(document).ready(function () {
loading: function (isLoading, view) {
if (!isLoading) {
$("td.fc-day").dblclick(function () {
addToModal("/events/new?start=" + $(this).data("date"));
addToModal("/calendar/event/new?start=" + $(this).data("date"));
});
}
},
@ -103,18 +103,6 @@ $(document).ready(function () {
},
});
// center on date
var args = location.href.replace(baseurl, "").split("/");
if (modparams == 2) {
if (args.length >= 5) {
$("#events-calendar").fullCalendar("gotoDate", args[3], args[4] - 1);
}
} else {
if (args.length >= 4) {
$("#events-calendar").fullCalendar("gotoDate", args[2], args[3] - 1);
}
}
// echo the title
var view = $("#events-calendar").fullCalendar("getView");
$("#fc-title").text(view.title);
@ -186,7 +174,7 @@ $(document).ready(function () {
// loads the event into a modal
function showEvent(eventid) {
addToModal(baseurl + moduleUrl + "/?id=" + eventid);
addToModal(event_api + '/' + eventid);
}
function changeView(action, viewName) {
@ -329,7 +317,7 @@ function formatListViewEvent(event) {
// event-edit section.
function doEventPreview() {
$("#event-edit-preview").val(1);
$.post("events", $("#event-edit-form").serialize(), function (data) {
$.post("calendar/api/create", $("#event-edit-form").serialize(), function (data) {
$("#event-preview").append(data);
});
$("#event-edit-preview").val(0);

View file

@ -254,10 +254,10 @@ function editpost(url) {
// But first we have to test if the url links to an event. So we will split up
// the url in its parts.
var splitURL = parseUrl(url);
// Test if in the url path containing "events/event". If the path containing this
// Test if in the url path containing "calendar/event/show". If the path containing this
// expression then we will call the addToModal function and exit this function at
// this point.
if (splitURL.path.indexOf("events/event") > -1) {
if (splitURL.path.indexOf("calendar/event/show") > -1) {
addToModal(splitURL.path);
return;
}