You are here

function socialcalc_save_edit in Sheetnode 5

Same name and namespace in other branches
  1. 6 socialcalc.inc \socialcalc_save_edit()
  2. 7.2 socialcalc.inc \socialcalc_save_edit()
  3. 7 socialcalc.inc \socialcalc_save_edit()
1 call to socialcalc_save_edit()
socialcalc_save in ./socialcalc.inc

File

./socialcalc.inc, line 450
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";
  }
  return $result;
}