You are here

function socialcalc_cellformat_parseborder in Sheetnode 7.2

Same name and namespace in other branches
  1. 5 socialcalc.inc \socialcalc_cellformat_parseborder()
  2. 6 socialcalc.inc \socialcalc_cellformat_parseborder()
  3. 7 socialcalc.inc \socialcalc_cellformat_parseborder()
1 call to socialcalc_cellformat_parseborder()
_sheetnode_phpexcel_export_sheet in modules/sheetnode_phpexcel/sheetnode_phpexcel.export.inc
Helper function to export a single spreadsheet.

File

./socialcalc.inc, line 1008
SocialCalc manipulation functions.

Code

function socialcalc_cellformat_parseborder($cell, $sheet, $attrib) {
  if (empty($cell[$attrib])) {
    return FALSE;
  }
  $parts = array();
  preg_match('/^(\\S+)\\s+(\\S+)\\s+(\\S.+)$/', $sheet['borderstyles'][$cell[$attrib]], $parts);
  $border['thickness'] = $parts[1];
  $border['style'] = $parts[2];
  $color = array();
  preg_match('/^rgb\\((\\d+?),\\s*(\\d+?),\\s*(\\d+?)\\)\\s*$/', $parts[3], $color);
  $border['color'] = array(
    'r' => intval($color[1]),
    'g' => intval($color[2]),
    'b' => intval($color[3]),
  );
  return $border;
}