You are here

function _sheetnode_phpexcel_get_layout in Sheetnode 5

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

File

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

Code

function _sheetnode_phpexcel_get_layout($style) {
  $valignments = array(
    PHPExcel_Style_Alignment::VERTICAL_TOP => 'top',
    PHPExcel_Style_Alignment::VERTICAL_CENTER => 'middle',
    PHPExcel_Style_Alignment::VERTICAL_BOTTOM => 'bottom',
    PHPExcel_Style_Alignment::VERTICAL_JUSTIFY => 'middle',
  );
  $valignment = $valignments[$style
    ->getAlignment()
    ->getVertical()];
  $padding_left = $style
    ->getAlignment()
    ->getIndent();
  $padding_left = empty($padding_left) ? '*' : PHPExcel_Shared_Drawing::pointsToPixels($padding_left) . 'px';
  return 'padding:* * * ' . $padding_left . ';vertical-align:' . $valignment . ';';
}