Example System Plugin

10 views
Skip to first unread message

David Barrett

unread,
Jun 4, 2010, 6:57:28 AM6/4/10
to joomla-de...@googlegroups.com

Due to the problems I had updating my system plugin, I am going to put together an example system plugin that will hopefully help others from some of the headaches I had!  The example plugin will have a custom parameter (JForm field) and demonstrate language support.  I am pleased to say that the custom parameter side is complete and fully functioning (and it may be that the custom field included may be of use to others, as it is an enhanced list allowing multiple add using CSV notation).

 

However, I am now having problems with the language side.  My language strings are not being picked up, and I just get the placeholders.  Snippet from my XML:

 

<?xml version="1.0" encoding="utf-8"?>

<extension version="1.6" type="plugin" group="system" method="upgrade">

       <name>System - Registration Validator (for Joomla 1.6)</name>

       <version>2.1.1</version>

       <creationDate>May 2010</creationDate>

       <author>David Barrett</author>

       <authorEmail>joo...@cedit.biz</authorEmail>

       <authorUrl>http://www.cedit.biz</authorUrl>

       <copyright>(C) 2010 David Barrett. All rights reserved.</copyright>

       <license>http://www.gnu.org/copyleft/gpl.html GNU/GPL</license>

       <description>PLG_SYSTEM_REGISTRATION_VALIDATOR_DESCRIPTION</description>

      

       <files>

              <filename plugin="cedit_registrationvalidator">cedit_registrationvalidator.php</filename>

              <filename>index.html</filename>

              <folder>elements</folder>

              <folder>language</folder>

       </files>

      

       <languages>         

              <language tag="en-GB">en-GB.plg_system_cedit_registrationvalidator.ini</language>

              <language tag="nl-NL">nl-NL.plg_system_cedit_registrationvalidator.ini</language>

              <language tag="de-DE">de-DE.plg_system_cedit_registrationvalidator.ini</language>

              <language tag="ru-RU">ru-RU.plg_system_cedit_registrationvalidator.ini</language>

       </languages>

 

On install, and in the plugin edit page, I just get PLG_SYSTEM_REGISTRATION_VALIDATOR_DESCRIPTION shown instead of the detailed description in my language file.  The other parameters are similar.  The language files are both in the root of the plugin folder, and also in a language/en-GB, etc. folder (as it seems from one of the example plugins that this is the new format).

 

Hopefully someone can put me on the right track for sorting this.  As soon as it is, I’ll put together the example plugin as a download (or I could do this sooner if that would be easier for someone to demonstrate how the language should be implemented?).

 

I believe that once the above issues are ironed out for me, I will be able to update all my plugins for compatibility with Joomla 1.6 before J1.6 reaches final release.

 

Regards,

Dave Barrett
MCSA
Mobile: 07799 411974

http://www.cedit.biz

Rules Manager for Outlook - sorting your inbox so you don't have to
Registration Validator - protect your Joomla! site from bots and spammers

 

David Barrett

unread,
Jun 5, 2010, 8:41:15 AM6/5/10
to joomla-de...@googlegroups.com

I’m not sure if this newsgroup supports attachments – if it doesn’t, I’ll post a link to the plugin later today.

 

Attached is first draft of an example system plugin.  I would appreciate it if people could help complete these issues:

 

-          Language is working, but not for install.  i.e. the description of the plugin is NOT shown on install (though is shown in the parameters page).

-          I still haven’t worked out how to name parameter sets (fieldsets) properly, as can be seen.

-          Finally (I think), my custom field uses hidden elements to look tidier.  When these hidden elements are made visible, the parameter div is too small to show the extra controls.  Is there any way I can resolve this?

 

I hope this plugin will prove useful to other developers once complete.  It would certainly have saved me lots of work had one been available!

Example Joomla 1.6 System Plugin.zip

infograf768

unread,
Jun 8, 2010, 4:49:00 AM6/8/10
to Joomla! General Development
I replied concerning languages in your other mail.
For the language file .sys.ini to be taken into account at install/
update, it has to be placed in the extension language folder
i.e
language/en-GB/en-eg.extensioname.sys.ini

I have updated the plugin content example in trunk to show this.

JM

On 5 June, 14:41, "David Barrett" <d...@cedit.biz> wrote:
> I'm not sure if this newsgroup supports attachments - if it doesn't, I'll
> post a link to the plugin later today.
>
> Attached is first draft of an example system plugin.  I would appreciate it
> if people could help complete these issues:
>
> -          Language is working, but not for install.  i.e. the description
> of the plugin is NOT shown on install (though is shown in the parameters
> page).
>
> -          I still haven't worked out how to name parameter sets (fieldsets)
> properly, as can be seen.
>
> -          Finally (I think), my custom field uses hidden elements to look
> tidier.  When these hidden elements are made visible, the parameter div is
> too small to show the extra controls.  Is there any way I can resolve this?
>
> I hope this plugin will prove useful to other developers once complete.  It
> would certainly have saved me lots of work had one been available!
>
> Regards,
>
> Dave Barrett  <http://www.microsoft.com/learning/mcp/default.asp> MCSA
> Mobile: 07799 411974
>
>  <http://www.cedit.biz/>http://www.cedit.biz
>
>  <http://www.outlookrulesmanager.com/> Rules Manager for Outlook - sorting
> your inbox so you don't have to
>  <http://www.registrationvalidator.com/> Registration Validator - protect
> your Joomla! site from bots and spammers
>
>  Example Joomla 1.6 System Plugin.zip
> 24KViewDownload

David Barrett

unread,
Jun 8, 2010, 4:59:51 AM6/8/10
to joomla-de...@googlegroups.com
Thank-you. I am syncing with the trunk now so I'll take a look. Is there
also an example (or could there be!) for the custom fieldsets for a plugin
that you could point me at?

JM

--
You received this message because you are subscribed to the Google Groups
"Joomla! General Development" group.
To post to this group, send an email to joomla-de...@googlegroups.com.
To unsubscribe from this group, send email to
joomla-dev-gene...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/joomla-dev-general?hl=en-GB.

David Barrett

unread,
Jun 8, 2010, 5:30:58 AM6/8/10
to joomla-de...@googlegroups.com
Just to confirm that the changes detailed work fine - language files are now
being parsed correctly at all stages in the plugin.

One other query regarding language... In the example plugin, there is this
comment block:
<!--
if you want to install the language files in the
plugin folder.
Create a "language" folder at the root of the pack
i.e
language/en-GB/en-GB.plg_content_example.ini
language/en-GB/en-GB.plg_content_example.sys.ini
-->

I may have misunderstood this. I have created the files in the
language/en-GB folder, and removed them from the plugin root folder (of the
install package). On install, it works, but I receive an error that
en-GB.plg_system_sxample.ini could not be found. If I place this file in
the root of the install package, then I don't get this error.

So... is the language folder required? Or should I just be putting the
language files in the root, and ignoring this folder? I presume that I
shouldn't need to duplicate the files in two places?

Thanks.

-----Original Message-----
From: joomla-de...@googlegroups.com
[mailto:joomla-de...@googlegroups.com] On Behalf Of infograf768
Sent: 08 June 2010 09:49
To: Joomla! General Development
Subject: Re: Example System Plugin

JM

--

Reply all
Reply to author
Forward
0 new messages