You are here

sheetnode_phpexcel.install in Sheetnode 5

File

modules/sheetnode_phpexcel/sheetnode_phpexcel.install
View source
<?php

/**
 * Implementation of hook_requirements().
 */
function sheetnode_phpexcel_requirements($phase) {
  $requirements = array();
  $t = get_t();
  if ($phase == 'runtime') {
    $dir = rtrim(variable_get('sheetnode_phpexcel_library_path', ''), '/');
    $satisfied = is_dir($dir) && is_file($dir . '/Classes/PHPExcel.php');
    $requirements['sheetnode_phpexcel_library'] = array(
      'title' => $t('PHPExcel library'),
      'value' => $satisfied ? $t("PHPExcel is found.") : $t("PHPExcel is NOT found at !dir.", array(
        '!dir' => $dir,
      )),
      'severity' => $satisfied ? REQUIREMENT_OK : REQUIREMENT_ERROR,
    );
  }
  return $requirements;
}

/**
 * Implementation of hook_uninstall().
 */
function sheetnode_phpexcel_uninstall() {
  variable_del('sheetnode_phpexcel_library_path');
}

Functions