function socialcalc_parse_values in Sheetnode 7
Same name and namespace in other branches
- 5 socialcalc.inc \socialcalc_parse_values()
- 6 socialcalc.inc \socialcalc_parse_values()
- 7.2 socialcalc.inc \socialcalc_parse_values()
1 call to socialcalc_parse_values()
- sheetnode_handler_field_cell::render in views/
sheetnode_handler_field_cell.inc - Render the field.
File
- ./
socialcalc.inc, line 395 - SocialCalc manipulation functions Translated from socialcalc-3.js and companion files
Code
function socialcalc_parse_values($data) {
$line = strtok($data, "\n");
$sheet = array();
while ($line !== FALSE) {
$line = rtrim($line);
$parts = explode(':', $line);
if ($parts[0] == 'cell') {
$coord = $parts[1];
$cell = isset($sheet['cells'][$coord]) ? $sheet['cells'][$coord] : array();
$cell += socialcalc_parse_cell_value($parts, 2);
$sheet['cells'][$coord] = $cell;
}
$line = strtok("\n");
}
return $sheet;
}