Minor - format code, "undeprecated" function

pull/2487/head
jmontoyaa 7 years ago
parent c0af0a6ee1
commit 8f6da06e1d
  1. 4
      main/inc/lib/import.lib.php
  2. 14
      main/lp/scorm.class.php
  3. 2
      main/upload/form.scorm.php

@ -9,7 +9,7 @@ use Ddeboer\DataImport\Writer\ArrayWriter;
* Class Import
* This class provides some functions which can be used when importing data from
* external files into Chamilo.
* @package chamilo.library
* @package chamilo.library
*
*/
class Import
@ -52,8 +52,6 @@ class Import
* @param string $filename The path to the CSV-file which should be imported.
* @return array Returns an array (in the system encoding) that contains all data from the CSV-file.
*
*
* @deprecated use cvs_reader instead
*/
public static function csvToArray($filename)
{

@ -289,17 +289,14 @@ class scorm extends learnpath
$courseInfo = api_get_course_info($courseCode);
$courseId = $courseInfo['real_id'];
$userId = intval($userId);
if (empty($userId)) {
$userId = api_get_user_id();
} else {
$userId = intval($userId);
}
// Get table names.
$new_lp = Database::get_course_table(TABLE_LP_MAIN);
$new_lp_item = Database::get_course_table(TABLE_LP_ITEM);
$userMaxScore = intval($userMaxScore);
$sessionId = empty($sessionId) ? api_get_session_id() : intval($sessionId);
foreach ($this->organizations as $id => $dummy) {
$oOrganization = & $this->organizations[$id];
@ -315,7 +312,6 @@ class scorm extends learnpath
$dsp = $row[0] + 1;
}
$myname = api_utf8_decode($oOrganization->get_name());
$now = api_get_utc_datetime();
$params = [
@ -431,10 +427,9 @@ class scorm extends learnpath
if ($max_score == 0 || is_null($max_score) || $max_score == '') {
// If max score is not set The use_max_score parameter
// is check in order to use 100 (chamilo style) or '' (strict scorm)
$max_score = "NULL";
if ($userMaxScore) {
$max_score = 100;
} else {
$max_score = "NULL";
}
} else {
// Otherwise save the max score.
@ -558,7 +553,6 @@ class scorm extends learnpath
}
$courseInfo = empty($courseInfo) ? api_get_course_info() : $courseInfo;
$maxFilledSpace = DocumentManager::get_course_quota($courseInfo['code']);
$zip_file_path = $zip_file_info['tmp_name'];
@ -603,7 +597,6 @@ class scorm extends learnpath
// The following loop should be stopped as soon as we found the right imsmanifest.xml (how to recognize it?).
$realFileSize = 0;
foreach ($zipContentArray as $thisContent) {
$thisContent['filename'];
if (preg_match('~.(php.*|phtml)$~i', $thisContent['filename'])) {
$file = $thisContent['filename'];
$this->set_error_msg("File $file contains a PHP script");
@ -619,8 +612,6 @@ class scorm extends learnpath
$package_type = 'scorm';
$manifest_list[] = $thisContent['filename'];
$manifest = $thisContent['filename']; //just the relative directory inside scorm/
} else {
// Do nothing, if it has not been set as scorm somewhere else, it stays as '' default.
}
$realFileSize += $thisContent['size'];
}
@ -716,7 +707,6 @@ class scorm extends learnpath
while ($file = readdir($dir)) {
if ($file != '.' && $file != '..') {
$filetype = 'file';
if (is_dir($course_sys_dir.$new_dir.$file)) {
$filetype = 'folder';
}

@ -62,7 +62,7 @@ $form = new FormValidator(
'enctype' => "multipart/form-data"
)
);
$form->addElement('header', $nameTools);
$form->addHeader($nameTools);
$form->addLabel(null, Display::return_icon('scorm_logo.jpg', null, ['style' => 'width:230px;height:100px']));
$form->addElement('hidden', 'curdirpath', $path);
$form->addElement('hidden', 'tool', $my_tool);

Loading…
Cancel
Save