function socialcalc_cellformat_parseborder in Sheetnode 7
Same name and namespace in other branches
- 5 socialcalc.inc \socialcalc_cellformat_parseborder()
- 6 socialcalc.inc \socialcalc_cellformat_parseborder()
- 7.2 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 753 - SocialCalc manipulation functions Translated from socialcalc-3.js and companion files
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;
}