Example #1
0
 case 'undo':
     if (undo_change($cid, $index)) {
         echo '<b>', $pgv_lang['undo_successful'], '</b>';
     }
     break;
 case 'accept':
     if (accept_changes($cid)) {
         echo '<b>', $pgv_lang['accept_successful'], '</b>';
     }
     break;
 case 'undoall':
     //-- alert that we only want to save the file and changes once
     $manual_save = true;
     foreach ($pgv_changes as $cid => $changes) {
         if ($changes[0]['gedcom'] == $ged) {
             undo_change($cid, 0);
         }
     }
     write_changes();
     $manual_save = false;
     echo '<b>', $pgv_lang['undo_successful'], '</b>';
     break;
 case 'acceptall':
     //-- only save the file and changes once
     $manual_save = true;
     foreach ($pgv_changes as $cid => $changes) {
         if ($changes[0]['gedcom'] == $ged) {
             accept_changes($cid);
         }
     }
     write_changes();
 /**
  * Undo the latest change to this gedcom record
  */
 function undoChange()
 {
     global $GEDCOM, $pgv_changes;
     require_once 'includes/functions/functions_edit.php';
     if (!PGV_USER_CAN_ACCEPT) {
         return false;
     }
     $cid = $this->xref . '_' . $GEDCOM;
     if (!isset($pgv_changes[$cid])) {
         return false;
     }
     $index = count($pgv_changes[$cid]) - 1;
     if (undo_change($cid, $index)) {
         return true;
     }
     return false;
 }