From: <pat...@us...> - 2014-08-26 20:42:05
|
Revision: 52399 http://sourceforge.net/p/tikiwiki/code/52399 Author: patrick-proulx Date: 2014-08-26 20:42:02 +0000 (Tue, 26 Aug 2014) Log Message: ----------- [ENH] Added some parameters to the favorites button function Added the ability to specify a custom label as well as a button type. Modified Paths: -------------- trunk/lib/smarty_tiki/function.favorite.php Modified: trunk/lib/smarty_tiki/function.favorite.php =================================================================== --- trunk/lib/smarty_tiki/function.favorite.php 2014-08-26 20:38:30 UTC (rev 52398) +++ trunk/lib/smarty_tiki/function.favorite.php 2014-08-26 20:42:02 UTC (rev 52399) @@ -28,6 +28,18 @@ $url = smarty_modifier_escape($url); $e_user = smarty_modifier_escape($user); - return '<a class="btn btn-default favorite-toggle" href="' . $url . '" data-key="favorite_' . $e_user . '">' . tr('Favorite') . '</a>'; + if (isset($params['label'])){ + $label = $params['label']; + }else{ + $label = tr('Favorite'); + } + + if (isset($params['button_classes'])){ + $button_classes= $params['button_classes']; + }else{ + $button_classes = "btn btn-default"; + } + + return '<a class="'. $button_classes .' favorite-toggle" href="' . $url . '" data-key="favorite_' . $e_user . '"> ' . $label . '</a>'; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |