You are here

geshifilter.install in GeSHi Filter for syntax highlighting 7

Installation and uninstallation functions for the GeSHi filter.

File

geshifilter.install
View source
<?php

/**
 * @file
 * Installation and uninstallation functions for the GeSHi filter.
 */

/**
 * Implements hook_install().
 */
function geshifilter_install() {

  // Enable some popular languages and set their language tags by default
  $languages = array(
    'php',
    'drupal5',
    'drupal6',
    'javascript',
    'java',
    'c',
    'cpp',
    'python',
    'ruby',
  );
  foreach ($languages as $language) {
    variable_set('geshifilter_language_enabled_' . $language, TRUE);
    variable_set('geshifilter_language_tags_' . $language, '<' . $language . '>');
  }

  // what to do next?
  drupal_set_message(t('GeSHi filter is installed. You should now <a href="!geshi_admin">configure the GeSHi filter</a> and enable it in the desired <a href="!input_formats">text formats</a>.', array(
    '!geshi_admin' => url('admin/config/content/formats/geshifilter'),
    '!input_formats' => url('admin/config/content/formats'),
  )));
}

/**
 * On uninstall: remove module variables and clear variable cache.
 */
function geshifilter_uninstall() {
  db_query("DELETE FROM {variable} WHERE name LIKE 'geshifilter_%'");
  cache_clear_all('variables', 'cache');
}

/**
 * Remove 'geshifilter_geshi_dir' since it is replaced by libraries API.
 */
function geshifilter_update_7100() {
  variable_del('geshifilter_geshi_dir');
}

Functions

Namesort descending Description
geshifilter_install Implements hook_install().
geshifilter_uninstall On uninstall: remove module variables and clear variable cache.
geshifilter_update_7100 Remove 'geshifilter_geshi_dir' since it is replaced by libraries API.