GHashTable *ht_attrs);
static GHashTable *zak_form_cgi_form_element_get_ht_attrs (ZakFormCgiFormElement *element);
+static GHashTable *zak_form_cgi_form_element_get_ht_label_attrs (ZakFormCgiFormElement *element);
static void zak_form_cgi_form_element_set_property (GObject *object,
guint property_id,
class->construct = zak_form_cgi_form_element_construct;
class->get_ht_attrs = zak_form_cgi_form_element_get_ht_attrs;
+ class->get_ht_label_attrs = zak_form_cgi_form_element_get_ht_label_attrs;
}
static void
g_string_append (str, " has-error");
}
- g_string_append (str, "\">\n");
+ str = g_string_new ("<div class=\"form-group\">\n");
- zak_form_cgi_form_element_render_label (element);
+ g_string_append (str, zak_form_cgi_form_element_render_label (element));
if (ZAK_FORM_CGI_IS_FORM_ELEMENT (element) && ZAK_FORM_CGI_FORM_ELEMENT_GET_CLASS (element)->render != NULL)
{
if (priv->ht_label_attrs != NULL)
{
-
- str = g_string_new ("<div class=\"form-group");
+ str = g_string_new ("");
if (g_strcmp0 (g_hash_table_lookup (priv->ht_label_attrs, "for"), "") == 0)
{
return priv->ht_attrs;
}
+static GHashTable
+*zak_form_cgi_form_element_get_ht_label_attrs (ZakFormCgiFormElement *element)
+{
+ ZakFormCgiFormElementPrivate *priv;
+
+ priv = ZAK_FORM_CGI_FORM_ELEMENT_GET_PRIVATE (element);
+
+ return priv->ht_label_attrs;
+}
+
static gchar
*zak_form_cgi_form_element_get_value (ZakFormCgiFormElement *element)
{
void (*construct) (ZakFormCgiFormElement *element, const gchar *id, GHashTable *ht_attrs);
GHashTable *(*get_ht_attrs) (ZakFormCgiFormElement *element);
+ GHashTable *(*get_ht_label_attrs) (ZakFormCgiFormElement *element);
+
void (*xml_parsing) (ZakFormElement *element, xmlNode *xmlnode);
gchar *(*render) (ZakFormCgiFormElement *element);
gpointer value;
GHashTable *ht_attrs;
+ GHashTable *ht_label_attrs;
GHashTable *ht_attrs_option;
gchar *element_value;
ZakFormCgiFormElementRadioPrivate *priv = ZAK_FORM_CGI_FORM_ELEMENT_RADIO_GET_PRIVATE (element);
- ret = g_string_new ("");
-
klass = (ZakFormCgiFormElementClass *)g_type_class_peek_parent (ZAK_FORM_CGI_FORM_ELEMENT_RADIO_GET_CLASS (ZAK_FORM_CGI_FORM_ELEMENT_RADIO (element)));
ht_attrs = klass->get_ht_attrs (element);
+ ht_label_attrs = klass->get_ht_label_attrs (element);
+
+ if (ht_label_attrs != NULL)
+ {
+ ret = g_string_new ("<br/>\n");
+ }
+ else
+ {
+ ret = g_string_new ("");
+ }
element_value = zak_form_element_get_value (ZAK_FORM_ELEMENT (element));