Exemplo n.º 1
0
                if ($document_data['insert_user_id'] == api_get_user_id() || api_is_platform_admin()) {
                    $edit_icons = DocumentManager::build_edit_icons($document_data, $key, $is_template, 0, $is_visible);
                } else {
                    $edit_icons = DocumentManager::build_edit_icons($document_data, $key, $is_template, $document_data['readonly'], $is_visible);
                }
                $row[] = $edit_icons;
            }
            $row[] = $last_edit_date;
            $row[] = $size;
            $row[] = $document_name;
            $total_size = $total_size + $size;
            if (!isset($countedPaths[$document_data['path']])) {
                $total_size = $total_size + $size;
                $countedPaths[$document_data['path']] = true;
            }
            if (isset($_GET['keyword']) && DocumentManager::search_keyword($document_name, $_GET['keyword']) || !isset($_GET['keyword']) || empty($_GET['keyword'])) {
                $sortable_data[] = $row;
            }
        }
    }
} else {
    $sortable_data = '';
    $table_footer = get_lang('NoDocsInFolder');
}
if (!is_null($documentAndFolders)) {
    // Show download zipped folder icon
    global $total_size;
    if (!$is_certificate_mode && $total_size != 0 && (api_get_setting('students_download_folders') == 'true' || api_is_allowed_to_edit() || api_is_platform_admin())) {
        //for student does not show icon into other shared folder, and does not show into main path (root)
        if (DocumentManager::is_my_shared_folder(api_get_user_id(), $curdirpath, $sessionId) && $curdirpath != '/' || api_is_allowed_to_edit() || api_is_platform_admin()) {
            $actionsLeft .= Display::url(Display::return_icon('save_pack.png', get_lang('Save') . ' (ZIP)', '', ICON_SIZE_MEDIUM), api_get_path(WEB_CODE_PATH) . 'document/document.php?' . api_get_cidreq() . '&action=downloadfolder&id=' . $document_id);