DokuWiki

It's better when it's simple

User Tools

Site Tools


devel:section_editor

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Last revision Both sides next revision
devel:section_editor [2013-11-02 02:16]
Klap-in
devel:section_editor [2015-05-27 13:59]
130.112.1.3
Line 17: Line 17:
  
 <file php syntax.php> <file php syntax.php>
-    function render($format, &$renderer, $data) {+    public function render($format, Doku_Renderer $renderer, $data) {
         $class = '';         $class = '';
         // Add section edit infos only in XHTML renderers which are         // Add section edit infos only in XHTML renderers which are
Line 25: Line 25:
             // If this section has a distinguishable name, you may add it to             // If this section has a distinguishable name, you may add it to
             // the method call as well             // the method call as well
 +            /* @var Doku_Renderer_xhtml $renderer */
             $class = $renderer->startSectionEdit($data['bytepos_start'],             $class = $renderer->startSectionEdit($data['bytepos_start'],
                                                  'plugin_exampleplugin');                                                  'plugin_exampleplugin');
Line 37: Line 38:
         if ($format === 'xhtml' &&         if ($format === 'xhtml' &&
             method_exists($renderer, 'finishSectionEdit')) {             method_exists($renderer, 'finishSectionEdit')) {
 +            /* @var Doku_Renderer_xhtml $renderer */
             $renderer->finishSectionEdit($data['bytepos_end']);             $renderer->finishSectionEdit($data['bytepos_end']);
         }         }
Line 45: Line 47:
  
 <file php syntax.php> <file php syntax.php>
-    function handle($match, $state, $pos, &$handler) {+    public function handle($match, $state, $pos, Doku_Handler $handler) {
         $data = array();         $data = array();
  
Line 58: Line 60:
  
 <file php action.php> <file php action.php>
-    function register(Doku_Event_Handler $controller) {+    public function register(Doku_Event_Handler $controller) {
         $controller->register_hook('HTML_SECEDIT_BUTTON', 'BEFORE', $this, '_editbutton');         $controller->register_hook('HTML_SECEDIT_BUTTON', 'BEFORE', $this, '_editbutton');
     }     }
  
-    function _editbutton(&$event, $param) {+    public function _editbutton(Doku_Event $event, $param) {
         // FIXME: Insert plugin name         // FIXME: Insert plugin name
         if ($event->data['target'] !== 'plugin_exampleplugin') {         if ($event->data['target'] !== 'plugin_exampleplugin') {
Line 94: Line 96:
  
 <file php action.php> <file php action.php>
-    function register(Doku_Event_Handler $controller) {+    public function register(Doku_Event_Handler $controller) {
         $controller->register_hook('HTML_SECEDIT_BUTTON', 'BEFORE', $this, '_editbutton');         $controller->register_hook('HTML_SECEDIT_BUTTON', 'BEFORE', $this, '_editbutton');
         $controller->register_hook('HTML_EDIT_FORMSELECTION', 'BEFORE', $this, '_editform');         $controller->register_hook('HTML_EDIT_FORMSELECTION', 'BEFORE', $this, '_editform');
     }     }
  
-    function _editform(&$event, $param) {+    public function _editform(Doku_Event $event, $param) {
         global $TEXT;         global $TEXT;
         // FIXME: Insert plugin name         // FIXME: Insert plugin name
Line 128: Line 130:
  
 <file php action.php> <file php action.php>
-    function register(Doku_Event_Handler $controller) {+    public function register(Doku_Event_Handler $controller) {
         $controller->register_hook('HTML_SECEDIT_BUTTON', 'BEFORE', $this, '_editbutton');         $controller->register_hook('HTML_SECEDIT_BUTTON', 'BEFORE', $this, '_editbutton');
         $controller->register_hook('HTML_EDIT_FORMSELECTION', 'BEFORE', $this, '_editform');         $controller->register_hook('HTML_EDIT_FORMSELECTION', 'BEFORE', $this, '_editform');
Line 134: Line 136:
     }     }
  
-    function _handle_edit_post($event) {+    public function _handle_edit_post(Doku_Event $event) {
         // FIXME: Insert the name of a form field you use         // FIXME: Insert the name of a form field you use
         if (!isset($_POST['some_of_the_form_fields_you_use'])) {         if (!isset($_POST['some_of_the_form_fields_you_use'])) {
devel/section_editor.txt ยท Last modified: 2018-04-06 21:42 by LarsDW223