You are here

function socialcalc_save_edit in Sheetnode 7.2

Same name and namespace in other branches
  1. 5 socialcalc.inc \socialcalc_save_edit()
  2. 6 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 585
SocialCalc manipulation functions.

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;
}