[jgen] check for file exists when user opens plugin params

19 views
Skip to first unread message

Russ Winter

unread,
Dec 28, 2016, 10:45:16 PM12/28/16
to joomla-de...@googlegroups.com
I'm trying to find a way to check for the existance of a file or folder and post a message to the plugin configuration page.

I am already doing this at installation and update in the script.php with JFolder::exists and JFile::exists to actually complete the check and test for true/false but I can't seem to workout how to do the same thing and post an error message back to the plugin params page when the user opens it to configure options.

Any pointers would be helpful and appreciated.

thanks a lot,

Russ



Michael Babker

unread,
Dec 28, 2016, 10:56:51 PM12/28/16
to joomla-de...@googlegroups.com
You'd probably need to use the `onContentPrepareForm` event since the admin views don't dispatch events the same way the frontend does.

--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-general+unsub...@googlegroups.com.
To post to this group, send email to joomla-dev-general@googlegroups.com.
Visit this group at https://groups.google.com/group/joomla-dev-general.
For more options, visit https://groups.google.com/d/optout.

Russ Winter

unread,
Dec 28, 2016, 11:11:11 PM12/28/16
to joomla-de...@googlegroups.com
thanks Michael,

I was trying a variety of events to no-avail and hadn't come across that on in my research on the docs-wiki. Will give it a go

Cheers
Russ



--
Regards,
Russ Winter




On 29 December 2016 at 13:56, Michael Babker <michael...@gmail.com> wrote:
You'd probably need to use the `onContentPrepareForm` event since the admin views don't dispatch events the same way the frontend does.
On Wed, Dec 28, 2016 at 9:45 PM, Russ Winter <wint...@gmail.com> wrote:
I'm trying to find a way to check for the existance of a file or folder and post a message to the plugin configuration page.

I am already doing this at installation and update in the script.php with JFolder::exists and JFile::exists to actually complete the check and test for true/false but I can't seem to workout how to do the same thing and post an error message back to the plugin params page when the user opens it to configure options.

Any pointers would be helpful and appreciated.

thanks a lot,

Russ



--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-general+unsubscribe@googlegroups.com.

To post to this group, send email to joomla-dev-general@googlegroups.com.
Visit this group at https://groups.google.com/group/joomla-dev-general.
For more options, visit https://groups.google.com/d/optout.

Russ Winter

unread,
Dec 29, 2016, 2:31:02 AM12/29/16
to joomla-de...@googlegroups.com
it might just be me mis-using it and my lack of knowledge with plugin architecture, but still no joy, maybe it's just not possible from a plugins params view in Admin. I certainly don't know of any plagins I use that post additional messages on viewing the xml params.

I just thought it was a good "feature/function" to check that extension that my plugin is used with was still installed and if not, post a message or automagically disable the plugin if I didn't find the related component and in this particular case; if the params view didn't find an override that is installed with the plugin.

I was just trying to catch if the user installed my plugin, then either un-installed the component or changed templates (hence the override was now not present under the new /templates/<templatename>/html/com_component 

I guess it's not hugely important, just a "nice to have"

Thanks for the suggestion anyway Michael

--

Regards,
Russ Winter


Hannes Papenberg

unread,
Dec 29, 2016, 1:52:35 PM12/29/16
to Joomla! General Development
Create your own field type that you're installing with your plugin. Include the type and path to the type in your xml and in the type do your checks.

To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-general+unsub...@googlegroups.com.

Russ Winter

unread,
Dec 29, 2016, 10:22:07 PM12/29/16
to joomla-de...@googlegroups.com
Thank you Hannes,

will review the documentation wiki and have a go at that

Russ


--
Regards,
Russ Winter




Reply all
Reply to author
Forward
0 new messages