Calendar X FrontEndusers

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
tamlyn

Calendar X FrontEndusers

Post by tamlyn »

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.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Calendar X FrontEndusers

Post by calguy1000 »

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
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.
tamlyn

Re: Calendar X FrontEndusers

Post by tamlyn »

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...
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Calendar X FrontEndusers

Post by calguy1000 »

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.
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.
tamlyn

Re: Calendar X FrontEndusers

Post by tamlyn »

Gotcha. This is only my second CMS module and my first was purely backend. I've got lots to learn :)
tamlyn

Re: Calendar X FrontEndusers

Post by tamlyn »

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]
Locked

Return to “Modules/Add-Ons”