more module updates
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user