DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:externallink

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Last revisionBoth sides next revision
plugin:externallink [2020-11-04 15:56] – [Discussion] Fix for 2020-07-29 “Hogfather” ryssonplugin:externallink [2022-01-18 23:15] Klap-in
Line 48: Line 48:
  */  */
    
-if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../../').'/'); 
-if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); 
-require_once(DOKU_PLUGIN.'syntax.php'); 
    
 /** /**
Line 90: Line 87:
      * Handle the match      * Handle the match
      */      */
-    function handle($match, $state, $pos, &$handler){+    function handle($match, $state, $pos, Doku_Handler $handler){
         $match = substr($match,3,-2); //strip [[@ from start and ]] from end         $match = substr($match,3,-2); //strip [[@ from start and ]] from end
         $match = explode("|",$match);         $match = explode("|",$match);
Line 99: Line 96:
      * Create output      * Create output
      */      */
-    function render($mode, &$renderer, $data) {+    function render($mode, Doku_Renderer $renderer, $data) {
         if($mode == 'xhtml'){         if($mode == 'xhtml'){
             $text=$this->_externallink($renderer, $data[0], $data[1]);             $text=$this->_externallink($renderer, $data[0], $data[1]);
Line 109: Line 106:
  
  
-    function _externallink(&$renderer, $url, $name = NULL) {+    function _externallink($renderer, $url, $name = NULL) {
         global $conf;         global $conf;
         // Just some basic cleaning         // Just some basic cleaning
Line 147: Line 144:
  
 } }
-?> 
 </code> </code>
  
plugin/externallink.txt · Last modified: 2022-01-18 23:16 by Klap-in

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