Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Extends LimeSurvey core class from module

  • LouisGac
  • LouisGac's Avatar Topic Author
  • Visitor
  • Visitor
4 years 7 months 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 topic has been locked.
  • gabrieljenik
  • gabrieljenik's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
4 years 7 months ago #187604 by gabrieljenik
Replied by gabrieljenik on topic Extends LimeSurvey core class from module
Nice. How this shoukd co exist with minor upgrades?

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Checkout our Reporting Solutions and our plugin shop at www.encuesta.biz .

The topic has been locked.
  • LouisGac
  • LouisGac's Avatar Topic Author
  • Visitor
  • Visitor
4 years 7 months ago #187605 by LouisGac
Replied by LouisGac on topic Extends LimeSurvey core class from module
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
The topic has been locked.
  • gabrieljenik
  • gabrieljenik's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
4 years 7 months ago #187606 by gabrieljenik
Replied by gabrieljenik on topic Extends LimeSurvey core class from module
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

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Checkout our Reporting Solutions and our plugin shop at www.encuesta.biz .

The topic has been locked.
  • LouisGac
  • LouisGac's Avatar Topic Author
  • Visitor
  • Visitor
4 years 7 months ago - 4 years 7 months ago #187608 by LouisGac
Replied by LouisGac on topic Extends LimeSurvey core class from module
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: 4 years 7 months ago by LouisGac.
The topic has been locked.
  • LouisGac
  • LouisGac's Avatar Topic Author
  • Visitor
  • Visitor
4 years 7 months ago #187646 by LouisGac
Replied by LouisGac on topic Extends LimeSurvey core class from module
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
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose