You are here

function _taxonomy_menu_get_changed_settings in Taxonomy menu 8

Same name and namespace in other branches
  1. 7.2 taxonomy_menu.admin.inc \_taxonomy_menu_get_changed_settings()

Helper function to find which submitted values have changed upon submission of a vocabulary's creation/updating form.

Parameters

array $submitted_settings: The submitted taxonomy menu settings, includes values that are not in the 'extended options' fieldset like path or menu location.

int $vid: The vid of the vocabulary.

Return value

$changed_settings an array of options, which have changed since the last submit.

1 call to _taxonomy_menu_get_changed_settings()
taxonomy_menu_vocab_submit in ./taxonomy_menu.admin.inc
Form submission handler for taxonomy_form_vocabulary().

File

./taxonomy_menu.admin.inc, line 297
Administrative page callbacks for the Taxonomy menu module.

Code

function _taxonomy_menu_get_changed_settings($submitted_settings, $vid) {
  $saved_settings = array();
  $defaults = taxonomy_menu_get_vocabulary_settings();

  // Build an array of all saved values of settings from taxonomy menu and
  // other modules.
  foreach ($submitted_settings as $key => $option) {
    $value = taxonomy_menu_variable_get($key, $vid, $defaults[$key]);
    $saved_settings[$key] = $value;
  }

  // Keep only the values that changed.
  $changed_settings = array_keys(array_diff_assoc($saved_settings, $submitted_settings));
  return $changed_settings;
}