ElkArte Community

Extending Elk => Addons => Addons ideas and questions => Topic started by: ahrasis on August 02, 2016, 07:26:48 am

Title: ADDONDIR
Post by: ahrasis on August 02, 2016, 07:26:48 am
I noticed that in 1.1b1, there is an addon directory (addons) which is on SSI / base level. I already restructure some of the addons to use that directory.

My first question, will this be made permanent in 1.1 and above?

My second question, in the future, will it be possible to add the templates, languages, scripts, css etc only in that one directory, (other than source files since currently I cannot figure out how to call them / make them work from that directory)?
Title: Re: ADDONDIR
Post by: emanuele on August 03, 2016, 05:14:17 pm
Yes, the idea is (one day not so far) to let the addons live completely in their own directory and not mess with the default installation.
At the moment is somehow easy for controllers and "subs", less for themes and languages and "assets" (js, css, images, etc) in general.
Title: Re: ADDONDIR
Post by: ahrasis on August 03, 2016, 08:57:18 pm
Ok. Noted that. I'll keep all addons updates of sources in the future to that folder instead and will leave templates, languages and css at their regular places.
Title: Re: ADDONDIR
Post by: live627 on August 06, 2016, 09:06:52 pm
Quote from: emanuele – Yes, the idea is (one day not so far) to let the addons live completely in their own directory and not mess with the default installation.
At the moment is somehow easy for controllers and "subs", less for themes and languages and "assets" (js, css, images, etc) in general.
Does that  include modules and integration files?
Title: Re: ADDONDIR
Post by: emanuele on August 07, 2016, 08:00:37 am
For the moment, modules may not be able to reside in the ADDONS dir simply because their loading rely on a "look for this class here" kind of code, and I feel it's mostly hard-coded for the SOURCEDIR, but definitely they should be there as well.

But "integration" files yes, indeed. Furthermore, if you follow the "correct" scheme (that I feel I described somewhere but I have no idea where and if my feeling is right or not, so I guess I have to publish it again), the "core features" page is able to "discover" the addons via integration files and let you enable/disable them without having to set the hooks in the install script (with the advantages of 1) execute the code only when the addon is actually used, 2) no more need to code "enable this addon" kind of buttons, 3) easier to post some code on the forum and tell other admins "put it there and it will just work", instead now you have to pack the code anyway, and probably more advantages).
Title: Re: ADDONDIR
Post by: live627 on August 07, 2016, 11:01:56 am
Quote the "core features" page is able to "discover" the addons via integration files and let you enable/disable them without having to set the hooks in the install script
Yep, I already use that,  but it bugs out if the file not in sources.

http://www.elkarte.net/community/index.php?topic=831.msg16689#msg16689
Title: Re: ADDONDIR
Post by: emanuele on August 07, 2016, 01:39:50 pm
/me missed the bug report... O:-)
Title: Re: ADDONDIR
Post by: live627 on August 07, 2016, 02:38:31 pm
There wasn't any.  I'm holding off on all future code contributions until beta 2 gets released.
Title: Re: ADDONDIR
Post by: emanuele on August 07, 2016, 03:38:59 pm
Oh, okay.