+ tem_set('display', $data);
+}~}~~opt_db {~
+
+function ~file_name~_main_delete($id) {
+ db_delete('~table_name~', 'where id=%i', $id);
+ message('~singular cap~ deleted.');
+ return './~file_name~';
+}~}~~opt_listing {~
+
+function ~file_name~_main_listing() {
+ $listing_rows = db_get_assocs('~table_name~', 'id~listing_fields_1 {~,~name~~}~', 'order by ~always_field~ limit 100');
+ tem_set('listings', $listing_rows);
+}~}~
+
+function ~file_name~_main_form($id = false) {~pulldowns {~
+ pulldown('~name~', ~pulldown_options~);~}~~has_pulldowns {~
+~}~~opt_db {~
+ if($id) {
+ # add hidden field for database id of row we're editing
+ tem_set('id', $id);
+ tem_set('editing');
+ tem_set('edit_msg');
+ } else {
+ tem_set('new_msg');
+ }
+~}~