Get form values that have changed.

Paramètres

array $element: Form element or child element.

Return value

array An array of form names and the recommended value for that setting.

1 call to advagg_find_all_changed_admin_values()
advagg_set_admin_form_defaults_recommended dans ./advagg.module
Save form defaults or recommended values.

Fichier

./advagg.module, line 6797

Code

function advagg_find_all_changed_admin_values(array &$element) {
    $results = array();
    $children = element_children($element);
    foreach ($children as $key) {
        $child = $element[$key];
        if (is_array($child)) {
            if (!empty($child['#type']) && !empty($child['#name']) && isset($child['#default_value']) && isset($child['#value'])) {
                if ($child['#type'] === 'checkboxes') {
                    // Add in not selected by default values.
                    $child['#value'] += array_diff_assoc($child['#default_value'], $child['#value']);
                }
                if ($child['#default_value'] != $child['#value']) {
                    $results[$child['#name']] = array(
                        $child['#value'],
                        $child['#default_value'],
                    );
                }
            }
            $results = array_merge($results, advagg_find_all_changed_admin_values($child));
        }
        unset($child);
    }
    return $results;
}