Hello Richard,
We will make an effort to speak few words of english :-)
You created a specific "Provision" class which inherits from
"Pxxo_Widget_IdentityManager" in order to overload the
"Pxxo_Widget_IdentityManager" templates and localization resources.
This will work however it's not the best way to develop with pxxo.
Inheritance will be useful if you need to change the widget behavior
strongly.
Good practices are to avoid widget's inheritance when you only want to
overload theme and localization. Pxxo has a built in way for this
task.
For example, to overload default theme of
"Pxxo_Widget_IdentityManager" you only have to create this directory:
/var/www/provision/templates/Pxxo_Widget_IdentityManager/default/
Then you only have to overload the resource you want to be changed:
image, css, or html.
As i18n resources are just considered as other resources in a pxxo
widget, you can also overload the i18n resources just by creating:
/var/www/provision/templates/Pxxo_Widget_IdentityManager/default/i18n/en_GB.php
However concerning your localization problem, I think there is a bug
in the IdentityManager... (sorry we forgot to test it with other
languages than french)
Here is the description of the bug:
Pxxo_Widget_IdentityManager includes as child other widgets:
Pxxo_Widget_Identity_Auth
Pxxo_Widget_Identity_Register
Pxxo_Widget_Identity_...
These sub widgets are corresponding to the tabs (auth, register...).
The bug is that when they are instantiated by
Pxxo_Widget_IdentityManager, the Lang parameter (Theme param also) is
not forwarded to these children.
To quickly workaround the bug you could define the language globally
using the pxxo registry this way:
require_once 'Pxxo/Registry.php';
$registry = Pxxo_Registry::getInstance();
$registry->language = 'en_GB';
Put this piece of code just after the paths definitions in
/var/www/provision/config.php
Then all the widget (parent and child) should be translated magically
in English :-)
My side, I will patch IdentiyManager to allow Lang and Theme
parameters forwarding to children.
Last thing, you asked me in you last email about pxxo philosophy and
the pxxo design pattern:
- pxxo widgets are able to by hierarchical: one parent widget could
have several children and these children could also have children
(this is the composite design pattern)
- pxxo widgets are able to be decorated by other widgets: it means
that a widget could decide to insert as its direct parent another
widget (decorator design pattern)
- most of the time when developing an application we don't uses
inheritance we try to give priority to widget composition. One
application <=> A (big) widget tree
Hope it will help you.
regards,
Stéphane Gully