Sortable extension events

Note: We are moving the topics of this forum and it will be deleted at some point

Publish your own request for comments/change or patches for the next version of phpBB. Discuss the contributions and proposals of others. Upcoming releases are 3.2/Rhea and 3.3.
User avatar
nickvergessen
Former Team Member
Posts: 733
Joined: Sun Oct 07, 2007 11:54 am
Location: Stuttgart, Germany
Contact:

Re: Sortable extension events

Post by nickvergessen »

naderman wrote:I don't think anything ever happened with this. I really don't think this should be based on the database. Instead we should allow extensions to specify other extensions that they have to run before/after and if they should default to the end or beginning, I think that should be enough to sort them sufficiently for extensions to work correctly.
Sounds like a good idea

Not sure whether it is sufficient to have it global, or whether a "per event" decision is needed
Member of the Development-TeamNo Support via PM

User avatar
PayBas
Registered User
Posts: 305
Joined: Tue Jul 29, 2008 6:08 pm
Contact:

Re: Sortable extension events

Post by PayBas »

Something like this?

[ function_to_call, order, depends_on ]

Code: Select all

'core.page_header'        => array('page_header_func','last','vendor/ext'),
'core.page_header_after'    => array('do_something','first'),
'core.common'    => array('common_append'), 

User avatar
Pico88
Registered User
Posts: 73
Joined: Tue Apr 12, 2011 2:32 pm

Re: Sortable extension events

Post by Pico88 »

Ok. That is for core events.

What about template events?

Nicofuma
3.2 Release Manager
3.2 Release Manager
Posts: 299
Joined: Sun Apr 13, 2014 1:40 am
Location: Paris

Re: Sortable extension events

Post by Nicofuma »

maybe could we define a special optionnal comment for the first line of the event. Someting like this (to be consistent with what PayBas proposed):

Code: Select all

<!-- EVENT_ORDER last -->
<!-- EVENT_DEPENDS_ON vendor/ext1, vendor/ext2 -->
Member of the phpBB Development-Team
No Support via PM

User avatar
Pico88
Registered User
Posts: 73
Joined: Tue Apr 12, 2011 2:32 pm

Re: Sortable extension events

Post by Pico88 »

Well, do you think each developer will care about that? I don't think so.

User avatar
PayBas
Registered User
Posts: 305
Joined: Tue Jul 29, 2008 6:08 pm
Contact:

Re: Sortable extension events

Post by PayBas »

That's the point right? If you are able to use depends_on type arguments, you can interact with other extensions, whether the developer of that ext wants it or not. Democracy ;).

Most of my extensions wont even need to use order/depends_on, because they stand alone. So other authors can use first/last to position around it. And if multiple extensions want to be first/last, you use the depends_on.

User avatar
Pico88
Registered User
Posts: 73
Joined: Tue Apr 12, 2011 2:32 pm

Re: Sortable extension events

Post by Pico88 »

I cannot agree with you.

For example:
An admin uses 3 exts which each add diffrents link to navbar (such as rules, faq etc.) - so his board has 3 new links in navbar. Next the board admin want to change their order, because he thinks that i.e. rules should be the first or be the second, but now it is the last. With your proposal it is not possible. Also defined thier position by developer also doesn't change nothing.

User avatar
PayBas
Registered User
Posts: 305
Joined: Tue Jul 29, 2008 6:08 pm
Contact:

Re: Sortable extension events

Post by PayBas »

Oh you are looking at this from the user's point of view, not the developer's.

Well... I guess if a board has sufficiently large amounts of extensions installed, they probably don't mind investing a little time in customizing (hard-coding) a new navbar_header.html

Of course I agree with you that it would be best if users are able to sort everything as much as they want..., but this will require some serious new functionality (as indicated in all the posts above). Curious how this will turn out.

User avatar
Sumanai
Registered User
Posts: 95
Joined: Sat Aug 31, 2013 11:12 am

Re: Sortable extension events

Post by Sumanai »

Pico88 wrote:I cannot agree with you.

For example:
An admin uses 3 exts which each add diffrents link to navbar (such as rules, faq etc.) - so his board has 3 new links in navbar. Next the board admin want to change their order, because he thinks that i.e. rules should be the first or be the second, but now it is the last. With your proposal it is not possible. Also defined thier position by developer also doesn't change nothing.
+1
Should be possibility of easy configure from the admin panel.
Sorry for my English.

User avatar
MattF
Extension Customisations
Extension Customisations
Posts: 675
Joined: Mon Mar 08, 2010 9:18 am

Re: Sortable extension events

Post by MattF »

Yes, the original point of all this was a way for an admin to define the order of precedence their installed extensions have over each other in cases where two or more extensions may have some kind of overlap.
Has an irascible disposition.

Post Reply