You are here

function _sheetnode_phpexcel_load_library in Sheetnode 7

Same name and namespace in other branches
  1. 7.2 modules/sheetnode_phpexcel/sheetnode_phpexcel.module \_sheetnode_phpexcel_load_library()

Helper function to locate libraries.

3 calls to _sheetnode_phpexcel_load_library()
sheetnode_phpexcel_requirements in modules/sheetnode_phpexcel/sheetnode_phpexcel.install
Implementation of hook_requirements().
_sheetnode_phpexcel_autoload in modules/sheetnode_phpexcel/sheetnode_phpexcel.module
Autoload callback.
_sheetnode_phpexcel_export_cell_value_and_format in modules/sheetnode_phpexcel/sheetnode_phpexcel.export.inc
Helper function to export a cell.

File

modules/sheetnode_phpexcel/sheetnode_phpexcel.module, line 146
Module file for the sheetnode_phpexcel module. This manages handling of files for sheetnode.

Code

function _sheetnode_phpexcel_load_library($type) {
  switch ($type) {
    case SHEETNODE_PHPEXCEL_LIBRARY:
      $path = rtrim(variable_get('sheetnode_phpexcel_library_path', DEFAULT_SHEETNODE_PHPEXCEL_LIBRARY_PATH), '/');
      if (!is_dir($path) || !is_file($path . '/Classes/PHPExcel.php')) {
        return FALSE;
      }
      include_once $path . '/Classes/PHPExcel.php';
      break;
    case SHEETNODE_PHPEXCEL_PDF_RENDERER:
      $path = rtrim(variable_get('sheetnode_phpexcel_pdf_renderer_path', DEFAULT_SHEETNODE_PHPEXCEL_PDF_RENDERER_PATH), '/');
      if (!is_dir($path) || !is_file($path . '/tcpdf.php')) {
        return FALSE;
      }
      include_once $path . '/tcpdf.php';
      break;
    default:
      return FALSE;
  }
  return TRUE;
}