guint i;
+ gchar *name;
+
gchar *attr_class;
ZakFormCgiFormElementPrivate *priv;
if (priv->id == NULL
|| g_strcmp0 (g_strstrip (priv->id), "") == 0)
{
- priv->id = g_strdup_printf ("id_%d", g_random_int ());
+ priv->id = g_strdup_printf ("id_%d", g_random_int_range (0, G_MAXINT));
}
str = g_string_new ("<div class=\"form-group");
priv->ht_attrs = g_hash_table_new (g_str_hash, g_str_equal);
}
+ name = g_hash_table_lookup (priv->ht_attrs, "name");
+ if (name == NULL
+ || g_strcmp0 (g_strstrip (name), "") == 0)
+ {
+ if (name != NULL)
+ {
+ g_free (name);
+ }
+
+ name = zak_form_element_get_name (ZAK_FORM_ELEMENT (element));
+ if (name != NULL
+ && g_strcmp0 (g_strstrip (name), "") != 0)
+ {
+ g_hash_table_insert (priv->ht_attrs, g_strdup ("name"), g_strdup (name));
+ }
+ if (name != NULL)
+ {
+ g_free (name);
+ }
+ }
+
attr_class = g_hash_table_lookup (priv->ht_attrs, "class");
if (attr_class != NULL)
{