]> saetta.ns0.it Git - rust/zakform/commitdiff
libzakform conversion: printed code for select/radio options.
authorAndrea Zagli <azagli@libero.it>
Wed, 20 Sep 2023 14:41:00 +0000 (16:41 +0200)
committerAndrea Zagli <azagli@libero.it>
Wed, 20 Sep 2023 14:41:00 +0000 (16:41 +0200)
src/main.rs

index d305a7337b9f8e60393a225628deab28b09ad007..832bf3f322589b0f9f584f6902ae80bc6bc960c0 100644 (file)
@@ -143,6 +143,19 @@ fn main() {
                        None => { },
                };
 
+               for option in e.options {
+                       println!(r#"fi.add_option(zakform::fields::FOption{{ value: String::from("{}"), label: String::from("{}") }});"#, option.id, option.text);
+               }
+
+               match e.zakcgi_options {
+                       Some(zako) => {
+                               for option in zako.options {
+                                       println!(r#"fi.add_option(zakform::fields::FOption{{ value: String::from("{}"), label: String::from("{}") }});"#, option.value, option.content);
+                               }
+                       },
+                       None => { },
+               }
+
                for filter in e.filters {
                        match filter.ftype.as_str() {
                                "zak_form_element_filter_trim" => { println!("fi.add_filter(zakform::filters::filter_trim);"); },