예제 #1
0
}
if (api_is_platform_admin()) {
    if (api_get_configuration_value('document_manage_deleted_files')) {
        $actionsLeft .= Display::url(get_lang('Recycle'), api_get_path(WEB_CODE_PATH) . 'document/recycle.php?' . api_get_cidreq(), array('class' => 'btn btn-default'));
    }
}
if (!empty($moveTo)) {
    $document_id = DocumentManager::get_document_id($courseInfo, $moveTo);
}
if (isset($_GET['createdir']) && isset($_POST['dirname']) && $_POST['dirname'] != '') {
    $post_dir_name = $_POST['dirname'];
    $document_id = DocumentManager::get_document_id($courseInfo, $_POST['dirname']);
}
$selector = null;
if (!$is_certificate_mode) {
    $selector = DocumentManager::build_directory_selector($folders, $document_id, isset($group_properties['directory']) ? $group_properties['directory'] : array(), true);
}
if (($is_allowed_to_edit || $group_member_with_upload_rights) && count($documentAndFolders) > 1) {
    $column_show[] = 1;
}
$column_show[] = 1;
$column_show[] = 1;
$column_show[] = 1;
$column_show[] = 1;
if ($is_allowed_to_edit || $group_member_with_upload_rights || DocumentManager::is_my_shared_folder(api_get_user_id(), $curdirpath, $sessionId)) {
    $column_show[] = 1;
}
$column_show[] = 0;
$column_show[] = 0;
$column_order = array();
if (count($row) == 12) {
예제 #2
0
 /**
  * Creates a list with all the documents in it
  * @param bool $showInvisibleFiles
  * @return string
  */
 public function get_documents($showInvisibleFiles = false)
 {
     $course_info = api_get_course_info();
     $sessionId = api_get_session_id();
     $documentTree = DocumentManager::get_document_preview($course_info, $this->lp_id, null, $sessionId, true, null, null, $showInvisibleFiles, true);
     $headers = array(get_lang('Files'), get_lang('NewDocument'), get_lang('Upload'));
     $form = new FormValidator('form_upload', 'POST', api_get_self() . '?' . $_SERVER['QUERY_STRING'], '', array('enctype' => "multipart/form-data"));
     $folders = DocumentManager::get_all_document_folders(api_get_course_info(), 0, true);
     DocumentManager::build_directory_selector($folders, '', array(), true, $form, 'directory_parent_id');
     $form->addElement('radio', 'if_exists', get_lang('UplWhatIfFileExists'), get_lang('UplDoNothing'), 'nothing');
     $form->addElement('radio', 'if_exists', '', get_lang('UplOverwriteLong'), 'overwrite');
     $form->addElement('radio', 'if_exists', '', get_lang('UplRenameLong'), 'rename');
     $form->setDefaults(['if_exists' => 'rename']);
     // Check box options
     $form->addElement('checkbox', 'unzip', get_lang('Options'), get_lang('Uncompress'));
     $url = api_get_path(WEB_AJAX_PATH) . 'document.ajax.php?' . api_get_cidreq() . '&a=upload_file&curdirpath=';
     $form->addMultipleUpload($url);
     $new = $this->display_document_form('add', 0);
     $tabs = Display::tabs($headers, array($documentTree, $new, $form->returnForm()), 'subtab');
     return $tabs;
 }