- <!--~end~--><!--~pulldowns start~-->
- pulldown('~name~', array('option 1', 'option 2', 'option 3'));
- <!--~end~--><!--~opt_db_3 start~-->
- $edit_id = format_int($_REQUEST['~form_name~_edit_id']);
- unset($_REQUEST['~form_name~_edit_id']);
+<!--~}~--><!--~opt_display {~-->
+ if(isset($_REQUEST['~file_name~_id'])) {
+ return ~file_name~_display_main();
+ } else {
+ return ~file_name~_edit_main();
+ }
+}
+
+function ~file_name~_display_main() {
+ $id = format_int($_REQUEST['~file_name~_id']);
+ unset($_REQUEST['~file_name~_id']);
+ if(!$id) {
+ message('Error: Broken link');
+ return './~file_name~';
+ }
+ $row = db_get_assoc('~table_name~', 'id,'.~file_name upper~_DB_FIELDS, 'where id=%i', $id);
+ if(!$row) {
+ message('Error: ~singular cap~ not found');
+ return './~file_name~';
+ }
+ tem_set('display', $row);
+}
+
+function ~file_name~_edit_main() {<!--~}~--><!--~pulldowns {~-->
+ pulldown('~name~', ~pulldown_options~);
+<!--~}~--><!--~opt_db {~-->
+ $edit_id = format_int($_REQUEST['~file_name~_edit_id']);
+ unset($_REQUEST['~file_name~_edit_id']);