Ignore:
Timestamp:
09/23/07 23:34:47 (5 years ago)
Author:
hverton
Message:

Replaced all button images by new {buttonlink} Smarty function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/Smarty-2.6.18/custom-plugins/function.buttonlink.php

    r834 r835  
    1717 *         - title: optional title text 
    1818 *         - new: if "yes", URL opens in new window 
     19 *         - script: if "yes", URL is javascript code 
    1920 * 
    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"} 
    2123 * Output:   <input type='button' value='Google!' onClick='window.location="http://www.google.com";' /> 
    2224 * @author WanWizard <wanwizard at gmail dot com> 
     
    4951        $new = strtolower($params['new']) == "yes"; 
    5052    } 
     53    if (!isset($params['script'])) { 
     54        $script = false; 
     55    } else { 
     56        $script = strtolower($params['script']) == "yes"; 
     57    } 
    5158     
    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\";'"))." />"; 
    5360} 
    5461 
Note: See TracChangeset for help on using the changeset viewer.