From 37e83a7d771b652435ae2a57efb0aeb988484642 Mon Sep 17 00:00:00 2001 From: Jason Woofenden Date: Fri, 29 May 2009 05:09:59 -0400 Subject: [PATCH] metaform: in generated php file: template sub-section html-editor so it propogates to template.html and only displays when the form does --- metaform.php | 9 ++++++++- metaform/template.html | 4 ++-- metaform/template.php | 3 ++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/metaform.php b/metaform.php index 04e786a..ebd1f99 100644 --- a/metaform.php +++ b/metaform.php @@ -351,6 +351,7 @@ function show_in_listing($type, $input, $format, $sql) { } function make_php() { + $has_html_editors = false; $tem = new tem(); $tem->load('code/wfpl/metaform/template.php'); $tem->set('file_name', $GLOBALS['file_name']); @@ -389,7 +390,9 @@ function make_php() { $image_included_yet = true; } } else { - if($input == 'pulldown') { + if($input == 'html') { + $has_html_editors = true; + } elseif($input == 'pulldown') { $tem->show('pulldowns'); $tem->show('pulldown_format_extra'); } @@ -406,6 +409,10 @@ function make_php() { } } + if($has_html_editors) { + $tem->show('show_extra_headers'); + } + $tem->set('always_field', $always_field); $tem->set('db_fields', $db_fields); $tem->set('php_fields', $php_fields); diff --git a/metaform/template.html b/metaform/template.html index 0c5c774..473db8b 100644 --- a/metaform/template.html +++ b/metaform/template.html @@ -3,7 +3,7 @@ ~plural.cap~ - + + diff --git a/metaform/template.php b/metaform/template.php index 1822ff3..9742f4e 100644 --- a/metaform/template.php +++ b/metaform/template.php @@ -226,7 +226,8 @@ function _~file_name~_main() { tem_show('edit_msg'); } - tem_show('form'); + tem_show('form'); + tem_show('extra_headers'); } ?> -- 1.7.10.4