Text_Wiki Xhtml external link force popups

From: Date: Wed, 27 Sep 2006 20:11:57 +0000
Subject: Text_Wiki Xhtml external link force popups
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-44115@lists.php.net to get a copy of this message
Apparently the default behavior of Text_Wiki regarding the rendering of Xhtml external url links is to insert javascript which forces the links to open in a new window (popup links). Call me crazy, but this behavior seems like something that should should be decided by the user of the class rather than being hard coded. There is in fact a $conf variable in the Text_Wiki_Render_Xhtml_Url class, however I am unable to see any straightforward way of changing it's 'target' value. Relevant file: see lines 100-101 of PEAR/Text/Wiki/Render/Xhtml/Url.php I went ahead and created a fix. Diff: http://wi-fizzle.com/PEAR/Text/Wiki/Render/Xhtml/Url.php.diff source: http://wi-fizzle.com/PEAR/Text/Wiki/Render/Xhtml/Url.phps I made a public static variable for class Text_Wiki_Render_Xhtml_Url called $default_conf. People can now, if they wish, easily alter the default configuration for this class ahead of time if they want. Whenever a new Text_Wiki_Render_Xhtml_Url's constructor runs, the datamember $conf will be initialized based on the current values of the static array self::$default_conf. This is my first code submission to PEAR so I apologize if it violates your standards. This seemed like a better solution than passing in even more insane arrays, though. Hope you guys accept it. Best Regards, Jay Taylor

« previous php.pear.dev (#44115) next »