DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:exttab1:source

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:exttab1:source [2013-03-23 11:20] – removed obsolete comment 2001:4dd0:ff00:8eb9:873:6fea:8f02:11a4plugin:exttab1:source [2016-02-10 07:50] (current) – update with signature for PHP7 141.65.129.192
Line 1: Line 1:
 ====== Source code of the exttab1 plugin ====== ====== Source code of the exttab1 plugin ======
  
-The plugin consists of 1 (one) file. To use the plugin, it must be located in the ''lib/plugins/exttab1'' directory of your [[dokuwiki|DokuWiki]] installation. The file's name must be ''syntax.php''.+The plugin originally consisted of 1 (one) file. To use the plugin, it must be located in the ''lib/plugins/exttab1'' directory of your [[:start|DokuWiki]] installation. The file's name must be ''syntax.php''.
  
 <file php syntax.php> <file php syntax.php>
Line 18: Line 18:
     define('DOKU_PLUGIN', DOKU_INC . 'lib/plugins/');     define('DOKU_PLUGIN', DOKU_INC . 'lib/plugins/');
 require_once(DOKU_PLUGIN . 'syntax.php'); require_once(DOKU_PLUGIN . 'syntax.php');
- 
 /** /**
  * All DokuWiki plugins to extend the parser/rendering mechanism  * All DokuWiki plugins to extend the parser/rendering mechanism
Line 31: Line 30:
     var $bodyHasStartTag = false;     var $bodyHasStartTag = false;
     var $tableHasHeader  = false;     var $tableHasHeader  = false;
- 
     /**     /**
      * return some info      * return some info
Line 46: Line 44:
         );         );
     } // function getInfo     } // function getInfo
- 
     /**     /**
     * What kind of syntax are we?     * What kind of syntax are we?
Line 54: Line 51:
         return 'protected';         return 'protected';
     } // function getType     } // function getType
- 
     /**     /**
     * What kind of plugin are we?     * What kind of plugin are we?
Line 62: Line 58:
         return 'block';         return 'block';
     } // function getPType     } // function getPType
- 
     /**     /**
     * Where to sort in?     * Where to sort in?
Line 70: Line 65:
         return 100;         return 100;
     } // function getSort     } // function getSort
- 
     /**     /**
     * Connect pattern to lexer     * Connect pattern to lexer
Line 78: Line 72:
         $this->Lexer->addEntryPattern('<exttab1(?=.*</exttab1>)', $mode, 'plugin_exttab1');         $this->Lexer->addEntryPattern('<exttab1(?=.*</exttab1>)', $mode, 'plugin_exttab1');
     } // function connectTo     } // function connectTo
- 
     function postConnect()     function postConnect()
     {     {
         $this->Lexer->addExitPattern('</exttab1>', 'plugin_exttab1');         $this->Lexer->addExitPattern('</exttab1>', 'plugin_exttab1');
     } // function postConnect     } // function postConnect
- 
     /**     /**
      * Handle the match      * Handle the match
Line 99: Line 91:
       return true;       return true;
     } // function handle     } // function handle
- 
     /**     /**
      * Create output      * Create output
Line 110: Line 101:
      @return true, if rendering happens, false in all other cases      @return true, if rendering happens, false in all other cases
     */     */
-    function render($mode, &$renderer, $data)+    function render($mode, Doku_Renderer $renderer, $data)
     {     {
         if ($mode == 'xhtml' && strlen($data[0]) > 1) {         if ($mode == 'xhtml' && strlen($data[0]) > 1) {
Line 150: Line 141:
         return false;         return false;
     } // function render     } // function render
- 
     /**     /**
         handle tags for a new table line         handle tags for a new table line
Line 179: Line 169:
         return $my2c;         return $my2c;
     } // function _handleNewTableLine     } // function _handleNewTableLine
- 
     /**     /**
         handle start of table         handle start of table
Line 197: Line 186:
         return $my2c;         return $my2c;
     } // function _handleTableStart     } // function _handleTableStart
- 
     /**     /**
         handle table caption         handle table caption
Line 223: Line 211:
         return $my2c;         return $my2c;
     } // function _handleTableCaption     } // function _handleTableCaption
- 
     /**     /**
         handles regular table line         handles regular table line
Line 255: Line 242:
         return $my2c;         return $my2c;
     } // function _handleRegularLine     } // function _handleRegularLine
- 
     /**     /**
         handles table header entries         handles table header entries
Line 309: Line 295:
         return $retval;         return $retval;
     } // function _parseDisplayData     } // function _parseDisplayData
- 
 } // class syntax_plugin_exttab1 } // class syntax_plugin_exttab1
- 
 //Setup VIM: ex: et ts=4 enc=utf-8 : //Setup VIM: ex: et ts=4 enc=utf-8 :
- 
 </file> </file>
  
Line 332: Line 315:
 This snippet tests whether you provided your own class tag and adds ''class="exttab1"'' if you did not.  --- //[[werner.flamme@ufz.de|Werner Flamme]] 2006-12-04 21:55 CET// This snippet tests whether you provided your own class tag and adds ''class="exttab1"'' if you did not.  --- //[[werner.flamme@ufz.de|Werner Flamme]] 2006-12-04 21:55 CET//
  
 +The current version s of DokuWiki want a file called ''plugin.info.txt'' instead of the function ''getInfo()''. So you should put this file into the plugin directory too:
 +
 +<file - plugin.info.txt>
 +base   exttab1
 +author Werner Flamme
 +email  w.flamme@web.de
 +date   2016-01-23
 +name   Exttab1 for DokuWiki
 +desc   Allows extended (MediaWiki-style) tables inside DokuWiki
 +url    https://github.com/wernerflamme/dwexttab1
 +</file>
  
 +Both files have been updated to 2016-01-23, after adding the signature needed for PHP7.
plugin/exttab1/source.1364034046.txt.gz · Last modified: 2013-03-23 11:20 by 2001:4dd0:ff00:8eb9:873:6fea:8f02:11a4

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