I've started a module to allow frontenduser users to add events to the calendar module. I want to avoid duplicating code wherever possible to preserve compatibility however I've got a bit stuck. The add_admin_event action prints out a nice form but only when logged into the admin and with the wrong form action. I can correct the form action by doing a search & replace on the whole page using ContentPreRender but how can I trick Calendar into thinking an admin user is currently logged in?
Any tips much appreciated.
Calendar X FrontEndusers
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
- Location: Fernie British Columbia, Canada
Re: Calendar X FrontEndusers
I could really use this module too...
There's an easy way to do this, get the module instance of the calendar module, and call AddEvent
There's an easy way to do this, get the module instance of the calendar module, and call AddEvent
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Re: Calendar X FrontEndusers
That's more or less what I'm doing (unfortunately Calendar is quite a complex module). The trouble is I want to use high-level methods so that low-level changes to the calendar module don't break my module but the high level methods don't work when an admin user is not logged in...
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
- Location: Fernie British Columbia, Canada
Re: Calendar X FrontEndusers
Actually, Calendar isn't that bad..... feusers is way more complex 
You can't call an admin action from the frontend, the url's are completely different..... the best way would be to
a) modify the calendar to put the form into a function,
b) call that function from the admin_add_event action
c) call that same function from within your module, and
have that form call your action (somehow), that calls calendar->AddEvent
but it may just be easier to write your own form. I was thinking of writing this module as well, and I would have just written my own form.

You can't call an admin action from the frontend, the url's are completely different..... the best way would be to
a) modify the calendar to put the form into a function,
b) call that function from the admin_add_event action
c) call that same function from within your module, and
have that form call your action (somehow), that calls calendar->AddEvent
but it may just be easier to write your own form. I was thinking of writing this module as well, and I would have just written my own form.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Re: Calendar X FrontEndusers
Gotcha. This is only my second CMS module and my first was purely backend. I've got lots to learn 

Re: Calendar X FrontEndusers
OK I've had a go at it. Pending the CMS forge project approval, here's an XML file of FeuCalendar 0.1 alpha. Please test and comment.
[gelöscht durch Administrator]
[gelöscht durch Administrator]