DokuWiki

It's better when it's simple

User Tools

Site Tools


devel:releases:refactor2

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
devel:releases:refactor2 [2020-09-26 12:06] – [Refactor fulltext search functions and class Doku_Indexer] s-saharadevel:releases:refactor2 [2020-09-28 11:39] – [Only new events with dokuwiki\Form\Form from DokuWiki] s-sahara
Line 11: Line 11:
  
 DokuWiki used before this release ''Doku_Form'' at a lot of places. The old ''Doku_Form'' triggered a [[codesearch>HTML_*FORM_OUTPUT]] event, when it was outputted by ''html_form()''. DokuWiki core code is updated to use the [[devel:form|new forms]], therefore the old events are **not triggered** anymore. The new style ''Form'' triggers [[codesearch>FORM_*_OUTPUT]] event when its HTML-representation is generated by ''toHTML()'' method.  DokuWiki used before this release ''Doku_Form'' at a lot of places. The old ''Doku_Form'' triggered a [[codesearch>HTML_*FORM_OUTPUT]] event, when it was outputted by ''html_form()''. DokuWiki core code is updated to use the [[devel:form|new forms]], therefore the old events are **not triggered** anymore. The new style ''Form'' triggers [[codesearch>FORM_*_OUTPUT]] event when its HTML-representation is generated by ''toHTML()'' method. 
 +
 +The old ''Doku_Form'' had been passed to handler of old [[codesearch>HTML_EDIT_FORMSELECTION]] event, that is **not triggered** anymore. Instead, DokuWiki core code has changed to triggers new [[codesearch>EDIT_FORM_ADDTEXTAREA]] event that provides a ''dokuwiki/Form/Form'' in the ''%%$data['form']%%'' and the event handler will complete the [[edit_window|editor]] form.
  
 :!: To enable your actions again, the new event handlers have to be implemented as well. The new events should pass the new ''dokuwiki\Form\Form'' object as the event data. The old event handlers can be kept temporary for backward compatibility. :!: To enable your actions again, the new event handlers have to be implemented as well. The new events should pass the new ''dokuwiki\Form\Form'' object as the event data. The old event handlers can be kept temporary for backward compatibility.
  
 +See for the description of the events:
 +| New  |[[devel:event:FORM_EDIT_OUTPUT]], [[devel:event:EDIT_FORM_ADDTEXTAREA]], [[devel:event:FORM_LOGIN_OUTPUT]], [[devel:event:FORM_CONFLICT_OUTPUT]], [[devel:event:FORM_DRAFT_OUTPUT]], [[devel:event:FORM_RECENT_OUTPUT]], [[devel:event:FORM_REVISIONS_OUTPUT]], [[devel:event:FORM_SEARCH_OUTPUT]], [[devel:event:FORM_SUBSCRIBE_OUTPUT]], [[devel:event:FORM_UPDATEPROFILE_OUTPUT]], [[devel:event:FORM_PROFILEDELETE_OUTPUT]], [[devel:event:FORM_REGISTER_OUTPUT]], [[devel:event:FORM_RESENDPWD_OUTPUT]], [[devel:event:FORM_UPLOAD_OUTPUT]], [[devel:event:FORM_SEARCHMEDIA_OUTPUT]], [[devel:event:FORM_QUICKSEARCH_OUTPUT]] |
 +| Old  |[[devel:event:HTML_EDITFORM_OUTPUT]], [[devel:event:HTML_EDIT_FORMSELECTION]], [[devel:event:HTML_LOGINFORM_OUTPUT]], [[devel:event:HTML_CONFLICTFORM_OUTPUT]], [[devel:event:HTML_DRAFTFORM_OUTPUT]], [[devel:event:HTML_RECENTFORM_OUTPUT]], [[devel:event:HTML_REVISIONSFORM_OUTPUT]], [[devel:event:HTML_SUBSCRIBEFORM_OUTPUT]], [[devel:event:HTML_UPDATEPROFILEFORM_OUTPUT]], [[devel:event:HTML_PROFILEDELETEFORM_OUTPUT]], [[devel:event:HTML_REGISTERFORM_OUTPUT]], [[devel:event:HTML_RESENDPWDFORM_OUTPUT]], [[devel:event:HTML_UPLOADFORM_OUTPUT]] | 
  
-Changes to the ''dokuwiki\Form\Form''. An optional argument is added to ''toHTML()'' to make code simple without a separate event trigger.+Changes to the ''dokuwiki\Form\Form'' class. An optional argument is added to ''toHTML()'' to make code simple without a separate event trigger.
 <code diff> <code diff>
 - Event::createAndTrigger('FORM_SEARCH_OUTPUT', $searchForm); - Event::createAndTrigger('FORM_SEARCH_OUTPUT', $searchForm);
Line 22: Line 27:
 </code> </code>
  
-See for the description of the events: 
-| New  |[[devel:event:FORM_EDIT_OUTPUT]], [[devel:event:FORM_LOGIN_OUTPUT]], [[devel:event:FORM_CONFLICT_OUTPUT]], [[devel:event:FORM_DRAFT_OUTPUT]], [[devel:event:FORM_RECENT_OUTPUT]], [[devel:event:FORM_REVISIONS_OUTPUT]], [[devel:event:FORM_SEARCH_OUTPUT]], [[devel:event:FORM_SUBSCRIBE_OUTPUT]], [[devel:event:FORM_UPDATEPROFILE_OUTPUT]], [[devel:event:FORM_PROFILEDELETE_OUTPUT]], [[devel:event:FORM_REGISTER_OUTPUT]], [[devel:event:FORM_RESENDPWD_OUTPUT]], [[devel:event:FORM_UPLOAD_OUTPUT]], [[devel:event:FORM_SEARCHMEDIA_OUTPUT]], [[devel:event:FORM_QUICKSEARCH_OUTPUT]] | 
-| Old  |[[devel:event:HTML_EDITFORM_OUTPUT]], [[devel:event:HTML_LOGINFORM_OUTPUT]], [[devel:event:HTML_CONFLICTFORM_OUTPUT]], [[devel:event:HTML_DRAFTFORM_OUTPUT]], [[devel:event:HTML_RECENTFORM_OUTPUT]], [[devel:event:HTML_REVISIONSFORM_OUTPUT]], [[devel:event:HTML_SUBSCRIBEFORM_OUTPUT]], [[devel:event:HTML_UPDATEPROFILEFORM_OUTPUT]], [[devel:event:HTML_PROFILEDELETEFORM_OUTPUT]], [[devel:event:HTML_REGISTERFORM_OUTPUT]], [[devel:event:HTML_RESENDPWDFORM_OUTPUT]], [[devel:event:HTML_UPLOADFORM_OUTPUT]] |  
- 
-**Changed event**: The [[devel:event:HTML_EDIT_FORMSELECTION]] event provides in the ''%%$data['form']%%'' a ''dokuwiki/Form/Form'' instead of ''Doku_Form''. The event handlers might need a update, temporary an else-if can be used which checks the class of the form. 
-<code php> 
-if (is_a($data['form'], 'dokuwiki\Form\Form')) { 
-    ... use the new form 
-} else { 
-    //temporary fallback 
-    ... use the old form 
-} 
-</code> 
  
 ==== UI elements implemented as class methods ==== ==== UI elements implemented as class methods ====

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki