Skip to content
Snippets Groups Projects
Commit b6ce1548 authored by DuaelFr's avatar DuaelFr Committed by Andriy Podanenko
Browse files

Issue #1903632 by DuaelFr: Added Gmap Taxonomy: Split configuration.

parent af0595a0
No related branches found
No related tags found
No related merge requests found
...@@ -106,6 +106,19 @@ function gmap_taxonomy_update_7201() { ...@@ -106,6 +106,19 @@ function gmap_taxonomy_update_7201() {
variable_set('gmap_taxonomy_vocabs', $result); variable_set('gmap_taxonomy_vocabs', $result);
} }
/**
* Split settings in a variable for each vocabulary.
*/
function gmap_taxonomy_update_7202() {
$enabled_vocabularies = variable_get('gmap_taxonomy_vocabs', array());
foreach ($enabled_vocabularies as $machine_name => $enabled) {
variable_set('gmap_taxonomy_vocab_' . $machine_name, $enabled);
}
variable_del('gmap_taxonomy_vocabs');
}
/** /**
* Rebuild {gmap_taxonomy_node} again. * Rebuild {gmap_taxonomy_node} again.
*/ */
......
...@@ -77,9 +77,9 @@ function gmap_taxonomy_taxonomy_vocabulary_insert($vocabulary) { ...@@ -77,9 +77,9 @@ function gmap_taxonomy_taxonomy_vocabulary_insert($vocabulary) {
*/ */
function gmap_taxonomy_taxonomy_vocabulary_update($vocabulary) { function gmap_taxonomy_taxonomy_vocabulary_update($vocabulary) {
if (isset($vocabulary->gmap_taxonomy_enable)) { if (isset($vocabulary->gmap_taxonomy_enable)) {
$status = variable_get('gmap_taxonomy_vocabs', array()); variable_set('gmap_taxonomy_vocab_' . $vocabulary->machine_name, TRUE);
$status[$vocabulary->machine_name] = $vocabulary->gmap_taxonomy_enable; } else {
variable_set('gmap_taxonomy_vocabs', $status); variable_del('gmap_taxonomy_vocab_' . $vocabulary->machine_name);
} }
} }
...@@ -87,9 +87,7 @@ function gmap_taxonomy_taxonomy_vocabulary_update($vocabulary) { ...@@ -87,9 +87,7 @@ function gmap_taxonomy_taxonomy_vocabulary_update($vocabulary) {
* Implement hook_taxonomy_vocabulary_delete(). * Implement hook_taxonomy_vocabulary_delete().
*/ */
function gmap_taxonomy_taxonomy_vocabulary_delete($vocabulary) { function gmap_taxonomy_taxonomy_vocabulary_delete($vocabulary) {
$status = variable_get('gmap_taxonomy_vocabs', array()); variable_del('gmap_taxonomy_vocab_' . $vocabulary->machine_name);
unset($status[$vocabulary->machine_name]);
variable_set('gmap_taxonomy_vocabs', $status);
} }
/** /**
...@@ -220,11 +218,8 @@ function gmap_taxonomy_vocabulary_is_enabled($vocabulary) { ...@@ -220,11 +218,8 @@ function gmap_taxonomy_vocabulary_is_enabled($vocabulary) {
$vocabulary = taxonomy_vocabulary_load($vocabulary); $vocabulary = taxonomy_vocabulary_load($vocabulary);
} }
$enabled_vocabularies = variable_get('gmap_taxonomy_vocabs', array());
return $vocabulary return $vocabulary
&& isset($enabled_vocabularies[$vocabulary->machine_name]) && variable_get('gmap_taxonomy_vocab_' . $vocabulary->machine_name, FALSE);
&& $enabled_vocabularies[$vocabulary->machine_name];
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment