Dear developers,
some time ago we implemented a custom widget and added it to our fork:
https://github.com/asig2016/egroupware/blob/19.1_p1/api/js/etemplate/et2_widget_currency.js8
https://github.com/asig2016/egroupware/blob/19.1_p1/api/src/Etemplate/Widget/Currency.php5
The widget is working just fine from there. But in order to have to minimize the differences between our fork and the upstream branch I tried to move the widget to a custom api application.
For this I used the hook etemplate2_register_widgets as used in the import_export application:
$setup_info[‘importexport’][‘hooks’][‘etemplate2_register_widgets’] = ‘importexport_admin_prefs_sidebox_hooks::widgets’;
I created I class file and added
Etemplate\Widget::registerWidget(‘achelper_widget_currency’, array(‘currency’));
at the end.
Since I din’t find a way to include the js file to be recognized before loading of the form I included it in the
*egw:uses …
section of etemplate2.js
in the
/api/js/etemplate/
folder.
The widget appears correctly in the templates I use it, but when I submit the form it does not transfer the value to the php $content array.
Is the way I moved the widget correct, what can I do to fix this issue?
Thanks a lot in advance and
Best regards
Alex
created
last reply
- 4
replies
- 1.1k
views
- 3
users
- 5
links