Events API Still Valid?

Events API Still Valid?

από Mike Churchward -
Αριθμός απαντήσεων: 8
Φωτογραφία Core developers Φωτογραφία Plugin developers Φωτογραφία Testers
We have done a lot of development using the Events API, and I now see that the Moodle Docs for this has it flagged as "obsolete" (http://docs.moodle.org/en/Development:Events).

Can we count on this remaining in core?

mike
Μέσος όρος βαθμολογίας: -
Σε απάντηση σε Mike Churchward

Re: Events API Still Valid?

από Petr Skoda -
Φωτογραφία Core developers Φωτογραφία Documentation writers Φωτογραφία Particularly helpful Moodlers Φωτογραφία Peer reviewers Φωτογραφία Plugin developers
Events are not obsoleted, only that page is κλείσιμο ματιού
Σε απάντηση σε Petr Skoda

Re: Events API Still Valid?

από Mike Churchward -
Φωτογραφία Core developers Φωτογραφία Plugin developers Φωτογραφία Testers
Okay. That's good.

Is there a reason the page is? Is there another page that describes the API?

mike
Σε απάντηση σε Mike Churchward

Re: Events API Still Valid?

από Martin Dougiamas -
Φωτογραφία Core developers Φωτογραφία Documentation writers Φωτογραφία Moodle HQ Φωτογραφία Particularly helpful Moodlers Φωτογραφία Plugin developers Φωτογραφία Testers
Mostly just the examples are obsolete. The Events API is not.

I'll update the page with better examples.
Σε απάντηση σε Martin Dougiamas

Re: Events API Still Valid?

από Martin Dougiamas -
Φωτογραφία Core developers Φωτογραφία Documentation writers Φωτογραφία Moodle HQ Φωτογραφία Particularly helpful Moodlers Φωτογραφία Plugin developers Φωτογραφία Testers
Σε απάντηση σε Martin Dougiamas

Re: Events API Still Valid?

από Matt Gibson -
Ah-ha, this is the same as Drupal's hooks system. I was hoping something like this would appear.

Is there any spec for the way it will be expanded in future? I'm thinking that it would be great to have it as part of the forms API so that fields could be added and removed by modules e.g. adding a new admin setting or user profile field. It would make core hacking a lot cleaner.
Σε απάντηση σε Matt Gibson

Re: Events API Still Valid?

από Martin Dougiamas -
Φωτογραφία Core developers Φωτογραφία Documentation writers Φωτογραφία Moodle HQ Φωτογραφία Particularly helpful Moodlers Φωτογραφία Plugin developers Φωτογραφία Testers
I agree that would be nice but I really can't see how that could work as part of our events API (which has been in Moodle since 1.9, by the way)... perhaps this is an entirely different API.

Could you expand on how you think that would work?
Σε απάντηση σε Martin Dougiamas

Re: Events API Still Valid?

από Sven Trümper -
It seems all events are fired AFTER (post) the action was complleted (course created,...)
Is there a way to create some kind of pre-event-hook.. some stuff that will be done before the action starts?

Some weeks ago i was looking for something like that... no success. Solved the problem another way... .. .anyway.

S.