From 5dbae45aec683c8fa5f66a7f8abcfd154b410f70 Mon Sep 17 00:00:00 2001 From: jmontoyaa Date: Wed, 21 Sep 2016 15:51:55 +0200 Subject: [PATCH] Minor - format code. --- main/inc/lib/document.lib.php | 2 -- main/inc/lib/fileUpload.lib.php | 4 ---- main/inc/lib/internationalization.lib.php | 7 +++---- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/main/inc/lib/document.lib.php b/main/inc/lib/document.lib.php index 2fc3b87372..5d6e42d11a 100755 --- a/main/inc/lib/document.lib.php +++ b/main/inc/lib/document.lib.php @@ -1413,9 +1413,7 @@ class DocumentManager } $session_id = empty($session_id) ? api_get_session_id() : intval($session_id); - $www = api_get_path(WEB_COURSE_PATH).$course_info['path'].'/document'; - $TABLE_DOCUMENT = Database :: get_course_table(TABLE_DOCUMENT); $id = intval($id); diff --git a/main/inc/lib/fileUpload.lib.php b/main/inc/lib/fileUpload.lib.php index 935b7cb0e4..472fb8beb3 100755 --- a/main/inc/lib/fileUpload.lib.php +++ b/main/inc/lib/fileUpload.lib.php @@ -269,7 +269,6 @@ function handle_uploaded_document( return false; } else { - // If the upload path differs from / (= root) it will need a slash at the end if ($uploadPath != '/') { $uploadPath = $uploadPath.'/'; @@ -295,10 +294,8 @@ function handle_uploaded_document( if ($onlyUploadFile) { $errorResult = moveUploadedFile($uploadedFile, $whereToSave.$cleanName); if ($errorResult) { - return $whereToSave.$cleanName; } else { - return $errorResult; } } @@ -307,7 +304,6 @@ function handle_uploaded_document( Based in the clean name we generate a new filesystem name Using the session_id and group_id if values are not empty */ - $fileSystemName = DocumentManager::fixDocumentName( $cleanName, 'file', diff --git a/main/inc/lib/internationalization.lib.php b/main/inc/lib/internationalization.lib.php index 082aa0948b..7043669358 100755 --- a/main/inc/lib/internationalization.lib.php +++ b/main/inc/lib/internationalization.lib.php @@ -661,12 +661,12 @@ function api_format_date($time, $format = null, $language = null) * You can use it like this: * Display::tip(date_to_str_ago($dateInUtc), api_get_local_time($dateInUtc)); * - * @param string $date The string has to be the result of a date function in this format -> date('Y-m-d H:i:s', time()); - * @return string $timeZone + * @param string $date The string has to be the result of a date function in this format -> date('Y-m-d H:i:s', time()); + * @param string $timeZone + * @return string * * @author Julio Montoya */ - function date_to_str_ago($date, $timeZone = 'UTC') { if ($date === '0000-00-00 00:00:00') { @@ -674,7 +674,6 @@ function date_to_str_ago($date, $timeZone = 'UTC') } $getOldTimezone = _api_get_timezone(); - $timeAgo = new TimeAgo($timeZone, api_get_language_isocode()); $value = $timeAgo->inWords($date);