From: <lu...@us...> - 2009-09-23 17:42:02
|
Revision: 21710 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=21710&view=rev Author: luciash Date: 2009-09-23 17:41:54 +0000 (Wed, 23 Sep 2009) Log Message: ----------- [FIX] smarty function.button.php: new param _escape: if set to 'y', will escape the apostrophes in onclick attribute - useful when rendering the button links using JS/jQuery in ('...') Modified Paths: -------------- trunk/lib/smarty_tiki/function.button.php Modified: trunk/lib/smarty_tiki/function.button.php =================================================================== --- trunk/lib/smarty_tiki/function.button.php 2009-09-23 17:36:43 UTC (rev 21709) +++ trunk/lib/smarty_tiki/function.button.php 2009-09-23 17:41:54 UTC (rev 21710) @@ -16,6 +16,7 @@ * - _flip_id: id HTML atribute of the element to show/hide (for type 'flip'). This will automatically generate an 'onclick' attribute that will use tiki javascript function flip() to show/hide some content. * - _flip_hide_text: if set to 'n', do not display a '(Hide)' suffix after _text when status is not 'hidden' * - _flip_default_open: if set to 'y', the flip is open by default (if no cookie jar) + * - _escape: if set to 'y', will escape the apostrophes in onclick */ function smarty_function_button($params, &$smarty) { if ( ! is_array($params) || ! isset($params['_text']) ) return; @@ -82,6 +83,9 @@ . "');flip('" . $params['_flip_id'] . "_close','inline');return false;"; + if ( ! empty($params['_escape']) ) { + $params['_onclick'] = addslashes($params['_onclick']); + } if ( ! isset($params['_flip_hide_text']) || $params['_flip_hide_text'] != 'n' ) { $cookie_key = 'show_' . $params['_flip_id']; $params['_text'] .= '<span id="'.$params['_flip_id'].'_close" style="display:' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |