Extends LimeSurvey core class from module

More
1 week 2 days ago #187599 by LouisGac
Continuing with the new LimeSurvey external module engine
see: www.limesurvey.org/forum/development/118...odule-system-for-ls4


it is now possible for any external developer to extends any LimeSurvey controllers class. No need anymore to use the events plugin system, you can just extends the core classes in the normal OOP way.

I've added a quick example with global settings:
github.com/LimeSurvey/LimeSurvey/tree/de...admin/globalsettings

notice than any admin views/subviews can be overriden by just adding it in the view folder:
github.com/LimeSurvey/LimeSurvey/tree/de...globalsettings/views

So now we have the basis for a SOLID way of extending LimeSurvey.

I'll write some documentation this afternoon.

Feel free to write some feedbacks and questions in this thread.
The following user(s) said Thank You: Jane

Please Log in or Create an account to join the conversation.

LimeSurvey Partners
More
1 week 2 days ago #187604 by gabrieljenik
Nice. How this shoukd co exist with minor upgrades?

Cheers,
Gabriel - www.Encuesta.Biz - Authorized Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Assistance on LimeSurvey forum and LimeSurvey core developpement are on my free time (Say thanks ?)....[img]

Please Log in or Create an account to join the conversation.

More
1 week 2 days ago #187605 by LouisGac
gabrieljenik: that the main point. You will never ever need anymore to modify the LS Core classes. You just extends them. It's just the very normal way to work in OOP: like LimeSurvey Core classes extend Yii Core Classes:
github.com/LimeSurvey/LimeSurvey/tree/develop/application/core

Please Log in or Create an account to join the conversation.

More
1 week 2 days ago #187606 by gabrieljenik
Yes, I understand that.
I meant in terms of file locations. Need to go over the details, but sounded like overrides would be close to the original files. If i see correctly, they will be separated on modules, right?

Thanks

Cheers,
Gabriel - www.Encuesta.Biz - Authorized Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Assistance on LimeSurvey forum and LimeSurvey core developpement are on my free time (Say thanks ?)....[img]

Please Log in or Create an account to join the conversation.

More
1 week 2 days ago - 1 week 2 days ago #187608 by LouisGac
once everything is validated, I'll add a module folder in the upload directory.

about the link with "original files that can evolve", in general, when you extend a class you often use snippet with "parent::function()"

Exemple:
github.com/LimeSurvey/LimeSurvey/blob/85...roller.php#L200-L221
Last edit: 1 week 2 days ago by LouisGac.

Please Log in or Create an account to join the conversation.

More
1 week 1 day ago #187646 by LouisGac
I've just added some documentation:
github.com/LimeSurvey/LimeSurvey/tree/de...admin/globalsettings


gabrieljenik: you'll see I answer to your question in this part:
github.com/LimeSurvey/LimeSurvey/tree/de...enderwrappedtemplate

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!