New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor html_* functions into Ui class member using Form\Form class #3198
Conversation
avoid unit test errors in _test\tests\test\edit_and_save.test.php
no space between printed items such as date, unsername, sizechange info. Further work needed for better looks/design.
no space between printed items such as date, unsername, sizechange info. Further work needed for better looks/design. The code for page navigation in Ui\Revisions is different with Ui\Recent.
fix code sniffer errors (method name is not in camel caps format)
$form is object, therefore it is always treated as reference without '&'.
Ui\Diff()::diffNavigation() still uses Doku_Form class, Further work needed!
NOTE: necessary to inhibit prefillInput. Form\DropdownElement::toHTML() calls val(), which calls val('') during prefillInput(), will cause wrong selected option.
call dbg_deprecated(), even this function lost compatibility because its argument $param['form'] has changed to hold Form\Form object
I have added the event HTML_EDIT_FORMSELECTION also to the wiki page, due to the form change. No other event included a Doku_Form so far I could see. Or do you know others? Thanks for adding the deprecations as well! |
to prevent breaks in old HTML_EDIT_FORMSELECTION event handler, such as edittable plugin
encourage plugin devs to use new Form class
@Klap-in , the event HTML_EDIT_FORMSELECTION has changed to EDIT_FORM_ALTERNATE to prevent breaks in relevant plugins, most likely edittable. |
https://www.dokuwiki.org/devel:events_list#naming_structure |
The old and the new event name i.e. HTML_EDIT_FORMSELECTION and EDIT_FORM_ALTERNATE are both unclear for me. Then name convention asks: (for me that is the final remark on this PR ;-) ) |
change event name to prevent breaks in old HTML_EDIT_FORMSELECTION or early proposed EDIT_FORM_ALTERNATE event handler, such as edittable plugin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your work!
Event Descriptions for new FORM_*_OUTPUT in dev manual has updated! |
For me this is fine to merge. Fine to go? |
@ssahara awesome work! thank you! |
Funny, I came here to ask the same question 😉 |
This PR contains new Ui\Editor class that will replace html_edit() defined in inc/html.php file.
Some html_* functions that display HTML forms, in other words UI, may be refactored using new Form\Form class and implemented as a Ui class member. Is this a right way for further work?