Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

SmartyFormtool 1.2 released

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Add-ons
View previous topic :: View next topic  
Author Message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Tue Jul 13, 2004 3:12 pm    Post subject: SmartyFormtool 1.2 released Reply with quote

Just a few minor changes:

* fix Safari problem when moving elements down (was only half fixed) (monte)
* add ability to turn off limit message alert (kills, Monte)
* add LGPL license text to README

http://www.phpinsider.com/php/code/SmartyFormtool/

Enjoy!
Back to top
View user's profile Send private message Visit poster's website
jasrags
Smarty n00b


Joined: 21 Sep 2004
Posts: 2
Location: Dallas, TX

PostPosted: Fri Oct 29, 2004 2:47 pm    Post subject: Mod of formtool_checkall Reply with quote

If anyone needs it i have modified formtool_checkall to accept a class param so you can apply your CSS to the button created. I'm sure this can be applied to all other formtool plugins that may accept a class tag element.

Code:

/**
 * Smarty {formtool_checkall} function plugin
 *
 * File:       function.formtool_checkall.php<br>
 * Type:       function<br>
 * Name:       html_radios<br>
 * Date:       29.Oct.2004<br>
 * Purpose:    formtool checkall and uncheck all items in a list<br>
 * Input:<br>
 *           - name       (required) - string default "radio"
 *           - class      (optional) - string
 * Examples:
 * <pre>
 * {formtool_checkall name="exclude[]"}
 * {formtool_checkall name="exclude[]" class="BUTTON"}
 * </pre>
 */
 
function smarty_function_formtool_checkall($params, &$smarty)
{
    $_class= null;
   
    if (empty($params['name'])) {
        $smarty->trigger_error("formtool_checkall: missing 'name' parameter");
        return;
    }
   
    if ($params['class']) {
        $_class = $params['class'];
    }

    $_name = $params['name'];   
    $_checkall_text = empty($params['checkall_text']) ? 'Check All' : $params['checkall_text'];
    $_uncheckall_text = empty($params['uncheckall_text']) ? 'Uncheck All' : $params['uncheckall_text'];
   
    return "<input type=button class=\"$_class\" value=\"$_checkall_text\" onClick=\"this.value=formtool_checkall('$_name', this.form.elements['$_name'],'"
        . addslashes($_checkall_text)
        . "','"
        . addslashes($_uncheckall_text)
        . "')\">\n";
}

/* vim: set expandtab: */
[/code]
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Fri Oct 29, 2004 3:22 pm    Post subject: Reply with quote

Synchronicity--I just finished adding class and style support to all the plugins (and a bunch of other things). It is in the CVS and can probably stand some testing Smile

Last edited by boots on Fri Oct 29, 2004 3:23 pm; edited 1 time in total
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Fri Oct 29, 2004 3:23 pm    Post subject: Reply with quote

These things are slowly getting migrated into the CVS version (thanks to boots), you should see them in the next release.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Add-ons All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP