You are here

function _sheetnode_phpexcel_get_border in Sheetnode 6

Same name and namespace in other branches
  1. 5 modules/sheetnode_phpexcel/sheetnode_phpexcel.import.inc \_sheetnode_phpexcel_get_border()
  2. 7.2 modules/sheetnode_phpexcel/sheetnode_phpexcel.import.inc \_sheetnode_phpexcel_get_border()
  3. 7 modules/sheetnode_phpexcel/sheetnode_phpexcel.import.inc \_sheetnode_phpexcel_get_border()
1 call to _sheetnode_phpexcel_get_border()
_sheetnode_phpexcel_import_cell in modules/sheetnode_phpexcel/sheetnode_phpexcel.import.inc

File

modules/sheetnode_phpexcel/sheetnode_phpexcel.import.inc, line 458

Code

function _sheetnode_phpexcel_get_border($border) {
  $borderstyles = array(
    PHPExcel_Style_Border::BORDER_NONE => FALSE,
    PHPExcel_Style_Border::BORDER_THIN => 'thin solid',
    PHPExcel_Style_Border::BORDER_MEDIUM => 'medium solid',
    PHPExcel_Style_Border::BORDER_DASHED => 'thin dashed',
    PHPExcel_Style_Border::BORDER_DOTTED => 'thin dotted',
    PHPExcel_Style_Border::BORDER_THICK => 'thick solid',
    PHPExcel_Style_Border::BORDER_DOUBLE => 'thin double',
    PHPExcel_Style_Border::BORDER_HAIR => 'thin dotted',
    // TODO: is it?
    PHPExcel_Style_Border::BORDER_MEDIUMDASHED => 'medium dashed',
    PHPExcel_Style_Border::BORDER_DASHDOT => 'thin dashed',
    // TODO: is it?
    PHPExcel_Style_Border::BORDER_MEDIUMDASHDOT => 'medium dashed',
    //TODO: is it?
    PHPExcel_Style_Border::BORDER_DASHDOTDOT => 'thin dashed',
    // TODO: is it?
    PHPExcel_Style_Border::BORDER_MEDIUMDASHDOTDOT => 'medium dashed',
    // TODO: is it?
    PHPExcel_Style_Border::BORDER_SLANTDASHDOT => 'thin dashed',
  );
  $borderstyle = $borderstyles[$border
    ->getBorderStyle()];
  if (!$borderstyle) {
    return FALSE;
  }
  $bordercolor = _sheetnode_phpexcel_get_color($border
    ->getColor());
  return $borderstyle . ' ' . $bordercolor;
}