You are here

function _spaces_taxonomy_term_save_preset_and_modifier in Spaces 7

Same name and namespace in other branches
  1. 7.3 spaces_taxonomy/spaces_taxonomy.module \_spaces_taxonomy_term_save_preset_and_modifier()

Save the Taxonomy Term preset values

Parameters

$term A term object:

2 calls to _spaces_taxonomy_term_save_preset_and_modifier()
spaces_taxonomy_taxonomy_term_insert in spaces_taxonomy/spaces_taxonomy.module
Implements hook_taxonomy_term_insert().
spaces_taxonomy_taxonomy_term_update in spaces_taxonomy/spaces_taxonomy.module
Implements hook_taxonomy_term_update().

File

spaces_taxonomy/spaces_taxonomy.module, line 187
spaces_taxonomy.module

Code

function _spaces_taxonomy_term_save_preset_and_modifier($term) {
  $space = spaces_load('taxonomy', $term->tid);
  if ($space) {

    // Save preset values.
    if (!empty($term->spaces_preset_taxonomy)) {
      $space->controllers->variable
        ->set('spaces_preset_taxonomy', $term->spaces_preset_taxonomy);
    }

    // Save PURL modifier.
    $modifier = array(
      'provider' => 'spaces_taxonomy',
      'id' => $term->tid,
      'value' => $term->purl['value'],
    );
    purl_save($modifier);
  }
}