[Obliquid-cvs] obliquid/common/classes/general db_form.php, 1.126, 1.127
Status: Beta
Brought to you by:
slocati
|
From: <sl...@sc...> - 2007-03-07 14:59:45
|
Update of /cvsroot/obliquid/obliquid/common/classes/general In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23836/classes/general Modified Files: db_form.php Log Message: Checkbox label can be specified as an attribute Index: db_form.php =================================================================== RCS file: /cvsroot/obliquid/obliquid/common/classes/general/db_form.php,v retrieving revision 1.126 retrieving revision 1.127 diff -b -u -d -r1.126 -r1.127 --- db_form.php 3 Mar 2007 11:09:26 -0000 1.126 +++ db_form.php 7 Mar 2007 14:59:39 -0000 1.127 @@ -1283,13 +1283,16 @@ * @param text $field field name, repeat the same name for radios of a group, * don't use spaces, condider using only letters, numbers and underscore * the field name will be used also as id - * @param text $attribute an optional associative attributes array, useful to pass style - * information or javascript event handlers - * @param text $label an optional label. Clicking on the label will activate the radio + * @param text $attribute an optional associative attributes array, useful + * to pass style information or javascript event handlers. The "label" + * key can be used to pass a label instead of using $label parameter + * @param text $label an optional label. Clicking on the label will activate + * the radio * @return text html markup to display the checkbox */ function getCheckbox($field, $attribute=array(), $label="") { + if ($attribute["label"]) $label=$attribute["label"]; $res = "<label style=\"cursor:pointer;cursor:hand;\" for=\"".$field ."\"><input type=\"checkbox\" value=\"1\" id=\"".$field ."\" name=\"$field\" "; |