<?php
// $Id: extra_metatags.install,v 1.1.2.9 2009/09/21 06:41:45 kiam Exp $

/**
 * @file
 * Installation file for Basic meta tags.
 */

/**
 * Implementation of hook_install().
 */
function extra_metatags_install() {
  db_query("UPDATE {system} SET weight = 12 WHERE name = 'extra_metatags'");
}

/**
 * Implementation of hook_update_NN().
 */
function extra_metatags_update_6101() {
  $ret = array();

  $ret[] = update_sql("UPDATE {nodewords} SET type = 'location' WHERE type = 'geourl'");

  $head_tags = variable_get('nodewords_head', array());
  if (isset($head_tags['geourl'])) {
    $head_tags['location'] = $head_tags['geourl'];
    unset($head_tags['geourl']);
    variable_set('nodewords_head', $head_tags);
  }

  $edit_tags = variable_get('nodewords_edit', array());
  if (isset($edit_tags['geourl'])) {
    $edit_tags['location'] = $edit_tags['geourl'];
    unset($edit_tags['geourl']);
    variable_set('nodewords_edit', $edit_tags);
  }

  return $ret;
}

/**
 * Implementation of hook_update_NN().
 */
function extra_metatags_update_6102() {
  $ret = array();

  $ret[] = update_sql("UPDATE {system} SET weight = 12 WHERE name = 'extra_metatags'");

  return $ret;
}

/**
 * Implementation of hook_uninstall().
 */
function extra_metatags_uninstall() {
  if (db_table_exists('nodewords')) {
    $metatags = array(
      'dc.title',
      'geourl',
      'pics-label',
    );

    db_query("DELETE FROM {nodewords} WHERE name IN (". db_placeholders($metatags, 'varchar') .")", $metatags);
  }
}
