You are here

function _update_keywords_for_methods in Glossify 6.3

Helper function that updates the keyword-tables according to the new/old methods.

2 calls to _update_keywords_for_methods()
glossify_admin_settings_submit in ./glossify.admin.inc
Form evaluation of administrative settings.
_backwards_compatibility in ./glossify.module
Helper function that cleans up old variables and inserts old cck values into the keyword table.

File

./glossify.module, line 930

Code

function _update_keywords_for_methods($content_types, $methods, $configuration) {
  $q = db_query("SELECT nid, vid, type, title, language FROM {node} WHERE status=1 AND type IN (" . db_placeholders($content_types, 'varchar') . ")", $content_types);
  while ($node = db_fetch_object($q)) {
    if (isset($methods['title'])) {
      if ($methods['title']) {
        _keyword_table('insert', $node->nid, 'title', $configuration, $node->language, $node->title);
      }
      else {
        _keyword_table('delete', $node->nid, 'title', $configuration, $node->language);
      }
    }
    if (isset($methods['internal'])) {
      _glossify_node_load($node, 'glossify');
      if ($methods['internal']['use_internal']) {
        _fetch_affected_keywords($node, 'internal', $configuration);
      }
      else {
        _keyword_table('delete', $node->nid, 'internal', $configuration, $node->language);
      }
    }
    if (isset($methods['cck'])) {
      _glossify_node_load($node, 'content');
      if ($methods['cck']['use_cck']) {
        _fetch_affected_keywords($node, 'cck', $configuration, $methods['cck']['keyword_field'], $methods['cck']['override_field']);
      }
      else {
        _keyword_table('delete', $node->nid, 'cck', $configuration, $node->language);
      }
    }
    if (isset($methods['taxonomy'])) {
      _glossify_node_load($node, 'taxonomy');
      if ($methods['taxonomy']['use_taxonomy']) {
        _fetch_affected_keywords($node, 'taxonomy', $configuration, $methods['taxonomy']['vocabulary']);
      }
      else {
        _keyword_table('delete', $node->nid, 'taxonomy', $configuration, $node->language);
      }
    }
  }
}