ZakFormElement *v1;
ZakFormElement *v2;
+ ZakFormElement *message;
gchar *format1;
gchar *format2;
priv->v1 = NULL;
priv->v2 = NULL;
+ priv->message = NULL;
priv->format1 = g_strdup ("");
priv->format2 = g_strdup ("");
}
return g_strdup (priv->format2);
}
+/**
+ * zak_form_validator_compare_date_set_element_message:
+ * @validator:
+ * @element:
+ *
+ * Sets the validator element for error message.
+ */
+void
+zak_form_validator_compare_date_set_element_message (ZakFormValidatorCompareDate *validator, ZakFormForm *form, const gchar *element)
+{
+ ZakFormValidatorCompareDatePrivate *priv = zak_form_validator_compare_date_get_instance_private (validator);
+
+ priv->message = zak_form_form_get_element_by_id (form, element);
+ if (!ZAK_FORM_IS_ELEMENT (priv->message))
+ {
+ g_warning ("Validator compare: element «%s» isn't a ZakFormElement.", element);
+ }
+}
+
+/**
+ * zak_form_validator_compare_date_get_element_message:
+ * @validator:
+ *
+ * Returns: the validator element name for error message.
+ */
+const gchar
+*zak_form_validator_compare_date_get_element_message (ZakFormValidatorCompareDate *validator)
+{
+ ZakFormValidatorCompareDatePrivate *priv = zak_form_validator_compare_date_get_instance_private (validator);
+
+ if (ZAK_FORM_IS_ELEMENT (priv->message))
+ {
+ return zak_form_element_get_name (priv->message);
+ }
+ else
+ {
+ return "";
+ }
+}
+
/* PRIVATE */
static void
zak_form_validator_compare_date_set_property (GObject *object,
xmlSetProp (xnode, (const xmlChar *)"element2", (const xmlChar *)zak_form_validator_compare_date_get_element2 (validator_compare_date));
xmlSetProp (xnode, (const xmlChar *)"format2", (const xmlChar *)zak_form_validator_compare_date_get_element2_format (validator_compare_date));
+
+ xmlSetProp (xnode, (const xmlChar *)"element_message", (const xmlChar *)zak_form_validator_compare_date_get_element_message (validator_compare_date));
}
const gchar *zak_form_validator_compare_date_get_element2 (ZakFormValidatorCompareDate *validator);
const gchar *zak_form_validator_compare_date_get_element2_format (ZakFormValidatorCompareDate *validator);
+void zak_form_validator_compare_date_set_element_message (ZakFormValidatorCompareDate *validator, ZakFormForm *form, const gchar *element);
+const gchar *zak_form_validator_compare_date_get_element_message (ZakFormValidatorCompareDate *validator);
+
G_END_DECLS