devel:releases:refactor2
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
devel:releases:refactor2 [2020-09-28 11:39] – [Only new events with dokuwiki\Form\Form from DokuWiki] s-sahara | devel:releases:refactor2 [2021-12-19 16:09] (current) – moved to [[devel:releases:refactor2021]] Klap-in | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Refactoring ====== | ||
- | Suggestions for development version (August 2020 and later) of Dokuwiki. | ||
- | |||
- | [[devel: | ||
- | |||
- | ===== Refactored UI elements using Form\Form class ===== | ||
- | |||
- | Implemented by [[pr> | ||
- | |||
- | ==== Only new events with dokuwiki\Form\Form from DokuWiki ==== | ||
- | |||
- | DokuWiki used before this release '' | ||
- | |||
- | The old '' | ||
- | |||
- | :!: To enable your actions again, the new event handlers have to be implemented as well. The new events should pass the new '' | ||
- | |||
- | See for the description of the events: | ||
- | | New |[[devel: | ||
- | | Old |[[devel: | ||
- | |||
- | Changes to the '' | ||
- | <code diff> | ||
- | - Event:: | ||
- | - return $searchForm-> | ||
- | + return $searchForm-> | ||
- | </ | ||
- | |||
- | |||
- | ==== UI elements implemented as class methods ==== | ||
- | |||
- | [[devel: | ||
- | |||
- | **Deprecated** functions: [[codesearch> | ||
- | |||
- | **Deprecated** and only used in DokuWiki: [[codesearch> | ||
- | |||
- | **Removed** functions: [[codesearch> | ||
- | |||
- | <code diff> | ||
- | // inc/ | ||
- | - html_login($svg) | ||
- | + (new dokuwiki\Ui\Login($svg))-> | ||
- | |||
- | - html_denied() | ||
- | + (new dokuwiki\Action\Denied())-> | ||
- | |||
- | - html_edit() | ||
- | + (new dokuwiki\Ui\Editor)-> | ||
- | |||
- | - html_edit_form($data) | ||
- | + (new dokuwiki\Ui\Editor)-> | ||
- | |||
- | - html_minoredit() | ||
- | + // obsoleted: integrated into dokuwiki\Ui\Editor:: | ||
- | |||
- | - html_showrev() | ||
- | + (new dokuwiki\Ui\PageView)-> | ||
- | |||
- | - html_show($txt) | ||
- | + (new dokuwiki\Ui\PageView($txt))-> | ||
- | |||
- | - html_draft() | ||
- | + (new Ui\PageDraft)-> | ||
- | |||
- | - html_locked() | ||
- | + (new dokuwiki\Action\Locked())-> | ||
- | |||
- | - html_revisions($first, | ||
- | + (new dokuwiki\Ui\Revisions($first, | ||
- | |||
- | - html_recent($first, | ||
- | + (new dokuwiki\Ui\Recent($first, | ||
- | |||
- | - html_index($ns) | ||
- | + (new dokuwiki\Ui\Index($ns))-> | ||
- | |||
- | - html_list_index($item) | ||
- | + (new dokuwiki\Ui\Index)-> | ||
- | |||
- | - html_li_index($item) | ||
- | + (new dokuwiki\Ui\Index)-> | ||
- | |||
- | - html_backlinks() { | ||
- | + (new dokuwiki\Ui\Backlinks)-> | ||
- | |||
- | - html_diff($text, | ||
- | + (new dokuwiki\Ui\Diff($text, | ||
- | |||
- | - html_diff_head($l_rev, | ||
- | + // changed to protected method; dokuwiki\Ui\Diff():: | ||
- | |||
- | - html_diff_navigation($pagelog, | ||
- | + // changed to protected method; dokuwiki\Ui\Diff():: | ||
- | |||
- | - html_diff_navigationlink($difftype, | ||
- | + // changed to protected method; dokuwiki\Ui\Diff():: | ||
- | |||
- | - html_insert_softbreaks($diffhtml) | ||
- | + (new dokuwiki\Ui\Diff())-> | ||
- | |||
- | - html_conflict($text, | ||
- | + (new dokuwiki\Ui\Conflict($text, | ||
- | |||
- | - html_register() | ||
- | + (new dokuwiki\Ui\UserRegister)-> | ||
- | |||
- | - html_updateprofile() | ||
- | + (new dokuwiki\Ui\UserProfile)-> | ||
- | |||
- | - html_resendpwd() | ||
- | + (new dokuwiki\Ui\UserResendPwd)-> | ||
- | </ | ||
- | |||
- | <code diff> | ||
- | // inc/ | ||
- | - tpl_subscribe() | ||
- | + (new \dokuwiki\Ui\Subscribe)-> | ||
- | </ | ||
- | |||
- | ==== Small callbacks changed to annonymous functions ==== | ||
- | |||
- | **Removed** functions: [[codesearch> | ||
- | |||
- | <code diff> | ||
- | // html_hilight_callback() is integrated into html_hilight() | ||
- | - $html = @preg_replace_callback("/ | ||
- | + $html = @preg_replace_callback("/ | ||
- | + | ||
- | + if (!isset($match[2])) { | ||
- | + | ||
- | + } | ||
- | + | ||
- | + }, $html); | ||
- | </ | ||
- | |||
- | **Removed** function: [[codesearch> | ||
- | <code diff> | ||
- | // html_softbreak_callback() is integrated into Ui\Diff:: | ||
- | - return preg_replace_callback('/< | ||
- | + return preg_replace_callback('/< | ||
- | + ... | ||
- | + }, $diffhtml); | ||
- | </ | ||
- | |||
- | **Changed** usage of [[codesearch> | ||
- | |||
- | <code diff> | ||
- | - function html_buildlist($data, | ||
- | + function html_buildlist($data, | ||
- | + ... | ||
- | + // set callback function to build the <li> tag, formerly defined as html_li_default() | ||
- | + if (!is_callable($lifunc)) { | ||
- | + $lifunc = function ($item) { | ||
- | + return '< | ||
- | + }; | ||
- | + } | ||
- | + .... | ||
- | + } | ||
- | // Example if you want to use own ' | ||
- | + | ||
- | + $html = html_buildlist($data, | ||
- | |||
- | // if you want to use callbacks in Ui\Index class: | ||
- | + $idx = new dokuwiki\Ui\Index; | ||
- | + $html = html_buildlist($data, | ||
- | </ | ||
- | |||
- | ==== Other changed functions ==== | ||
- | |||
- | |||
- | Changed function: [[codesearch> | ||
- | <code diff> | ||
- | - html_sizechange($sizechange, | ||
- | + $html = html_sizechange($sizechange) | ||
- | </ | ||
- | ===== Sort with collator ===== | ||
- | |||
- | [[pr> | ||
- | |||
- | Improved sort in different languages. Not backward compatible. Maybe include library with exist check? | ||
- | |||
- | |||
- | ===== Refactor fulltext search functions and class Doku_Indexer ===== | ||
- | |||
- | |||
- | [[pr> | ||
- | |||
- | Following Functions will be Deprecated: | ||
- | |||
- | Indexer: | ||
- | [[codesearch> | ||
- | [[codesearch> | ||
- | [[codesearch> | ||
- | [[codesearch> | ||
- | [[codesearch> | ||
- | [[codesearch> | ||
- | |||
- | MetadataIndex: | ||
- | [[codesearch> | ||
- | [[codesearch> | ||
- | [[codesearch> | ||
- | |||
- | FulltextIndex: | ||
- | [[codesearch> | ||
- | [[codesearch> | ||
- | [[codesearch> | ||
- | [[codesearch> | ||
- | [[codesearch> | ||
- | |||
devel/releases/refactor2.1601285951.txt.gz · Last modified: 2020-09-28 11:39 by s-sahara