public function checkRestore() { $key = addEventHandler('main', 'OnAutoSaveRestore', array($this, 'Restore')); CUndo::Escape($this->GetID()); removeEventHandler('main', 'OnAutoSaveRestore', $key); }
/** * Returns a string like * <form method='post' enctype='multipart/form-data' action='index.php'> * <input type='hidden' name='session' value='123ABC'> * <input type='hidden' name='eventID' value='456789'> */ function makeEventForm($funcName) { $funcArgs = func_get_args(); array_shift($funcArgs); // remove $funcName $id = addEventHandler($funcName, $funcArgs); $s = "<form method='post' "; // This is needed for forms that have file uploads, // but it doesn't do any harm for other forms (?) $s .= "enctype='multipart/form-data' "; // Better to do this via the button's onclick= handler //if($onSubmit) $s .= "onsubmit='return $onSubmit' "; // What's the difference b/t this and $_SERVER[SCRIPT_NAME] ? None I can see. // We use basename() to get "index.php" instead of the full path, // which is subject to corruption with URL forwarding thru kinemage. $s .= "action='" . basename($_SERVER['PHP_SELF']) . "'>\n"; $s .= postSessionID(); $s .= "<input type='hidden' name='eventID' value='{$id}'>\n"; return $s; }