Skip to content

Commit 655124a

Browse files
committed
Minor - Flint fixes
1 parent 396ded2 commit 655124a

File tree

1 file changed

+15
-20
lines changed

1 file changed

+15
-20
lines changed

plugin/onlyoffice/create.php

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?php
22
/**
3-
*
4-
* (c) Copyright Ascensio System SIA 2021
3+
* (c) Copyright Ascensio System SIA 2021.
54
*
65
* Licensed under the Apache License, Version 2.0 (the "License");
76
* you may not use this file except in compliance with the License.
@@ -14,19 +13,17 @@
1413
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1514
* See the License for the specific language governing permissions and
1615
* limitations under the License.
17-
*
1816
*/
19-
2017
require_once __DIR__.'/../../main/inc/global.inc.php';
2118

2219
use ChamiloSession as Session;
2320

2421
$plugin = OnlyofficePlugin::create();
2522

2623
$mapFileFormat = [
27-
"text" => $plugin->get_lang("document"),
24+
"text" => $plugin->get_lang("document"),
2825
"spreadsheet" => $plugin->get_lang("spreadsheet"),
29-
"presentation" => $plugin->get_lang("presentation")
26+
"presentation" => $plugin->get_lang("presentation"),
3027
];
3128

3229
$userId = $_GET["userId"];
@@ -48,7 +45,7 @@
4845

4946
$form = new FormValidator("doc_create",
5047
"post",
51-
api_get_path(WEB_PLUGIN_PATH) . "onlyoffice/create.php");
48+
api_get_path(WEB_PLUGIN_PATH)."onlyoffice/create.php");
5249

5350
$form->addText("fileName", $plugin->get_lang("title"), true);
5451
$form->addSelect("fileFormat", $plugin->get_lang("chooseFileFormat"), $mapFileFormat);
@@ -73,13 +70,13 @@
7370

7471
$fileType = $values["fileFormat"];
7572
$fileExt = FileUtility::getDocExt($fileType);
76-
$fileTitle = $values["fileName"] . "." . $fileExt;
73+
$fileTitle = $values["fileName"].".".$fileExt;
7774

7875
$courseInfo = api_get_course_info_by_id($courseId);
7976
$courseCode = $courseInfo["code"];
80-
77+
8178
$fileNamePrefix = DocumentManager::getDocumentSuffix($courseInfo, $sessionId, $groupId);
82-
$fileName = $values["fileName"] . $fileNamePrefix . "." . $fileExt;
79+
$fileName = $values["fileName"].$fileNamePrefix.".".$fileExt;
8380

8481
$groupInfo = GroupManager::get_group_properties($groupId);
8582

@@ -89,16 +86,16 @@
8986
if (!empty($folderId)) {
9087
$document_data = DocumentManager::get_document_data_by_id($folderId, $courseCode, true, $sessionId);
9188
$folderPath = $document_data["absolute_path"];
92-
$fileRelatedPath = $fileRelatedPath . substr($document_data["absolute_path_from_document"], 10) . "/" . $fileName;
89+
$fileRelatedPath = $fileRelatedPath.substr($document_data["absolute_path_from_document"], 10)."/".$fileName;
9390
} else {
94-
$folderPath = api_get_path(SYS_COURSE_PATH) . api_get_course_path($courseCode) . "/document";
91+
$folderPath = api_get_path(SYS_COURSE_PATH).api_get_course_path($courseCode)."/document";
9592
if (!empty($groupId)) {
96-
$folderPath = $folderPath . "/" . $groupInfo["directory"];
97-
$fileRelatedPath = $groupInfo["directory"] . "/";
93+
$folderPath = $folderPath."/".$groupInfo["directory"];
94+
$fileRelatedPath = $groupInfo["directory"]."/";
9895
}
99-
$fileRelatedPath = $fileRelatedPath . $fileName;
96+
$fileRelatedPath = $fileRelatedPath.$fileName;
10097
}
101-
$filePath = $folderPath . "/" . $fileName;
98+
$filePath = $folderPath."/".$fileName;
10299

103100
if (file_exists($filePath)) {
104101
Display::addFlash(Display::return_message($plugin->get_lang("fileIsExist"), "error"));
@@ -131,21 +128,19 @@
131128
null,
132129
$sessionId);
133130

134-
header("Location: " . $goBackUrl);
131+
header("Location: ".$goBackUrl);
135132
exit();
136133
}
137-
138134
} else {
139135
Display::addFlash(Display::return_message($plugin->get_lang("impossibleCreateFile"), "error"));
140136
}
141137
}
142138

143139
display:
144140
$goBackUrl = $goBackUrl ?: $_SERVER["HTTP_REFERER"];
145-
$actionsLeft = '<a href="'. $goBackUrl . '">' . Display::return_icon("back.png", get_lang("Back") . " " . get_lang("To") . " " . get_lang("DocumentsOverview"), "", ICON_SIZE_MEDIUM) . "</a>";
141+
$actionsLeft = '<a href="'.$goBackUrl.'">'.Display::return_icon("back.png", get_lang("Back")." ".get_lang("To")." ".get_lang("DocumentsOverview"), "", ICON_SIZE_MEDIUM)."</a>";
146142

147143
Display::display_header($plugin->get_lang("createNewDocument"));
148144
echo Display::toolbarAction("actions-documents", [$actionsLeft]);
149145
echo $form->returnForm();
150146
Display::display_footer();
151-
?>

0 commit comments

Comments
 (0)