function socialcalc_save_edit in Sheetnode 6
Same name and namespace in other branches
- 5 socialcalc.inc \socialcalc_save_edit()
- 7.2 socialcalc.inc \socialcalc_save_edit()
- 7 socialcalc.inc \socialcalc_save_edit()
1 call to socialcalc_save_edit()
File
- ./
socialcalc.inc, line 482 - SocialCalc manipulation functions Translated from socialcalc-3.js and companion files
Code
function socialcalc_save_edit($edit) {
$result = "version:1.0\n";
if (!empty($edit['rowpanes'])) {
foreach ($edit['rowpanes'] as $i => $rowpane) {
$result .= "rowpane:" . $i . ":" . $rowpane['first'] . ":" . $rowpane['last'] . "\n";
}
}
if (!empty($edit['colpanes'])) {
foreach ($edit['colpanes'] as $i => $colpane) {
$result .= "colpane:" . $i . ":" . $colpane['first'] . ":" . $colpane['last'] . "\n";
}
}
if (isset($edit['ecell'])) {
$result .= "ecell:" . $edit['ecell']['coord'] . "\n";
}
if (!empty($edit['range']['hasrange'])) {
$result .= "range:" . $edit['range']['anchorcoord'] . ":" . $edit['range']['top'] . ":" . $edit['range']['bottom'] . ":" . $edit['range']['left'] . ":" . $edit['range']['right'] . "\n";
}
unset($edit['rowpanes'], $edit['colpanes'], $edit['ecell'], $edit['range']);
$result .= socialcalc_save_pairs($edit);
return $result;
}