The tk_edit_range function allows a user to select multiple records using markers in a single source and to pass the record's keys to a function.
To include a record into the selection, place a checkbox () named 'marker' in it.
void tk_range_edit_select (&$this);
Reads in all selected markers from a form and highligts them. If markers of different sources were posted the function dies.
void tk_range_edit_call (&$this);
Passed all keys of selected record's keys posted to tk_range_edit_select last time to a function.
The built-in record function delete() recognizes arrays of keys.
int tk_range_edit_all_selected (&$this);
Returns 0 if all markers are unset, 1 if they're set or 2 if there're set and unset markers.
# Widget to select and delete groups of records in a list, function widget_range_delete (&$this) { $p =& $this->ui; $table = $this->v->source; $p->open_row (); $v =& new view ('tk_range_edit_select'); $v->set_next ($this->view ()); $p->submit_button ('select range', $v); $sel = tk_range_edit_all_selected ($this); if ($sel == 0 || $sel == 2) { $v =& new view ('tk_range_edit_select_all'); $v->set_next ($this->view ()); $p->submit_button ('select all', 'tk_range_edit_select_all', $next); } if ($sel == 1 || $sel == 2) { $v =& new view ('tk_range_edit_unselect_all'); $v->set_next ($this->view ()); $p->submit_button ('unselect all', 'tk_range_edit_unselect_all', $next); } $v =& new view ('record_delete', array ('argname' => 'id')); $v =& new view ('tk_range_edit_call', array ('view' => $v)); $v->set_next ($this->view ()); $p->submit_button ('delete', $v); $p->close_row (); }