You are here

css3pie.install in css3pie 6

Same filename and directory in other branches
  1. 7.2 css3pie.install

File

css3pie.install
View source
<?php

/**
 * Implementation of hook_install().
 */
function css3pie_install() {
  if (!file_exists(libraries_get_path('PIE') . '/PIE.htc')) {
    drupal_set_message(t('PIE library missing. Download PIE library from http://css3pie.com/ and add it to sites/all/libraries/PIE.'), 'error');
  }
}

/**
 * Implementation of hook_uninstall().
 */
function css3pie_uninstall() {
  db_query("DELETE FROM {variable} WHERE name LIKE 'css3pie_css_%'");
  if (file_exists(file_directory_path() . '/css3pie/css3pie.js')) {
    $success = file_delete(file_directory_path() . '/css3pie/css3pie.js');
    if ($success) {
      db_query('DELETE FROM {files} WHERE filepath = "%s"', file_directory_path() . '/css3pie/css3pie.js');
    }
  }
  if (file_exists(file_directory_path() . '/css3pie/css3pie.css')) {
    $success = file_delete(file_directory_path() . '/css3pie/css3pie.css');
    if ($success) {
      db_query('DELETE FROM {files} WHERE filepath = "%s"', file_directory_path() . '/css3pie/css3pie.css');
    }
  }
  if (is_dir(file_directory_path() . '/css3pie')) {
    rmdir(file_directory_path() . '/css3pie');
  }
}

/**
 * Add variable for css3pie js mode.
 */
function css3pie_update_6001() {
  if (!variable_get('css3pie_css_use_js_mode', FALSE)) {
    variable_set('css3pie_css_use_js_mode', FALSE);
  }
  return;
}

Functions

Namesort descending Description
css3pie_install Implementation of hook_install().
css3pie_uninstall Implementation of hook_uninstall().
css3pie_update_6001 Add variable for css3pie js mode.