Documents: Fix PR camelcase in variables names, single quotes

pull/3944/head
Tony ID 4 years ago committed by Yannick Warnier
parent 6d1a4e7059
commit 9975d606a9
  1. 4
      main/inc/ajax/document.ajax.php
  2. 12
      main/inc/lib/document.lib.php

@ -24,8 +24,8 @@ switch ($action) {
foreach ($requests as $request) {
$fileSize = DocumentManager::getTotalFolderSize($request, $isAllowedToEdit);
$data = [
"id" => $request,
"size" => format_file_size($fileSize),
'id' => $request,
'size' => format_file_size($fileSize),
];
array_push($response, $data);
}

@ -6485,13 +6485,13 @@ class DocumentManager
* Calculates the total size of a directory by adding the sizes (that
* are stored in the database) of all files & folders in this directory.
*
* @param string $value = document path or document id
* @param bool $can_see_invisible
* @param bool $by_id = default true, if is getting size by document id or false if getting by path
* @param string $value Document path or document id
* @param bool $canSeeInvisible
* @param bool $byId Default true, if is getting size by document id or false if getting by path
*
* @return int Total size
*/
public static function getTotalFolderSize($value, $can_see_invisible = false, $by_id = true)
public static function getTotalFolderSize($value, $canSeeInvisible = false, $byId = true)
{
$table_itemproperty = Database::get_course_table(TABLE_ITEM_PROPERTY);
$table_document = Database::get_course_table(TABLE_DOCUMENT);
@ -6510,9 +6510,9 @@ class DocumentManager
return 0;
}
$visibility_rule = ' props.visibility '.($can_see_invisible ? '<> 2' : '= 1');
$visibility_rule = ' props.visibility '.($canSeeInvisible ? '<> 2' : '= 1');
if ($by_id) {
if ($byId) {
$id = (int) $value;
$query = "SELECT path FROM $table_document WHERE id = $id";
$result1 = Database::query($query);

Loading…
Cancel
Save