php: oform

This commit is contained in:
Oleg Sinizin
2021-11-17 11:53:43 +03:00
parent d673fd86e0
commit e89b6040fb
5 changed files with 26 additions and 16 deletions

View File

@ -56,9 +56,14 @@
$docKey = getDocEditorKey($filename);
$filetype = strtolower(pathinfo($filename, PATHINFO_EXTENSION));
$ext = strtolower('.' . pathinfo($filename, PATHINFO_EXTENSION));
$editorsMode = empty($_GET["action"]) ? "edit" : $_GET["action"]; // get the editors mode
$canEdit = in_array(strtolower('.' . pathinfo($filename, PATHINFO_EXTENSION)), $GLOBALS['DOC_SERV_EDITED']); // check if the file can be edited
$submitForm = $canEdit && ($editorsMode == "edit" || $editorsMode == "fillForms"); // check if the Submit form button is displayed or not
$canEdit = in_array($ext, $GLOBALS['DOC_SERV_EDITED']); // check if the file can be edited
if (($editorsMode == "edit" || $editorsMode == "fillForms") && in_array($ext, $GLOBALS['DOC_SERV_FILLFORMS'])) {
$editorsMode = "fillForms";
$canEdit = true;
}
$submitForm = $editorsMode == "fillForms" && $user->id == "uid-1"; // check if the Submit form button is displayed or not
$mode = $canEdit && $editorsMode != "view" ? "edit" : "view"; // define if the editing mode is edit or view
$type = empty($_GET["type"]) ? "desktop" : $_GET["type"];