Changeset 382 for branches/1.1dev
- Timestamp:
- Aug 10, 2011 12:15:54 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.1dev/lib/TemplateGlue.inc.php
r351 r382 313 313 * @param int $extra_clause extra sql to send at end of select statement. 314 314 * @param int $vert_columns display checkboxes in vertical orientation first. 315 */ 316 function printDBCheckboxes($db_table, $key_column, $val_column, $preselected, $columns=1, $extra_clause='', $vert_columns=true) 315 * @param int $name id="" and name="" attributes for checkboxes. %1$s is replaced with the $val_column, and %2$s with the $box[$val_column]. 316 */ 317 function printDBCheckboxes($db_table, $key_column, $val_column, $preselected, $columns=1, $extra_clause='', $vert_columns=true, $name='%1$s-%2$s') 317 318 { 318 319 // Sometimes preselected comes as a comma list. … … 394 395 } 395 396 396 // Print a cell with basic named checkboxes. 397 ?><td><input type="checkbox" id="<?php echo oTxt($val_column . '-' . $box[$val_column]); ?>" name="<?php echo oTxt($val_column); ?>[<?php echo oTxt($box[$val_column]); ?>]"<?php echo $checked; ?> /></td><td><label for="<?php echo $val_column . '-' . $box[$val_column]; ?>"><?php echo oTxt($box[$key_column]); ?></label></td> 397 // Print a cell with named checkboxes. 398 $checkbox_name = oTxt(sprintf($name, $val_column, $box[$val_column])); 399 ?><td><input type="checkbox" id="<?php echo $checkbox_name; ?>" name="<?php echo $checkbox_name; ?>"<?php echo $checked; ?> /></td><td><label for="<?php echo $checkbox_name; ?>"><?php echo oTxt($box[$key_column]); ?></label></td> 398 400 <?php 399 401 }
Note: See TracChangeset
for help on using the changeset viewer.