Hi Marc,

Le 18/07/2013 22:21, Marc Andreu Fernandez a écrit :
> With the help of Melissa's Aeroclub plugin and the Paypal plugin and the
> Plugin docs (which are not quite easy to follow using Google Tranlator ;-) )


> * Do I need any content in the lang folder? For now I do not want to
> translate anything until I am sure that it works. I will try later on this
> part if it is optional.

No, translations are not required for anything in Galette to work. Just
take care to use _T("My string") in PHP files and {_T string="My
string"} in templates files instead of just "My strind", and to write
all strings in english :)

> * I do not have SQL tables to create for now, do I need to create empty
> files?

No. The only file that is really required for a plugin to work is the
_defile.php with the appropriate content.

Yo do not even need to create empty folders for lang, sql and so on if
you do not need them (well, in the present case, lang will be needed in
the future, but not sql).

> * Do I need a template file for each PHP plugin file? For example
> adherentTest.tpl? Any documentation about how to create those templates? Is
> it using any framework technology? I do not have CSS or JS for now, can I
> use default styles?

No, one tpl file per template was just the way Galette used to do that
(well, that is no longer true for each of them).
The only point is that templates must be used to display content to user.

Templating system used is Smarty 3 (http://www.smarty.net/).

You are not required to add any CSS or JS, just use Galette ones :)

As for JS, note that we're using JQuery, and JQueryUI. All UI plugins
are not loaded per default.
For example, to use JQueryUI dialog plugin, you will have to use:
$tpl->assign('require_dialog', true);

That will load required files for that part.

> * The only file that I have for now is the adherentTest.php. That code is
> extracted from Melissa plugin import.php file as she told me. For now I
> only need to make sure that that code complies and runs. I mean, it stores
> a sample user into DB with all required fields. I have the PHP code to
> connect google and fetch all the data that I need, I will add later once I
> am sure that I reused the import.php code properly as a plugin in Galette.
> And please help me to review the few files of the plugin, the define.php,
> menu.tpl, etc... I am not 100% about some content the I added.
> Any comment or review will be very helpful because I am getting some errors
> and I am a bit lost.

First, a note: please do not use tabs but spaces in your Galette code
(to suit coding standards), as my editors are configured to display
coding standards issues, that is the first thing I change every time I
open a file :)

And if you plan to work on main Galette code in the future, note that
coding standard must be followed (I spent hours and hours to make the
entire code compliant).

I've quickly edited your code to fix some issues. You can retrieve the
modified version from a Git repo:

Well, some notes:
- take care of path. You get numerous spaces in your paths (ie. ".. /"
instead of "../" or "xyz.php " instead of "xyz.php") - see
- the name of the plugin in the _define.php fle is used for display, you
can use something that is more easy to read - see
- the path you have to use in menu.tpl is related to name:
galette_{plugin_normalized_name}_path. Normalized name is just plugin
name, lower case, and with spaces replaced by "_" - see
- avoid using existing variables names in configuration files. i'm a bit
unsure that will really break something for now, but... Just make vars
spécific to plugin; it' way more safe ;) - see

OK, after those changes, I got the new entry in the menu, with the
correct path to get plugin.

I had to make one change to get it working, as it (see
That is a "Galette bug" since a default status is initialized when
object is instanciated, but not in the same property used for storage...

Creation and modification dates are not the work of a plugin.
Passwords may no longer be required.

Well, you used required fields from Galette, that can be changed from
the interface. I'm not sure an import plugin should use them since they
are only user configuration; and do not reflect what is *really*
required for Galette to work as expected.

So, see

> Well, sorry for the amount of questions, but it is not easy for me to
> follow up the french (translated somehow by google) documentation.

First, the french only documentation is not really a big help for you, I
can understand you have some questions about it.

And second... Everything is not documented yet (and probably won't be);
you are really welcome to ask your questions :)

Please note that I made changes to your plugin very quickly, I may have
omitted many things, I've just tried to have it working to show you the
way. Hope that helps!


Attachment: signature.asc
Description: OpenPGP digital signature

Galette-devel mailing list

Répondre à