You are here

function _htmlpurifier_load_csstidY in HTML Purifier 6.2

Same name and namespace in other branches
  1. 7 htmlpurifier.module \_htmlpurifier_load_csstidY()

File

./htmlpurifier.module, line 354
Implements HTML Purifier as a Drupal filter.

Code

function _htmlpurifier_load_csstidY() {

  // If CSSTidy module is installed, it should have a copy we can use
  $csstidy_path = drupal_get_path('module', 'csstidy') . '/csstidy';

  // Some future-proofing for library path
  if (function_exists('libraries_get_path')) {
    $csstidy_library = libraries_get_path('csstidy');
    if (file_exists("{$csstidy_library}/class.csstidy.php")) {
      $csstidy_path = $csstidy_library;
    }
  }

  // Load CSSTidy if we can find it
  if (file_exists("{$csstidy_path}/class.csstidy.php")) {
    require_once "{$csstidy_path}/class.csstidy.php";
    return TRUE;
  }
  return FALSE;
}