if($input != 'hidden') {
$tem->show('row');
}
+
if($input == 'image' && !$uploads_output_already) {
$tem->show('uploads');
$tem->set('enctype_attr', '" enctype="multipart/form-data');
$tem->set('html_field_name', $name);
$tem->show('replace_textarea');
}
- if($GLOBALS['opt_display']) {
+
+ if($GLOBALS['opt_display'] == 'Yes') {
switch($input) {
case 'checkbox':
case 'leftcheck':
}
$tem->show('display_row');
}
+
+ if($GLOBALS['opt_listing'] == 'Yes') {
+ if($GLOBALS['opt_display'] != 'Yes') {
+ $tem->show('opt_display_a_else');
+ }
+ if(show_in_listing($type, $input, $format, $sql)) {
+ $tem->show('listing_head_col');
+ $tem->show('listing_row_col');
+ }
+ }
}
if($GLOBALS['opt_db'] == 'Yes') {
}
if($GLOBALS['opt_listing'] == 'Yes') {
- if($GLOBALS['opt_display'] != 'Yes') {
- $tem->show('opt_display_a_else');
- }
$tem->show('opt_listing_1');
}
echo make_html();
}
+function show_in_listing($type, $input, $format, $sql) {
+ switch($input) {
+ case 'submit':
+ case 'hidden':
+ case 'password':
+ case 'textarea':
+ case 'html':
+ return false;
+ default:
+ return true;
+ }
+}
+
function make_php() {
$tem = new tem();
}
$tem->show('tem_sets');
}
+
+ if($GLOBALS['opt_listing'] == 'Yes') {
+ if(show_in_listing($type, $input, $format, $sql)) {
+ $tem->show('listing_fields_1');
+ $tem->show('listing_fields_2');
+ }
+ }
}
$tem->set('always_field', $always_field);
<!--~~populated_listing start~~-->
<p><a href="~form_name~?~form_name~_new=1">[Add a new ~singular~]</a></p>
- <table cellspacing="0" cellpadding="4" border="1" summary=""><!--~~listing_row start~~-->
- <tr><td class="listing"><a href="~form_name~?~form_name~_<!--~opt_display_a_else start~-->edit_<!--~end~-->id=~~id~~">~~~always_field~.html~~</a></td><td><a href="~form_name~?~form_name~_delete_id=~~id~~" onclick="return confirm('Permanently delete?')">[delete this ~singular~]</a></td></tr><!--~~end~~-->
+ <table cellspacing="0" cellpadding="4" border="1" summary="">
+ <!--~listing_head_col start~--><th>~caption~</th><!--~end~--><th></th><!--~~listing_row start~~-->
+ <tr><!--~listing_row_col start~-->
+ <td class="listing"><a href="~form_name~?~form_name~_<!--~opt_display_a_else start~-->edit_<!--~end~-->id=~~id~~">~~~name~.html~~</a></td><!--~end~-->
+ <td><a href="~form_name~?~form_name~_delete_id=~~id~~" onclick="return confirm('Permanently delete?')">[delete this ~singular~]</a></td>
+ </tr><!--~~end~~-->
</table>
<!--~~end~~-->
<!--~opt_listing_2 start~-->
# You may pass a "where clause" for the db query.
function ~form_name~_display_listing($where = 'order by ~always_field~ limit 100') {
- $rows = db_get_rows('~form_name~', 'id,~always_field~', $where);
+ $rows = db_get_rows('~form_name~', 'id<!--~listing_fields_1 start~-->,~name~<!--~end~-->', $where);
if($rows == false || count($rows) == 0) {
tem_show('empty_listing');
tem_show('listings');
}
foreach($rows as $row) {
- list($id, $~always_field~) = $row;
+ list($id<!--~listing_fields_2 start~-->, $~name~<!--~end~-->) = $row;
tem_set('id', $id);
if($~always_field~ == '') {
$~always_field~ = '--';
}
- tem_set('~always_field~', $~always_field~);
+ ~form_name~_tem_sets(~php_fields~);
tem_show('listing_row');
}
tem_show('populated_listing');