Changeset 835 in ExiteCMS for trunk/includes/Smarty-2.6.18/custom-plugins/function.buttonlink.php
- Timestamp:
- 09/23/07 23:34:47 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/Smarty-2.6.18/custom-plugins/function.buttonlink.php
r834 r835 17 17 * - title: optional title text 18 18 * - new: if "yes", URL opens in new window 19 * - script: if "yes", URL is javascript code 19 20 * 20 * Examples: {buttonlink name="Google!" link="http://www.google.com"} 21 * Examples: {buttonlink name="Google!" link="http://www.google.com" new="yes"} 22 * Examples: {buttonlink name="Go Back" link="javascript: history.go(-1);" script="yes"} 21 23 * Output: <input type='button' value='Google!' onClick='window.location="http://www.google.com";' /> 22 24 * @author WanWizard <wanwizard at gmail dot com> … … 49 51 $new = strtolower($params['new']) == "yes"; 50 52 } 53 if (!isset($params['script'])) { 54 $script = false; 55 } else { 56 $script = strtolower($params['script']) == "yes"; 57 } 51 58 52 return "<input type='button' class='button' value='$name' ".($title?"title='$title' ":"")."onClick='".($ new?"window.open(\"$link\");'":"window.location=\"$link\";'")." />";59 return "<input type='button' class='button' value='$name' ".($title?"title='$title' ":"")."onClick='".($script ? $link : ($new ? "window.open(\"$link\");'" : "window.location=\"$link\";'"))." />"; 53 60 } 54 61
Note: See TracChangeset
for help on using the changeset viewer.
