diff --git a/plugin/onlyoffice/create.php b/plugin/onlyoffice/create.php
index e382a82e26..4318e58ba2 100644
--- a/plugin/onlyoffice/create.php
+++ b/plugin/onlyoffice/create.php
@@ -1,7 +1,6 @@
$plugin->get_lang("document"),
+ "text" => $plugin->get_lang("document"),
"spreadsheet" => $plugin->get_lang("spreadsheet"),
- "presentation" => $plugin->get_lang("presentation")
+ "presentation" => $plugin->get_lang("presentation"),
];
$userId = $_GET["userId"];
@@ -48,7 +45,7 @@ if (!($isAllowToEdit || $isMyDir || $groupRights)) {
$form = new FormValidator("doc_create",
"post",
- api_get_path(WEB_PLUGIN_PATH) . "onlyoffice/create.php");
+ api_get_path(WEB_PLUGIN_PATH)."onlyoffice/create.php");
$form->addText("fileName", $plugin->get_lang("title"), true);
$form->addSelect("fileFormat", $plugin->get_lang("chooseFileFormat"), $mapFileFormat);
@@ -73,13 +70,13 @@ if ($form->validate()) {
$fileType = $values["fileFormat"];
$fileExt = FileUtility::getDocExt($fileType);
- $fileTitle = $values["fileName"] . "." . $fileExt;
+ $fileTitle = $values["fileName"].".".$fileExt;
$courseInfo = api_get_course_info_by_id($courseId);
$courseCode = $courseInfo["code"];
-
+
$fileNamePrefix = DocumentManager::getDocumentSuffix($courseInfo, $sessionId, $groupId);
- $fileName = $values["fileName"] . $fileNamePrefix . "." . $fileExt;
+ $fileName = $values["fileName"].$fileNamePrefix.".".$fileExt;
$groupInfo = GroupManager::get_group_properties($groupId);
@@ -89,16 +86,16 @@ if ($form->validate()) {
if (!empty($folderId)) {
$document_data = DocumentManager::get_document_data_by_id($folderId, $courseCode, true, $sessionId);
$folderPath = $document_data["absolute_path"];
- $fileRelatedPath = $fileRelatedPath . substr($document_data["absolute_path_from_document"], 10) . "/" . $fileName;
+ $fileRelatedPath = $fileRelatedPath.substr($document_data["absolute_path_from_document"], 10)."/".$fileName;
} else {
- $folderPath = api_get_path(SYS_COURSE_PATH) . api_get_course_path($courseCode) . "/document";
+ $folderPath = api_get_path(SYS_COURSE_PATH).api_get_course_path($courseCode)."/document";
if (!empty($groupId)) {
- $folderPath = $folderPath . "/" . $groupInfo["directory"];
- $fileRelatedPath = $groupInfo["directory"] . "/";
+ $folderPath = $folderPath."/".$groupInfo["directory"];
+ $fileRelatedPath = $groupInfo["directory"]."/";
}
- $fileRelatedPath = $fileRelatedPath . $fileName;
+ $fileRelatedPath = $fileRelatedPath.$fileName;
}
- $filePath = $folderPath . "/" . $fileName;
+ $filePath = $folderPath."/".$fileName;
if (file_exists($filePath)) {
Display::addFlash(Display::return_message($plugin->get_lang("fileIsExist"), "error"));
@@ -131,10 +128,9 @@ if ($form->validate()) {
null,
$sessionId);
- header("Location: " . $goBackUrl);
+ header("Location: ".$goBackUrl);
exit();
}
-
} else {
Display::addFlash(Display::return_message($plugin->get_lang("impossibleCreateFile"), "error"));
}
@@ -142,10 +138,9 @@ if ($form->validate()) {
display:
$goBackUrl = $goBackUrl ?: $_SERVER["HTTP_REFERER"];
- $actionsLeft = '' . Display::return_icon("back.png", get_lang("Back") . " " . get_lang("To") . " " . get_lang("DocumentsOverview"), "", ICON_SIZE_MEDIUM) . "";
+ $actionsLeft = ''.Display::return_icon("back.png", get_lang("Back")." ".get_lang("To")." ".get_lang("DocumentsOverview"), "", ICON_SIZE_MEDIUM)."";
Display::display_header($plugin->get_lang("createNewDocument"));
echo Display::toolbarAction("actions-documents", [$actionsLeft]);
echo $form->returnForm();
Display::display_footer();
-?>
\ No newline at end of file