more module updates

This commit is contained in:
Bachir Soussi Chiadmi
2015-04-20 18:21:45 +02:00
parent cde7b73a73
commit 322dd995bf
25 changed files with 747 additions and 308 deletions

View File

@@ -154,14 +154,19 @@ function variable_form_element_options($variable, $options = array()) {
}
/**
* Implement validate callback
* Execute submit callbacks for variables in form.
*/
function variable_form_element_validate($element, &$form_state, $form) {
$variable = $element['#variable'];
variable_include($variable);
$variable['value'] = isset($element['#value']) ? $element['#value'] : NULL;
if ($error = call_user_func($variable['validate callback'], $variable)) {
form_error($element, $error);
function variable_form_submit_callback($form, &$form_state) {
if (isset($form['#variable_edit_form'])) {
// This may contain some realm options.
$options = isset($form['#variable_options']) ? $form['#variable_options'] : array();
foreach ($form['#variable_edit_form'] as $name) {
$variable = variable_get_info($name);
if ($variable && isset($variable['submit callback'])) {
variable_include($variable);
$variable['submit callback']($variable, $options, $form, $form_state);
}
}
}
}