You are here

function glossify_enable in Glossify 6

Same name and namespace in other branches
  1. 6.3 glossify.install \glossify_enable()

Implementation of hook_enable().

File

./glossify.install, line 18
Glossify's install and uninstall code.

Code

function glossify_enable() {
  if (!variable_get('glossify_configurations', FALSE)) {
    if (!db_table_exists('glossify')) {
      drupal_install_schema('glossify');
    }
    $global_configuration = array(
      'from' => variable_get('glossify_content_types_to_search', array()),
      'to' => variable_get('glossify_glossary_content_type', array()),
      'only_first' => variable_get('glossify_link_first_only', 1),
      'unicode' => variable_get('glossify_do_we_need_unicode_compatibility', 1),
      'teaser' => variable_get('glossify_teaser', 1),
      'style' => array(
        variable_get('glossify_style', 'links'),
      ),
      'break' => variable_get('glossify_dont_break_words', 0),
      'language' => 0,
      'methods' => array(
        'use_title' => 1,
        'use_internal' => 0,
        'use_cck' => variable_get('glossify_use_this_cck_field_for_keyword_synonyms', FALSE) || variable_get('glossify_use_this_cck_field_for_target_url_override', FALSE) ? 1 : 0,
        'keyword_field' => variable_get('glossify_use_this_cck_field_for_keyword_synonyms', ''),
        'override_field' => variable_get('glossify_use_this_cck_field_for_target_url_override', ''),
        'use_taxonomy' => 0,
        'vocabulary' => array(),
      ),
    );
    variable_set('glossify_configurations', array(
      'global' => $global_configuration,
    ));
    _backwards_compatibility();
    cache_clear_all();
    drupal_rebuild_theme_registry();
  }
}