Advice on component implementation

32 views
Skip to first unread message

Ruud van Lent

unread,
Sep 29, 2016, 9:36:20 AM9/29/16
to Joomla! General Development
Hi,

I have a bunch of plugins (content and system).
I want to create a component (my first :)) that will show all of my installed plugins (cpanel) and gives the user the possibility to configure them from this component.

Basically it can be compared to com_plugins that only shows my plugins and where the user can configure each plugin.
I want to build upon what is present as much as possible.

In my components cpanel view I invoke (via eg JRoute::_('index.php?option=com_plugins&view=plugins&task=plugin.edit&extension_id=' . $item->extension_id);) com_plugins to configure the plugin.

So far so good, but how can I return to my components cpanel view when closing (save & close or cancel) the com_plugins plugin view?
Currently I am redirected to com_plugins plugins view.

All thoughts, hints, advice, best whishes :), etc. are highly appreciated.
thanks in advance for thinking along,
regards,
Ruud.

Viper

unread,
Sep 29, 2016, 11:59:53 AM9/29/16
to Joomla! General Development
Just rearrange you code small.  Because you cannot redirect to another URL directly from com_plugins, as it set in com_plugins/controller.php, just display modal window and show the plugin configuration template. And then attach handler to 'Save' button. Example you can view in menu editor, then you select menu type.

Ruud van Lent

unread,
Sep 29, 2016, 12:10:08 PM9/29/16
to Joomla! General Development
Thanks Viper,

That makes sense :)
I have also looked at how other components are doing this and found acymailing opening the plugin view in a new browser tab. That would be even easier to implement, but the modal would make it more 'integrated' in the component.

Another (far fetched) way to do it is to have the component hold all the parameters (in a table per plugin) and then in the plugin instead of reading the params from the plugin, read the configured params from the components table...

Not sure how that would impact performance etc.
Any thoughts on that?

Viper

unread,
Sep 29, 2016, 12:28:42 PM9/29/16
to Joomla! General Development
1. many users hate popups :) Me too.
2. Many tables in one DB can reduce performance.
Second point required a brief description, maybe, how I see the implementation:
Show the list of plugins
when user click on row show the modal dialog with plugin parameters.
In model which extends JModelForm load the plugin XML file and select their parameters from DB and return.
Create a view.raw.php and assign form to $this->form, basically this view is the same as default view, but need to be exists because content in modal should be displayed via raw URL(&format=raw in URL).
After that you can redirect user or stay on the list.

Ruud van Lent

unread,
Sep 29, 2016, 1:04:31 PM9/29/16
to Joomla! General Development
Yes, popups are not my favorite too  need to look into what happens 
when showing on different devices (responsive) etc.


What I was thinking of was one table for my component with the following 
fields: id, extension, params

so per plugin there would only be one record. all settings would go into 
the params field.

In the constructor of the plugin I can load the params from this table.

So if I am correct the performance penalty is only one extra db lookup 
for the params per trigger of the plugin.



Doing it this way is (almost) fully integrated configuration of the 
plugin via my component (except for publish / unpublish plugin)


But this would also mean that I am 'copying' functionality already 
present, functionality that also needs to be maintained etc.
Reply all
Reply to author
Forward
0 new messages