|
|
|
|
@ -234,19 +234,21 @@ function get_total_folder_size($path, $can_see_invisible = false) { |
|
|
|
|
$tool_document = TOOL_DOCUMENT; |
|
|
|
|
|
|
|
|
|
$course_id = api_get_course_int_id(); |
|
|
|
|
$session_id = api_get_session_id(); |
|
|
|
|
$session_condition = api_get_session_condition($session_id, true, false, 'id_session'); |
|
|
|
|
|
|
|
|
|
$visibility_rule = 'props.visibility ' . ($can_see_invisible ? '<> 2' : '= 1'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$sql = "SELECT SUM(size) FROM $table_itemproperty AS props, $table_document AS docs |
|
|
|
|
WHERE docs.c_id = $course_id AND |
|
|
|
|
props.c_id = $course_id AND |
|
|
|
|
docs.id = props.ref AND |
|
|
|
|
props.tool = '$tool_document' AND |
|
|
|
|
path LIKE '$path/%' AND |
|
|
|
|
$visibility_rule"; |
|
|
|
|
|
|
|
|
|
$result = Database::query($sql); |
|
|
|
|
if($result && Database::num_rows($result) != 0) { |
|
|
|
|
path LIKE '$path/%' AND |
|
|
|
|
$visibility_rule |
|
|
|
|
$session_condition "; |
|
|
|
|
$result = Database::query($sql); |
|
|
|
|
if ($result && Database::num_rows($result) != 0) { |
|
|
|
|
$row = Database::fetch_row($result); |
|
|
|
|
return $row[0] == null ? 0 : $row[0]; |
|
|
|
|
} else { |
|
|
|
|
|