]> saetta.ns0.it Git - zakform/cgi/commitdiff
ZakFormElement didn't take into account visible property (closes #1131). master
authorAndrea Zagli <azagli@libero.it>
Wed, 9 Aug 2017 14:07:04 +0000 (16:07 +0200)
committerAndrea Zagli <azagli@libero.it>
Wed, 9 Aug 2017 14:07:04 +0000 (16:07 +0200)
src/form.c
src/formelement.c

index 5bcfa6cbee8c8ad77bd9a9129eb2b61547bdce80..1b2e494d506f566951d3c684aa2ed2969b62165f 100644 (file)
@@ -236,7 +236,7 @@ zak_form_cgi_form_bind (ZakFormCgiForm *zakcgiform)
                                                        GPtrArray *ar_elements;
                                                        guint l;
 
-                                                       ar_elements = zak_form_element_array_get_elements (ZAK_FORM_ELEMENT_ARRAY (element));
+                                                       ar_elements = zak_form_element_array_get_elements (ZAK_FORM_ELEMENT (element));
                                                        for (l = 0; l < ar_elements->len; l++)
                                                                {
                                                                        _zak_form_cgi_form_bind (priv, (ZakFormCgiFormElement *)g_ptr_array_index (ar_elements, l));
index 922406fff47749f653b83c0d3c0376a657b30217..356b277a9a251f3b2a8b641ddbd77ecf93d0f013 100644 (file)
@@ -187,6 +187,11 @@ gchar
 
        str = g_string_new ("<div class=\"form-group");
 
+       if (!zak_form_element_get_visible (ZAK_FORM_ELEMENT (element)))
+               {
+                       g_string_append (str, " hidden");
+               }
+
        messages = zak_form_element_get_messages (ZAK_FORM_ELEMENT (element));
        if (messages != NULL
            && messages->len > 0)