Minor - adding comments, format code

skala
Julio Montoya 11 years ago
parent 6a0623a923
commit caa7a73779
  1. 1
      main/create_course/add_course.php
  2. 5
      main/document/document.inc.php
  3. 4
      main/gradebook/lib/gradebook_functions.inc.php
  4. 29
      main/inc/lib/course.lib.php
  5. 4
      src/ChamiloLMS/Component/DataFilesystem/DataFilesystem.php

@ -190,7 +190,6 @@ if ($form->validate()) {
$course_values = $form->exportValues(); $course_values = $form->exportValues();
$wanted_code = $course_values['wanted_code']; $wanted_code = $course_values['wanted_code'];
//$tutor_name = $course_values['tutor_name'];
$category_code = $course_values['category_code']; $category_code = $course_values['category_code'];
$title = $course_values['title']; $title = $course_values['title'];
$course_language = $course_values['course_language']; $course_language = $course_values['course_language'];

@ -336,8 +336,7 @@ function create_document_link($document_data, $show_as_icon = false, $counter =
//yox view //yox view
//$url = 'showinframesmin.php?'.api_get_cidreq().'&id='.$document_data['id'].$req_gid; //$url = 'showinframesmin.php?'.api_get_cidreq().'&id='.$document_data['id'].$req_gid;
//Simpler version of showinframesmin.php with no headers //Simpler version of showinframesmin.php with no headers
$url = 'show_content.php?'.api_get_cidreq( $url = 'show_content.php?id='.$document_data['id'].$req_gid.'&'.api_get_cidreq().'&width=700&height=500';
).'&id='.$document_data['id'].$req_gid.'&width=700&height=500';
$class = 'ajax'; $class = 'ajax';
if ($visibility == false) { if ($visibility == false) {
$class = "ajax invisible"; $class = "ajax invisible";
@ -1312,4 +1311,4 @@ function check_and_create_resource_directory($repository_path, $resource_directo
} }
return true; return true;
} }

@ -592,7 +592,7 @@ function get_user_certificate_content($user_id, $course_code, $is_preview = fals
$path_image = api_get_path(WEB_COURSE_PATH).api_get_course_path($course_code).'/document/images/gallery'; $path_image = api_get_path(WEB_COURSE_PATH).api_get_course_path($course_code).'/document/images/gallery';
$new_content_html = str_replace('../images/gallery',$path_image,$new_content_html); $new_content_html = str_replace('../images/gallery',$path_image,$new_content_html);
$path_image_in_default_course = api_get_path(WEB_CODE_PATH).'default_course_document'; $path_image_in_default_course = api_get_path(WEB_DEFAULT_COURSE_DOCUMENT_PATH);
$new_content_html = str_replace('/main/default_course_document',$path_image_in_default_course,$new_content_html); $new_content_html = str_replace('/main/default_course_document',$path_image_in_default_course,$new_content_html);
$new_content_html = str_replace('/main/img/', api_get_path(WEB_IMG_PATH), $new_content_html); $new_content_html = str_replace('/main/img/', api_get_path(WEB_IMG_PATH), $new_content_html);
@ -823,4 +823,4 @@ function score_badges($list_values) {
} }
return Display::badge_group($badges); return Display::badge_group($badges);
} }

@ -18,10 +18,10 @@
*/ */
class CourseManager class CourseManager
{ {
CONST MAX_COURSE_LENGTH_CODE = 40; const MAX_COURSE_LENGTH_CODE = 40;
//This constant is used to show separate user names in the course list (userportal), footer, etc //This constant is used to show separate user names in the course list (userportal), footer, etc
CONST USER_SEPARATOR = ' |'; const USER_SEPARATOR = ' |';
public $columns = array(); public $columns = array();
@ -3978,7 +3978,6 @@ class CourseManager
*/ */
static function prepare_course_repository($course_repository, $course_code) static function prepare_course_repository($course_repository, $course_code)
{ {
$perm = api_get_permissions_for_new_directories(); $perm = api_get_permissions_for_new_directories();
$perm_file = api_get_permissions_for_new_files(); $perm_file = api_get_permissions_for_new_files();
$htmlpage = "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n <title>Not authorized</title>\n </head>\n <body>\n </body>\n</html>"; $htmlpage = "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n <title>Not authorized</title>\n </head>\n <body>\n </body>\n</html>";
@ -4162,22 +4161,25 @@ class CourseManager
return $tables; return $tables;
} }
static function browse_folders($path, $files, $media) { static function browse_folders($path, $files, $media)
{
$defaultCourseDocumentPath = api_get_path(SYS_DEFAULT_COURSE_DOCUMENT_PATH);
if ($media == 'images') { if ($media == 'images') {
$code_path = api_get_path(SYS_CODE_PATH).'default_course_document/images/'; $code_path = $defaultCourseDocumentPath.'images/';
} }
if ($media == 'audio') { if ($media == 'audio') {
$code_path = api_get_path(SYS_CODE_PATH).'default_course_document/audio/'; $code_path = $defaultCourseDocumentPath.'audio/';
} }
if ($media == 'flash') { if ($media == 'flash') {
$code_path = api_get_path(SYS_CODE_PATH).'default_course_document/flash/'; $code_path = $defaultCourseDocumentPath.'flash/';
} }
if ($media == 'video') { if ($media == 'video') {
$code_path = api_get_path(SYS_CODE_PATH).'default_course_document/video/'; $code_path = $defaultCourseDocumentPath.'video/';
} }
if ($media == 'certificates') { if ($media == 'certificates') {
$code_path = api_get_path(SYS_CODE_PATH).'default_course_document/certificates/'; $code_path = $defaultCourseDocumentPath.'certificates/';
} }
if (is_dir($path)) { if (is_dir($path)) {
$handle = opendir($path); $handle = opendir($path);
while (false !== ($file = readdir($handle))) { while (false !== ($file = readdir($handle))) {
@ -4189,6 +4191,7 @@ class CourseManager
} }
} }
} }
return $files; return $files;
} }
@ -4396,7 +4399,7 @@ class CourseManager
'certificates', 'certificates',
); );
$default_course_path = api_get_path(SYS_CODE_PATH).'default_course_document/'; $default_course_path = api_get_path(SYS_DEFAULT_COURSE_DOCUMENT_PATH);
$default_document_array = array(); $default_document_array = array();
foreach ($folders_to_copy_from_default_course as $folder) { foreach ($folders_to_copy_from_default_course as $folder) {
@ -4430,7 +4433,7 @@ class CourseManager
} }
$course_documents_folder = $sys_course_path.$course_repository."/document/$media_type/"; $course_documents_folder = $sys_course_path.$course_repository."/document/$media_type/";
$default_course_path = api_get_path(SYS_CODE_PATH).'default_course_document'.$path_documents; $default_course_path = api_get_path(SYS_DEFAULT_COURSE_DOCUMENT_PATH).$path_documents;
//echo 'try '.$course_documents_folder; echo '<br />'; //echo 'try '.$course_documents_folder; echo '<br />';
@ -4561,7 +4564,7 @@ class CourseManager
$html = Database::escape_string('<table width="100%" border="0" cellpadding="0" cellspacing="0"> $html = Database::escape_string('<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td width="110" valign="top" align="left"> <tr><td width="110" valign="top" align="left">
<img src="'.api_get_path(WEB_CODE_PATH).'default_course_document/images/mr_dokeos/thinking.jpg"></td><td valign="top" align="left">'.get_lang('Antique').' <img src="'.api_get_path(WEB_DEFAULT_COURSE_DOCUMENT_PATH).'images/mr_dokeos/thinking.jpg"></td><td valign="top" align="left">'.get_lang('Antique').'
</td></tr></table>'); </td></tr></table>');
// Insert exercise // Insert exercise
@ -4668,6 +4671,7 @@ class CourseManager
} else { } else {
$visibility = $params['visibility']; $visibility = $params['visibility'];
} }
$subscribe = isset($params['subscribe']) ? intval($params['subscribe']) : ($visibility == COURSE_VISIBILITY_OPEN_PLATFORM ? 1 : 0); $subscribe = isset($params['subscribe']) ? intval($params['subscribe']) : ($visibility == COURSE_VISIBILITY_OPEN_PLATFORM ? 1 : 0);
$unsubscribe = isset($params['unsubscribe']) ? intval($params['unsubscribe']) : 0; $unsubscribe = isset($params['unsubscribe']) ? intval($params['unsubscribe']) : 0;
$expiration_date = isset($params['expiration_date']) ? $params['expiration_date'] : null; $expiration_date = isset($params['expiration_date']) ? $params['expiration_date'] : null;
@ -4767,6 +4771,7 @@ class CourseManager
user_course_cat = '0'"; user_course_cat = '0'";
Database::query($sql); Database::query($sql);
} }
if (!empty($teachers)) { if (!empty($teachers)) {
if (!is_array($teachers)) { if (!is_array($teachers)) {
$teachers = array($teachers); $teachers = array($teachers);

@ -21,7 +21,7 @@ class DataFilesystem
private $fs; private $fs;
/** /**
* @param string $path * @param array $paths
* @param Filesystem $filesystem * @param Filesystem $filesystem
*/ */
public function __construct($paths, Filesystem $filesystem) public function __construct($paths, Filesystem $filesystem)
@ -32,7 +32,7 @@ class DataFilesystem
/** /**
* Gets a file from the "data" folder * Gets a file from the "data" folder
* @param $file * @param string $file
* @return SplFileInfo * @return SplFileInfo
* @throws \InvalidArgumentException * @throws \InvalidArgumentException
*/ */

Loading…
Cancel
Save