Files
Chamilo/main/gradebook/lib/be/dropboxlink.class.php
T
Xes 73154ae174
Behat tests 1.11.x 🐞 / PHP 7.4 Test on ubuntu-latest (push) Canceled after 0s
PHP-CS-Fixer / composer_install (7.4) (push) Canceled after 0s
Chamilo 1.11.40 (ZIP oficial v1.11.40)
Fuente: https://github.com/chamilo/chamilo-lms/releases/download/v1.11.40/chamilo-1.11.40.zip
sha256: 1cf4bf2cc7bae1ef1a1eff643235db1d552f78ddf4b6dd1e2d2dac9868679439
Snapshot independiente (rama huerfana); diffable vs 1.11.38. vendor incluido.
2026-08-06 17:59:45 +02:00

71 lines
1.6 KiB
PHP

<?php
/* For licensing terms, see /license.txt */
/**
* Gradebook link to dropbox item.
*
* @author Bert Steppé
*/
class DropboxLink extends EvalLink
{
private $dropbox_table = null;
/**
* Constructor.
*/
public function __construct()
{
parent::__construct();
$this->set_type(LINK_DROPBOX);
}
/**
* Returns the URL of a document
* This function is loaded when using a gradebook as a tab (gradebook = -1) see issue #2705.
*/
public function get_view_url($stud_id)
{
// find a file uploaded by the given student,
// with the same title as the evaluation name
$eval = $this->get_evaluation();
$sql = 'SELECT filename FROM '.$this->get_dropbox_table().'
WHERE
c_id = '.$this->course_id.' AND
uploader_id = '.intval($stud_id)." AND
title = '".Database::escape_string($eval->get_name())."'";
$result = Database::query($sql);
if ($fileurl = Database::fetch_row($result)) {
return null;
} else {
return null;
}
}
public function get_type_name()
{
return get_lang('LMSDropbox');
}
public function is_allowed_to_change_name()
{
return false;
}
public function get_icon_name()
{
return 'dropbox';
}
/**
* Lazy load function to get the dropbox database table.
*/
private function get_dropbox_table()
{
$this->dropbox_table = Database::get_course_table(TABLE_DROPBOX_FILE);
return $this->dropbox_table;
}
}