@@ -218,7 +218,7 @@ |
||
218 | 218 | /** |
219 | 219 | * Displays the tools of a certain category. |
220 | 220 | * |
221 | - * @return void |
|
221 | + * @return string |
|
222 | 222 | * @param string $course_tool_category contains the category of tools to display: |
223 | 223 | * "Public", "PublicButHide", "courseAdmin", "claroAdmin" |
224 | 224 | */ |
@@ -6038,8 +6038,8 @@ discard block |
||
6038 | 6038 | $course_id = api_get_course_int_id(); |
6039 | 6039 | } |
6040 | 6040 | |
6041 | - $creatorId = empty($creatorId) ? api_get_user_id() : $creatorId; |
|
6042 | - $sessionId = api_get_session_id(); |
|
6041 | + $creatorId = empty($creatorId) ? api_get_user_id() : $creatorId; |
|
6042 | + $sessionId = api_get_session_id(); |
|
6043 | 6043 | |
6044 | 6044 | // Generates folder |
6045 | 6045 | $result = $this->generate_lp_folder($courseInfo); |
@@ -11114,7 +11114,7 @@ discard block |
||
11114 | 11114 | $lpItemId = []; |
11115 | 11115 | $typeListNotToVerify = self::getChapterTypes(); |
11116 | 11116 | |
11117 | - // Using get_toc() function instead $this->items because returns the correct order of the items |
|
11117 | + // Using get_toc() function instead $this->items because returns the correct order of the items |
|
11118 | 11118 | foreach ($this->get_toc() as $item) { |
11119 | 11119 | if (!in_array($item['type'], $typeListNotToVerify)) { |
11120 | 11120 | $lpItemId[] = $item['id']; |
@@ -447,7 +447,7 @@ discard block |
||
447 | 447 | } |
448 | 448 | |
449 | 449 | /** |
450 | - * @param $course_id |
|
450 | + * @param integer $course_id |
|
451 | 451 | * @return int |
452 | 452 | */ |
453 | 453 | public function set_course_int_id($course_id) |
@@ -487,7 +487,7 @@ discard block |
||
487 | 487 | * @param int $max_time_allowed |
488 | 488 | * @param int $userId |
489 | 489 | * |
490 | - * @return int |
|
490 | + * @return false|string |
|
491 | 491 | */ |
492 | 492 | public function add_item( |
493 | 493 | $parent, |
@@ -1034,7 +1034,7 @@ discard block |
||
1034 | 1034 | * @param array $courseInfo |
1035 | 1035 | * @param integer $id Learnpath ID |
1036 | 1036 | * @param string $delete Whether to delete data or keep it (default: 'keep', others: 'remove') |
1037 | - * @return boolean True on success, false on failure (might change that to return number of elements deleted) |
|
1037 | + * @return false|null True on success, false on failure (might change that to return number of elements deleted) |
|
1038 | 1038 | */ |
1039 | 1039 | public function delete($courseInfo = null, $id = null, $delete = 'keep') |
1040 | 1040 | { |
@@ -1181,7 +1181,7 @@ discard block |
||
1181 | 1181 | * @param integer $id Elem ID (0 if first) |
1182 | 1182 | * @param integer $remove Whether to remove the resource/data from the |
1183 | 1183 | * system or leave it (default: 'keep', others 'remove') |
1184 | - * @return integer Number of elements moved |
|
1184 | + * @return false|null Number of elements moved |
|
1185 | 1185 | * @todo implement resource removal |
1186 | 1186 | */ |
1187 | 1187 | public function delete_item($id, $remove = 'keep') |
@@ -1263,7 +1263,7 @@ discard block |
||
1263 | 1263 | * @param array $audio The array resulting of the $_FILES[mp3] element |
1264 | 1264 | * @param int $max_time_allowed |
1265 | 1265 | * @param string $url |
1266 | - * @return boolean True on success, false on error |
|
1266 | + * @return false|null True on success, false on error |
|
1267 | 1267 | */ |
1268 | 1268 | public function edit_item( |
1269 | 1269 | $id, |
@@ -1788,7 +1788,7 @@ discard block |
||
1788 | 1788 | |
1789 | 1789 | /** |
1790 | 1790 | * Gets the first element URL. |
1791 | - * @return string URL to load into the viewer |
|
1791 | + * @return false|null URL to load into the viewer |
|
1792 | 1792 | */ |
1793 | 1793 | public function first() |
1794 | 1794 | { |
@@ -2334,6 +2334,7 @@ discard block |
||
2334 | 2334 | * @param int $student_id |
2335 | 2335 | * @param string Course code (optional) |
2336 | 2336 | * @param int $sessionId |
2337 | + * @param string $courseCode |
|
2337 | 2338 | * @return bool |
2338 | 2339 | */ |
2339 | 2340 | public static function is_lp_visible_for_student( |
@@ -2662,7 +2663,7 @@ discard block |
||
2662 | 2663 | /** |
2663 | 2664 | * @param string $size |
2664 | 2665 | * @param string $path_type |
2665 | - * @return bool|string |
|
2666 | + * @return string|false |
|
2666 | 2667 | */ |
2667 | 2668 | public function get_preview_image_path($size = null, $path_type = 'web') |
2668 | 2669 | { |
@@ -2809,6 +2810,8 @@ discard block |
||
2809 | 2810 | * Returns the XML DOM document's node |
2810 | 2811 | * @param resource Reference to a list of objects to search for the given ITEM_* |
2811 | 2812 | * @param string The identifier to look for |
2813 | + * @param DOMNodeList $children |
|
2814 | + * @param string $id |
|
2812 | 2815 | * @return mixed The reference to the element found with that identifier. False if not found |
2813 | 2816 | */ |
2814 | 2817 | public function get_scorm_xml_node(& $children, $id) |
@@ -2994,7 +2997,7 @@ discard block |
||
2994 | 2997 | /** |
2995 | 2998 | * Generate and return the table of contents for this learnpath. The (flat) table returned can be |
2996 | 2999 | * used by get_html_toc() to be ready to display |
2997 | - * @return array TOC as a table with 4 elements per row: title, link, status and level |
|
3000 | + * @return boolean TOC as a table with 4 elements per row: title, link, status and level |
|
2998 | 3001 | */ |
2999 | 3002 | public function get_toc() |
3000 | 3003 | { |
@@ -3126,7 +3129,7 @@ discard block |
||
3126 | 3129 | } |
3127 | 3130 | |
3128 | 3131 | /** |
3129 | - * @return array |
|
3132 | + * @return string[] |
|
3130 | 3133 | */ |
3131 | 3134 | public static function getChapterTypes() |
3132 | 3135 | { |
@@ -4030,7 +4033,7 @@ discard block |
||
4030 | 4033 | * Open a resource = initialise all local variables relative to this resource. Depending on the child |
4031 | 4034 | * class, this might be redefined to allow several behaviours depending on the document type. |
4032 | 4035 | * @param integer Resource ID |
4033 | - * @return boolean True on success, false otherwise |
|
4036 | + * @return boolean|null True on success, false otherwise |
|
4034 | 4037 | */ |
4035 | 4038 | public function open($id) |
4036 | 4039 | { |
@@ -4199,7 +4202,7 @@ discard block |
||
4199 | 4202 | * Can be used as abstract |
4200 | 4203 | * @param integer $lp_id Learnpath id |
4201 | 4204 | * @param string $set_visibility New visibility (v/i - visible/invisible) |
4202 | - * @return bool |
|
4205 | + * @return null|false |
|
4203 | 4206 | */ |
4204 | 4207 | public static function toggle_publish($lp_id, $set_visibility = 'v') |
4205 | 4208 | { |
@@ -4464,7 +4467,7 @@ discard block |
||
4464 | 4467 | * Make sure the results are saved with anoter method. This method should probably be |
4465 | 4468 | * redefined in children classes. |
4466 | 4469 | * To use a similar method statically, use the create_new_attempt() method |
4467 | - * @return string URL to load in the viewer |
|
4470 | + * @return boolean URL to load in the viewer |
|
4468 | 4471 | */ |
4469 | 4472 | public function restart() |
4470 | 4473 | { |
@@ -5041,7 +5044,7 @@ discard block |
||
5041 | 5044 | |
5042 | 5045 | /** |
5043 | 5046 | * Sets use_max_score |
5044 | - * @param string $use_max_score Optional string giving the new location of this learnpath |
|
5047 | + * @param integer $use_max_score Optional string giving the new location of this learnpath |
|
5045 | 5048 | * @return boolean True on success / False on error |
5046 | 5049 | */ |
5047 | 5050 | public function set_use_max_score($use_max_score = 1) |
@@ -5462,6 +5465,7 @@ discard block |
||
5462 | 5465 | * Register the attempt mode into db thanks to flags prevent_reinit and seriousgame_mode flags |
5463 | 5466 | * |
5464 | 5467 | * @param string 'seriousgame', 'single' or 'multiple' |
5468 | + * @param string $mode |
|
5465 | 5469 | * @return boolean |
5466 | 5470 | * @author ndiechburg <[email protected]> |
5467 | 5471 | **/ |
@@ -5504,7 +5508,7 @@ discard block |
||
5504 | 5508 | /** |
5505 | 5509 | * Switch between multiple attempt, single attempt or serious_game mode (only for scorm) |
5506 | 5510 | * |
5507 | - * @return boolean |
|
5511 | + * @return boolean|null |
|
5508 | 5512 | * @author ndiechburg <[email protected]> |
5509 | 5513 | **/ |
5510 | 5514 | public function switch_attempt_mode() |
@@ -6829,7 +6833,7 @@ discard block |
||
6829 | 6833 | /** |
6830 | 6834 | * Function that displays a list with al the resources that |
6831 | 6835 | * could be added to the learning path |
6832 | - * @return string |
|
6836 | + * @return boolean |
|
6833 | 6837 | */ |
6834 | 6838 | public function display_resources() |
6835 | 6839 | { |
@@ -10588,7 +10592,7 @@ discard block |
||
10588 | 10592 | |
10589 | 10593 | /** |
10590 | 10594 | * @param int $lp_id |
10591 | - * @return bool |
|
10595 | + * @return false|null |
|
10592 | 10596 | */ |
10593 | 10597 | public function scorm_export_to_pdf($lp_id) |
10594 | 10598 | { |
@@ -11138,7 +11142,7 @@ discard block |
||
11138 | 11142 | |
11139 | 11143 | /** |
11140 | 11144 | * @param int $itemId |
11141 | - * @return learnpathItem|false |
|
11145 | + * @return string |
|
11142 | 11146 | */ |
11143 | 11147 | public function getItem($itemId) |
11144 | 11148 | { |
@@ -11313,7 +11317,7 @@ discard block |
||
11313 | 11317 | |
11314 | 11318 | /** |
11315 | 11319 | * Get the item of exercise type (evaluation type) |
11316 | - * @return array The final evaluation. Otherwise return false |
|
11320 | + * @return integer The final evaluation. Otherwise return false |
|
11317 | 11321 | */ |
11318 | 11322 | public function getFinalEvaluationItem() |
11319 | 11323 | { |
@@ -11530,7 +11534,7 @@ discard block |
||
11530 | 11534 | /** |
11531 | 11535 | * Create a forum for this learning path |
11532 | 11536 | * @param type $forumCategoryId |
11533 | - * @return int The forum ID if was created. Otherwise return false |
|
11537 | + * @return false|string The forum ID if was created. Otherwise return false |
|
11534 | 11538 | */ |
11535 | 11539 | public function createForum($forumCategoryId) |
11536 | 11540 | { |
@@ -3964,7 +3964,8 @@ discard block |
||
3964 | 3964 | if ($num > 0) { |
3965 | 3965 | $i = 1; |
3966 | 3966 | while ($row = Database::fetch_array($res)) { |
3967 | - if ($row['display_order'] != $i) { // If we find a gap in the order, we need to fix it. |
|
3967 | + if ($row['display_order'] != $i) { |
|
3968 | +// If we find a gap in the order, we need to fix it. |
|
3968 | 3969 | $sql = "UPDATE $lp_table SET display_order = $i |
3969 | 3970 | WHERE c_id = $courseId AND id = ".$row['id']; |
3970 | 3971 | Database::query($sql); |
@@ -3975,9 +3976,11 @@ discard block |
||
3975 | 3976 | $i++; |
3976 | 3977 | } |
3977 | 3978 | } |
3978 | - if ($num > 1) { // If there's only one element, no need to sort. |
|
3979 | + if ($num > 1) { |
|
3980 | +// If there's only one element, no need to sort. |
|
3979 | 3981 | $order = $lps[$lp_id]['display_order']; |
3980 | - if ($order > 1) { // If it's the first element, no need to move up. |
|
3982 | + if ($order > 1) { |
|
3983 | +// If it's the first element, no need to move up. |
|
3981 | 3984 | $sql = "UPDATE $lp_table SET display_order = $order |
3982 | 3985 | WHERE c_id = $courseId AND id = ".$lp_order[$order - 1]; |
3983 | 3986 | Database::query($sql); |
@@ -4037,9 +4040,11 @@ discard block |
||
4037 | 4040 | $i++; |
4038 | 4041 | } |
4039 | 4042 | } |
4040 | - if ($num > 1) { // If there's only one element, no need to sort. |
|
4043 | + if ($num > 1) { |
|
4044 | +// If there's only one element, no need to sort. |
|
4041 | 4045 | $order = $lps[$lp_id]['display_order']; |
4042 | - if ($order < $max) { // If it's the first element, no need to move up. |
|
4046 | + if ($order < $max) { |
|
4047 | +// If it's the first element, no need to move up. |
|
4043 | 4048 | $sql_u1 = "UPDATE $lp_table SET display_order = $order |
4044 | 4049 | WHERE c_id = ".$courseId." AND id = ".$lp_order[$order + 1]; |
4045 | 4050 | Database::query($sql_u1); |
@@ -4842,8 +4847,9 @@ discard block |
||
4842 | 4847 | if ($this->debug > 0) { |
4843 | 4848 | error_log('New LP - In learnpath::set_maker()', 0); |
4844 | 4849 | } |
4845 | - if (empty ($name)) |
|
4846 | - return false; |
|
4850 | + if (empty ($name)) { |
|
4851 | + return false; |
|
4852 | + } |
|
4847 | 4853 | $this->maker = $name; |
4848 | 4854 | $lp_table = Database::get_course_table(TABLE_LP_MAIN); |
4849 | 4855 | $course_id = api_get_course_int_id(); |
@@ -4908,8 +4914,9 @@ discard block |
||
4908 | 4914 | public function set_terms_by_prefix($terms_string, $prefix) |
4909 | 4915 | { |
4910 | 4916 | $course_id = api_get_course_int_id(); |
4911 | - if (api_get_setting('search_enabled') !== 'true') |
|
4912 | - return false; |
|
4917 | + if (api_get_setting('search_enabled') !== 'true') { |
|
4918 | + return false; |
|
4919 | + } |
|
4913 | 4920 | |
4914 | 4921 | if (!extension_loaded('xapian')) { |
4915 | 4922 | return false; |
@@ -4922,8 +4929,9 @@ discard block |
||
4922 | 4929 | $stored_terms = $this->get_common_index_terms_by_prefix($prefix); |
4923 | 4930 | |
4924 | 4931 | // Don't do anything if no change, verify only at DB, not the search engine. |
4925 | - if ((count(array_diff($terms, $stored_terms)) == 0) && (count(array_diff($stored_terms, $terms)) == 0)) |
|
4926 | - return false; |
|
4932 | + if ((count(array_diff($terms, $stored_terms)) == 0) && (count(array_diff($stored_terms, $terms)) == 0)) { |
|
4933 | + return false; |
|
4934 | + } |
|
4927 | 4935 | |
4928 | 4936 | require_once 'xapian.php'; // TODO: Try catch every xapian use or make wrappers on API. |
4929 | 4937 | require_once api_get_path(LIBRARY_PATH).'search/ChamiloIndexer.class.php'; |
@@ -5112,8 +5120,9 @@ discard block |
||
5112 | 5120 | if ($this->debug > 0) { |
5113 | 5121 | error_log('New LP - In learnpath::set_proximity()', 0); |
5114 | 5122 | } |
5115 | - if (empty ($name)) |
|
5116 | - return false; |
|
5123 | + if (empty ($name)) { |
|
5124 | + return false; |
|
5125 | + } |
|
5117 | 5126 | |
5118 | 5127 | $this->proximity = $name; |
5119 | 5128 | $lp_table = Database::get_course_table(TABLE_LP_MAIN); |
@@ -6708,10 +6717,12 @@ discard block |
||
6708 | 6717 | if ($new_comment || $new_title) { |
6709 | 6718 | $tbl_doc = Database::get_course_table(TABLE_DOCUMENT); |
6710 | 6719 | $ct = ''; |
6711 | - if ($new_comment) |
|
6712 | - $ct .= ", comment='".Database::escape_string($new_comment)."'"; |
|
6713 | - if ($new_title) |
|
6714 | - $ct .= ", title='".Database::escape_string($new_title)."' "; |
|
6720 | + if ($new_comment) { |
|
6721 | + $ct .= ", comment='".Database::escape_string($new_comment)."'"; |
|
6722 | + } |
|
6723 | + if ($new_title) { |
|
6724 | + $ct .= ", title='".Database::escape_string($new_title)."' "; |
|
6725 | + } |
|
6715 | 6726 | |
6716 | 6727 | $sql = "UPDATE ".$tbl_doc." SET ".substr($ct, 1)." |
6717 | 6728 | WHERE c_id = ".$course_id." AND id = ".$document_id; |
@@ -7443,8 +7454,9 @@ discard block |
||
7443 | 7454 | $arrHide[] = $arrLP[$i]['id']; |
7444 | 7455 | } |
7445 | 7456 | } else { |
7446 | - if ($arrLP[$i]['item_type'] == 'dir') |
|
7447 | - $return .= '<option '.(($parent == $arrLP[$i]['id']) ? 'selected="selected" ' : '').'style="padding-left:'.($arrLP[$i]['depth'] * 10).'px;" value="'.$arrLP[$i]['id'].'">'.$arrLP[$i]['title'].'</option>'; |
|
7457 | + if ($arrLP[$i]['item_type'] == 'dir') { |
|
7458 | + $return .= '<option '.(($parent == $arrLP[$i]['id']) ? 'selected="selected" ' : '').'style="padding-left:'.($arrLP[$i]['depth'] * 10).'px;" value="'.$arrLP[$i]['id'].'">'.$arrLP[$i]['title'].'</option>'; |
|
7459 | + } |
|
7448 | 7460 | } |
7449 | 7461 | } |
7450 | 7462 | reset($arrLP); |
@@ -7461,11 +7473,13 @@ discard block |
||
7461 | 7473 | |
7462 | 7474 | for ($i = 0; $i < count($arrLP); $i++) { |
7463 | 7475 | if ($arrLP[$i]['parent_item_id'] == $parent && $arrLP[$i]['id'] != $id) { |
7464 | - if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) |
|
7476 | + if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) { |
|
7477 | + $selected = 'selected="selected" '; |
|
7478 | + } elseif ($action == 'add') { |
|
7465 | 7479 | $selected = 'selected="selected" '; |
7466 | - elseif ($action == 'add') $selected = 'selected="selected" '; |
|
7467 | - else |
|
7468 | - $selected = ''; |
|
7480 | + } else { |
|
7481 | + $selected = ''; |
|
7482 | + } |
|
7469 | 7483 | |
7470 | 7484 | $return .= '<option '.$selected.'value="'.$arrLP[$i]['id'].'">'.get_lang('After').' "'.$arrLP[$i]['title'].'"</option>'; |
7471 | 7485 | } |
@@ -7492,9 +7506,11 @@ discard block |
||
7492 | 7506 | $arrHide = array(); |
7493 | 7507 | for ($i = 0; $i < count($arrLP); $i++) { |
7494 | 7508 | if ($arrLP[$i]['id'] != $id && $arrLP[$i]['item_type'] != 'dir') { |
7495 | - if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) |
|
7496 | - $s_selected_position = $arrLP[$i]['id']; |
|
7497 | - elseif ($action == 'add') $s_selected_position = 0; |
|
7509 | + if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) { |
|
7510 | + $s_selected_position = $arrLP[$i]['id']; |
|
7511 | + } elseif ($action == 'add') { |
|
7512 | + $s_selected_position = 0; |
|
7513 | + } |
|
7498 | 7514 | $arrHide[$arrLP[$i]['id']]['value'] = $arrLP[$i]['title']; |
7499 | 7515 | } |
7500 | 7516 | } |
@@ -7917,9 +7933,11 @@ discard block |
||
7917 | 7933 | $s_selected_position = 0; |
7918 | 7934 | for ($i = 0; $i < count($arrLP); $i++) { |
7919 | 7935 | if ($arrLP[$i]['id'] != $id && $arrLP[$i]['item_type'] != 'dir') { |
7920 | - if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) |
|
7921 | - $s_selected_position = $arrLP[$i]['id']; |
|
7922 | - elseif ($action == 'add') $s_selected_position = 0; |
|
7936 | + if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) { |
|
7937 | + $s_selected_position = $arrLP[$i]['id']; |
|
7938 | + } elseif ($action == 'add') { |
|
7939 | + $s_selected_position = 0; |
|
7940 | + } |
|
7923 | 7941 | $arrHide[$arrLP[$i]['id']]['value'] = $arrLP[$i]['title']; |
7924 | 7942 | |
7925 | 7943 | } |
@@ -7953,8 +7971,7 @@ discard block |
||
7953 | 7971 | |
7954 | 7972 | if (is_numeric($extra_info)) { |
7955 | 7973 | $form->addHidden('path', $extra_info); |
7956 | - } |
|
7957 | - elseif (is_array($extra_info)) { |
|
7974 | + } elseif (is_array($extra_info)) { |
|
7958 | 7975 | $form->addHidden('path', $extra_info['path']); |
7959 | 7976 | } |
7960 | 7977 | |
@@ -8818,9 +8835,11 @@ discard block |
||
8818 | 8835 | $arrHide = array(); |
8819 | 8836 | for ($i = 0; $i < count($arrLP); $i++) { |
8820 | 8837 | if ($arrLP[$i]['id'] != $id && $arrLP[$i]['item_type'] != 'dir') { |
8821 | - if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) |
|
8822 | - $s_selected_position = $arrLP[$i]['id']; |
|
8823 | - elseif ($action == 'add') $s_selected_position = 0; |
|
8838 | + if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) { |
|
8839 | + $s_selected_position = $arrLP[$i]['id']; |
|
8840 | + } elseif ($action == 'add') { |
|
8841 | + $s_selected_position = 0; |
|
8842 | + } |
|
8824 | 8843 | $arrHide[$arrLP[$i]['id']]['value'] = $arrLP[$i]['title']; |
8825 | 8844 | |
8826 | 8845 | } |
@@ -9020,9 +9039,11 @@ discard block |
||
9020 | 9039 | $arrHide = array(); |
9021 | 9040 | for ($i = 0; $i < count($arrLP); $i++) { |
9022 | 9041 | if ($arrLP[$i]['id'] != $id && $arrLP[$i]['item_type'] != 'dir') { |
9023 | - if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) |
|
9024 | - $s_selected_position = $arrLP[$i]['id']; |
|
9025 | - elseif ($action == 'add') $s_selected_position = 0; |
|
9042 | + if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) { |
|
9043 | + $s_selected_position = $arrLP[$i]['id']; |
|
9044 | + } elseif ($action == 'add') { |
|
9045 | + $s_selected_position = 0; |
|
9046 | + } |
|
9026 | 9047 | $arrHide[$arrLP[$i]['id']]['value'] = $arrLP[$i]['title']; |
9027 | 9048 | |
9028 | 9049 | } |
@@ -10232,10 +10253,11 @@ discard block |
||
10232 | 10253 | |
10233 | 10254 | // Dependency to other files - not yet supported. |
10234 | 10255 | $i = 1; |
10235 | - if ($inc_docs) |
|
10236 | - foreach ($inc_docs as $doc_info) { |
|
10256 | + if ($inc_docs) { |
|
10257 | + foreach ($inc_docs as $doc_info) { |
|
10237 | 10258 | if (count($doc_info) < 1 || empty($doc_info[0])) { |
10238 | 10259 | continue; |
10260 | + } |
|
10239 | 10261 | } |
10240 | 10262 | $my_dep = $xmldoc->createElement('resource'); |
10241 | 10263 | $res_id = 'RESOURCE_'.$item->get_id().'_'.$i; |
@@ -10686,7 +10708,8 @@ discard block |
||
10686 | 10708 | |
10687 | 10709 | // File path is courses/CHAMILO/document/.... |
10688 | 10710 | $info_file_path = explode('/', $file_path); |
10689 | - if ($info_file_path[0] == 'courses') { // Add character "/" in file path. |
|
10711 | + if ($info_file_path[0] == 'courses') { |
|
10712 | +// Add character "/" in file path. |
|
10690 | 10713 | $file_path_dest = 'document/'.$file_path; |
10691 | 10714 | } |
10692 | 10715 |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | ]; |
229 | 229 | $this->lp_view_id = Database::insert($lp_table, $params); |
230 | 230 | if (!empty($this->lp_view_id)) { |
231 | - $sql = "UPDATE $lp_table SET id = iid |
|
231 | + $sql = "update $lp_table SET id = iid |
|
232 | 232 | WHERE iid = ".$this->lp_view_id; |
233 | 233 | Database::query($sql); |
234 | 234 | } |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | $insertId = Database::insert($itemViewTable, $params); |
396 | 396 | |
397 | 397 | if ($insertId) { |
398 | - $sql = "UPDATE $itemViewTable SET id = iid |
|
398 | + $sql = "update $itemViewTable SET id = iid |
|
399 | 399 | WHERE iid = $insertId"; |
400 | 400 | Database::query($sql); |
401 | 401 | } |
@@ -626,16 +626,16 @@ discard block |
||
626 | 626 | } |
627 | 627 | |
628 | 628 | if ($new_item_id) { |
629 | - $sql = "UPDATE $tbl_lp_item SET id = iid WHERE iid = $new_item_id"; |
|
629 | + $sql = "update $tbl_lp_item SET id = iid WHERE iid = $new_item_id"; |
|
630 | 630 | Database::query($sql); |
631 | 631 | |
632 | - $sql = "UPDATE $tbl_lp_item |
|
632 | + $sql = "update $tbl_lp_item |
|
633 | 633 | SET previous_item_id = $new_item_id |
634 | 634 | WHERE c_id = $course_id AND id = $next"; |
635 | 635 | Database::query($sql); |
636 | 636 | |
637 | 637 | // Update the item that should be before the new item. |
638 | - $sql = "UPDATE $tbl_lp_item |
|
638 | + $sql = "update $tbl_lp_item |
|
639 | 639 | SET next_item_id = $new_item_id |
640 | 640 | WHERE c_id = $course_id AND id = $tmp_previous"; |
641 | 641 | Database::query($sql); |
@@ -723,7 +723,7 @@ discard block |
||
723 | 723 | $file = $file_components[count($file_components) - 1]; |
724 | 724 | |
725 | 725 | // Store the mp3 file in the lp_item table. |
726 | - $sql = "UPDATE $tbl_lp_item SET |
|
726 | + $sql = "update $tbl_lp_item SET |
|
727 | 727 | audio = '".Database::escape_string($file)."' |
728 | 728 | WHERE id = '" . intval($new_item_id)."'"; |
729 | 729 | Database::query($sql); |
@@ -871,7 +871,7 @@ discard block |
||
871 | 871 | $id = Database::insert($tbl_lp, $params); |
872 | 872 | |
873 | 873 | if ($id > 0) { |
874 | - $sql = "UPDATE $tbl_lp SET id = iid WHERE iid = $id"; |
|
874 | + $sql = "update $tbl_lp SET id = iid WHERE iid = $id"; |
|
875 | 875 | Database::query($sql); |
876 | 876 | |
877 | 877 | // Insert into item_property. |
@@ -1236,14 +1236,14 @@ discard block |
||
1236 | 1236 | } |
1237 | 1237 | Database::query($sql_del); |
1238 | 1238 | // Now update surrounding items. |
1239 | - $sql_upd = "UPDATE $lp_item SET next_item_id = $next |
|
1239 | + $sql_upd = "update $lp_item SET next_item_id = $next |
|
1240 | 1240 | WHERE c_id = ".$course_id." AND id = $previous"; |
1241 | 1241 | Database::query($sql_upd); |
1242 | - $sql_upd = "UPDATE $lp_item SET previous_item_id = $previous |
|
1242 | + $sql_upd = "update $lp_item SET previous_item_id = $previous |
|
1243 | 1243 | WHERE c_id = ".$course_id." AND id = $next"; |
1244 | 1244 | Database::query($sql_upd); |
1245 | 1245 | // Now update all following items with new display order. |
1246 | - $sql_all = "UPDATE $lp_item SET display_order = display_order-1 |
|
1246 | + $sql_all = "update $lp_item SET display_order = display_order-1 |
|
1247 | 1247 | WHERE |
1248 | 1248 | c_id = ".$course_id." AND |
1249 | 1249 | lp_id = $lp AND |
@@ -1252,7 +1252,7 @@ discard block |
||
1252 | 1252 | Database::query($sql_all); |
1253 | 1253 | |
1254 | 1254 | //Removing prerequisites since the item will not longer exist |
1255 | - $sql_all = "UPDATE $lp_item SET prerequisite = '' WHERE c_id = ".$course_id." AND prerequisite = $id"; |
|
1255 | + $sql_all = "update $lp_item SET prerequisite = '' WHERE c_id = ".$course_id." AND prerequisite = $id"; |
|
1256 | 1256 | Database::query($sql_all); |
1257 | 1257 | |
1258 | 1258 | // Remove from search engine if enabled. |
@@ -1468,7 +1468,7 @@ discard block |
||
1468 | 1468 | |
1469 | 1469 | // TODO: htmlspecialchars to be checked for encoding related problems. |
1470 | 1470 | // Update the current item with the new data. |
1471 | - $sql = "UPDATE $tbl_lp_item |
|
1471 | + $sql = "update $tbl_lp_item |
|
1472 | 1472 | SET |
1473 | 1473 | title = '".Database::escape_string($title)."', |
1474 | 1474 | description = '".Database::escape_string($description)."', |
@@ -3685,7 +3685,7 @@ discard block |
||
3685 | 3685 | $id = Database::insert_id(); |
3686 | 3686 | $this->lp_view_id = $id; |
3687 | 3687 | |
3688 | - $sql = "UPDATE $lp_view_table SET id = iid WHERE iid = $id"; |
|
3688 | + $sql = "update $lp_view_table SET id = iid WHERE iid = $id"; |
|
3689 | 3689 | Database::query($sql); |
3690 | 3690 | } |
3691 | 3691 | |
@@ -3826,7 +3826,7 @@ discard block |
||
3826 | 3826 | $previous_previous = $row2['previous_item_id']; |
3827 | 3827 | // Update previous_previous item (switch "next" with current). |
3828 | 3828 | if ($previous_previous != 0) { |
3829 | - $sql_upd2 = "UPDATE $tbl_lp_item SET |
|
3829 | + $sql_upd2 = "update $tbl_lp_item SET |
|
3830 | 3830 | next_item_id = $id |
3831 | 3831 | WHERE c_id = ".$course_id." AND id = $previous_previous"; |
3832 | 3832 | if ($this->debug > 2) { |
@@ -3836,7 +3836,7 @@ discard block |
||
3836 | 3836 | } |
3837 | 3837 | // Update previous item (switch with current). |
3838 | 3838 | if ($previous != 0) { |
3839 | - $sql_upd2 = "UPDATE $tbl_lp_item SET |
|
3839 | + $sql_upd2 = "update $tbl_lp_item SET |
|
3840 | 3840 | next_item_id = $next, |
3841 | 3841 | previous_item_id = $id, |
3842 | 3842 | display_order = display_order +1 |
@@ -3849,7 +3849,7 @@ discard block |
||
3849 | 3849 | |
3850 | 3850 | // Update current item (switch with previous). |
3851 | 3851 | if ($id != 0) { |
3852 | - $sql_upd2 = "UPDATE $tbl_lp_item SET |
|
3852 | + $sql_upd2 = "update $tbl_lp_item SET |
|
3853 | 3853 | next_item_id = $previous, |
3854 | 3854 | previous_item_id = $previous_previous, |
3855 | 3855 | display_order = display_order-1 |
@@ -3861,7 +3861,7 @@ discard block |
||
3861 | 3861 | } |
3862 | 3862 | // Update next item (new previous item). |
3863 | 3863 | if ($next != 0) { |
3864 | - $sql_upd2 = "UPDATE $tbl_lp_item SET previous_item_id = $previous |
|
3864 | + $sql_upd2 = "update $tbl_lp_item SET previous_item_id = $previous |
|
3865 | 3865 | WHERE c_id = ".$course_id." AND id = $next"; |
3866 | 3866 | if ($this->debug > 2) { |
3867 | 3867 | error_log($sql_upd2, 0); |
@@ -3890,14 +3890,14 @@ discard block |
||
3890 | 3890 | $next_next = $row2['next_item_id']; |
3891 | 3891 | // Update previous item (switch with current). |
3892 | 3892 | if ($previous != 0) { |
3893 | - $sql_upd2 = "UPDATE $tbl_lp_item |
|
3893 | + $sql_upd2 = "update $tbl_lp_item |
|
3894 | 3894 | SET next_item_id = $next |
3895 | 3895 | WHERE c_id = ".$course_id." AND id = $previous"; |
3896 | 3896 | Database::query($sql_upd2); |
3897 | 3897 | } |
3898 | 3898 | // Update current item (switch with previous). |
3899 | 3899 | if ($id != 0) { |
3900 | - $sql_upd2 = "UPDATE $tbl_lp_item SET |
|
3900 | + $sql_upd2 = "update $tbl_lp_item SET |
|
3901 | 3901 | previous_item_id = $next, |
3902 | 3902 | next_item_id = $next_next, |
3903 | 3903 | display_order = display_order + 1 |
@@ -3907,7 +3907,7 @@ discard block |
||
3907 | 3907 | |
3908 | 3908 | // Update next item (new previous item). |
3909 | 3909 | if ($next != 0) { |
3910 | - $sql_upd2 = "UPDATE $tbl_lp_item SET |
|
3910 | + $sql_upd2 = "update $tbl_lp_item SET |
|
3911 | 3911 | previous_item_id = $previous, |
3912 | 3912 | next_item_id = $id, |
3913 | 3913 | display_order = display_order-1 |
@@ -3917,7 +3917,7 @@ discard block |
||
3917 | 3917 | |
3918 | 3918 | // Update next_next item (switch "previous" with current). |
3919 | 3919 | if ($next_next != 0) { |
3920 | - $sql_upd2 = "UPDATE $tbl_lp_item SET |
|
3920 | + $sql_upd2 = "update $tbl_lp_item SET |
|
3921 | 3921 | previous_item_id = $id |
3922 | 3922 | WHERE c_id = ".$course_id." AND id = $next_next"; |
3923 | 3923 | Database::query($sql_upd2); |
@@ -3965,7 +3965,7 @@ discard block |
||
3965 | 3965 | $i = 1; |
3966 | 3966 | while ($row = Database::fetch_array($res)) { |
3967 | 3967 | if ($row['display_order'] != $i) { // If we find a gap in the order, we need to fix it. |
3968 | - $sql = "UPDATE $lp_table SET display_order = $i |
|
3968 | + $sql = "update $lp_table SET display_order = $i |
|
3969 | 3969 | WHERE c_id = $courseId AND id = ".$row['id']; |
3970 | 3970 | Database::query($sql); |
3971 | 3971 | } |
@@ -3978,10 +3978,10 @@ discard block |
||
3978 | 3978 | if ($num > 1) { // If there's only one element, no need to sort. |
3979 | 3979 | $order = $lps[$lp_id]['display_order']; |
3980 | 3980 | if ($order > 1) { // If it's the first element, no need to move up. |
3981 | - $sql = "UPDATE $lp_table SET display_order = $order |
|
3981 | + $sql = "update $lp_table SET display_order = $order |
|
3982 | 3982 | WHERE c_id = $courseId AND id = ".$lp_order[$order - 1]; |
3983 | 3983 | Database::query($sql); |
3984 | - $sql = "UPDATE $lp_table SET display_order = ".($order - 1)." |
|
3984 | + $sql = "update $lp_table SET display_order = ".($order - 1)." |
|
3985 | 3985 | WHERE c_id = $courseId AND id = ".$lp_id; |
3986 | 3986 | Database::query($sql); |
3987 | 3987 | } |
@@ -4027,7 +4027,7 @@ discard block |
||
4027 | 4027 | $max = $i; |
4028 | 4028 | if ($row['display_order'] != $i) { |
4029 | 4029 | // If we find a gap in the order, we need to fix it. |
4030 | - $sql_u = "UPDATE $lp_table SET display_order = $i |
|
4030 | + $sql_u = "update $lp_table SET display_order = $i |
|
4031 | 4031 | WHERE c_id = ".$courseId." AND id = ".$row['id']; |
4032 | 4032 | Database::query($sql_u); |
4033 | 4033 | } |
@@ -4040,10 +4040,10 @@ discard block |
||
4040 | 4040 | if ($num > 1) { // If there's only one element, no need to sort. |
4041 | 4041 | $order = $lps[$lp_id]['display_order']; |
4042 | 4042 | if ($order < $max) { // If it's the first element, no need to move up. |
4043 | - $sql_u1 = "UPDATE $lp_table SET display_order = $order |
|
4043 | + $sql_u1 = "update $lp_table SET display_order = $order |
|
4044 | 4044 | WHERE c_id = ".$courseId." AND id = ".$lp_order[$order + 1]; |
4045 | 4045 | Database::query($sql_u1); |
4046 | - $sql_u2 = "UPDATE $lp_table SET display_order = ".($order + 1)." |
|
4046 | + $sql_u2 = "update $lp_table SET display_order = ".($order + 1)." |
|
4047 | 4047 | WHERE c_id = ".$courseId." AND id = ".$lp_id; |
4048 | 4048 | Database::query($sql_u2); |
4049 | 4049 | } |
@@ -4312,11 +4312,11 @@ discard block |
||
4312 | 4312 | Database::query($sql); |
4313 | 4313 | $insertId = Database::insert_id(); |
4314 | 4314 | if ($insertId) { |
4315 | - $sql = "UPDATE $tbl_tool SET id = iid WHERE iid = $insertId"; |
|
4315 | + $sql = "update $tbl_tool SET id = iid WHERE iid = $insertId"; |
|
4316 | 4316 | Database::query($sql); |
4317 | 4317 | } |
4318 | 4318 | } elseif ($set_visibility == 'v' && $num > 0) { |
4319 | - $sql = "UPDATE $tbl_tool SET |
|
4319 | + $sql = "update $tbl_tool SET |
|
4320 | 4320 | c_id = $course_id, |
4321 | 4321 | name = '$name', |
4322 | 4322 | link = '$link', |
@@ -4585,7 +4585,7 @@ discard block |
||
4585 | 4585 | $view_id = Database::insert_id(); |
4586 | 4586 | |
4587 | 4587 | if ($view_id) { |
4588 | - $sql = "UPDATE $lp_view_table SET id = iid WHERE iid = $view_id"; |
|
4588 | + $sql = "update $lp_view_table SET id = iid WHERE iid = $view_id"; |
|
4589 | 4589 | Database::query($sql); |
4590 | 4590 | $this->lp_view_id = $view_id; |
4591 | 4591 | $this->attempt = $this->attempt + 1; |
@@ -4707,7 +4707,7 @@ discard block |
||
4707 | 4707 | if ($this->debug > 2) { |
4708 | 4708 | error_log('New LP - Saving current item ('.$this->current.') for later review', 0); |
4709 | 4709 | } |
4710 | - $sql = "UPDATE $table SET |
|
4710 | + $sql = "update $table SET |
|
4711 | 4711 | last_item = ".intval($this->get_current_item_id())." |
4712 | 4712 | WHERE |
4713 | 4713 | c_id = $course_id AND |
@@ -4725,7 +4725,7 @@ discard block |
||
4725 | 4725 | list($progress,) = $this->get_progress_bar_text('%'); |
4726 | 4726 | if ($progress >= 0 && $progress <= 100) { |
4727 | 4727 | $progress = (int) $progress; |
4728 | - $sql = "UPDATE $table SET |
|
4728 | + $sql = "update $table SET |
|
4729 | 4729 | progress = $progress |
4730 | 4730 | WHERE |
4731 | 4731 | c_id = ".$course_id." AND |
@@ -4798,7 +4798,7 @@ discard block |
||
4798 | 4798 | $lp = $this->get_id(); |
4799 | 4799 | if ($lp != 0) { |
4800 | 4800 | $tbl_lp = Database::get_course_table(TABLE_LP_MAIN); |
4801 | - $sql = "UPDATE $tbl_lp SET default_encoding = '$enc' |
|
4801 | + $sql = "update $tbl_lp SET default_encoding = '$enc' |
|
4802 | 4802 | WHERE c_id = ".$course_id." AND id = ".$lp; |
4803 | 4803 | $res = Database::query($sql); |
4804 | 4804 | return $res; |
@@ -4823,7 +4823,7 @@ discard block |
||
4823 | 4823 | |
4824 | 4824 | if ($lp != 0) { |
4825 | 4825 | $tbl_lp = Database::get_course_table(TABLE_LP_MAIN); |
4826 | - $sql = "UPDATE $tbl_lp SET js_lib = '$lib' |
|
4826 | + $sql = "update $tbl_lp SET js_lib = '$lib' |
|
4827 | 4827 | WHERE c_id = ".$course_id." AND id = ".$lp; |
4828 | 4828 | $res = Database::query($sql); |
4829 | 4829 | return $res; |
@@ -4848,7 +4848,7 @@ discard block |
||
4848 | 4848 | $lp_table = Database::get_course_table(TABLE_LP_MAIN); |
4849 | 4849 | $course_id = api_get_course_int_id(); |
4850 | 4850 | $lp_id = $this->get_id(); |
4851 | - $sql = "UPDATE $lp_table SET |
|
4851 | + $sql = "update $lp_table SET |
|
4852 | 4852 | content_maker = '".Database::escape_string($this->maker)."' |
4853 | 4853 | WHERE c_id = ".$course_id." AND id = '$lp_id'"; |
4854 | 4854 | if ($this->debug > 2) { |
@@ -4875,7 +4875,7 @@ discard block |
||
4875 | 4875 | $lp_table = Database::get_course_table(TABLE_LP_MAIN); |
4876 | 4876 | $lp_id = $this->get_id(); |
4877 | 4877 | $course_id = $this->course_info['real_id']; |
4878 | - $sql = "UPDATE $lp_table SET |
|
4878 | + $sql = "update $lp_table SET |
|
4879 | 4879 | name = '".Database::escape_string($this->name)."' |
4880 | 4880 | WHERE c_id = ".$course_id." AND id = '$lp_id'"; |
4881 | 4881 | if ($this->debug > 2) { |
@@ -4888,7 +4888,7 @@ discard block |
||
4888 | 4888 | $session_condition = api_get_session_condition($session_id); |
4889 | 4889 | $tbl_tool = Database::get_course_table(TABLE_TOOL_LIST); |
4890 | 4890 | $link = 'lp/lp_controller.php?action=view&lp_id='.$lp_id.'&id_session='.$session_id; |
4891 | - $sql = "UPDATE $tbl_tool SET name = '$this->name' |
|
4891 | + $sql = "update $tbl_tool SET name = '$this->name' |
|
4892 | 4892 | WHERE |
4893 | 4893 | c_id = $course_id AND |
4894 | 4894 | (link='$link' AND image='scormbuilder.gif' $session_condition)"; |
@@ -4990,7 +4990,7 @@ discard block |
||
4990 | 4990 | $this->theme = $name; |
4991 | 4991 | $lp_table = Database::get_course_table(TABLE_LP_MAIN); |
4992 | 4992 | $lp_id = $this->get_id(); |
4993 | - $sql = "UPDATE $lp_table SET theme = '".Database::escape_string($this->theme)."' |
|
4993 | + $sql = "update $lp_table SET theme = '".Database::escape_string($this->theme)."' |
|
4994 | 4994 | WHERE c_id = ".$course_id." AND id = '$lp_id'"; |
4995 | 4995 | if ($this->debug > 2) { |
4996 | 4996 | error_log('New LP - lp updated with new theme : '.$this->theme, 0); |
@@ -5015,7 +5015,7 @@ discard block |
||
5015 | 5015 | $this->preview_image = $name; |
5016 | 5016 | $lp_table = Database::get_course_table(TABLE_LP_MAIN); |
5017 | 5017 | $lp_id = $this->get_id(); |
5018 | - $sql = "UPDATE $lp_table SET |
|
5018 | + $sql = "update $lp_table SET |
|
5019 | 5019 | preview_image = '".Database::escape_string($this->preview_image)."' |
5020 | 5020 | WHERE c_id = ".$course_id." AND id = '$lp_id'"; |
5021 | 5021 | if ($this->debug > 2) { |
@@ -5039,7 +5039,7 @@ discard block |
||
5039 | 5039 | $this->author = $name; |
5040 | 5040 | $lp_table = Database::get_course_table(TABLE_LP_MAIN); |
5041 | 5041 | $lp_id = $this->get_id(); |
5042 | - $sql = "UPDATE $lp_table SET author = '".Database::escape_string($name)."' |
|
5042 | + $sql = "update $lp_table SET author = '".Database::escape_string($name)."' |
|
5043 | 5043 | WHERE c_id = ".$course_id." AND id = '$lp_id'"; |
5044 | 5044 | if ($this->debug > 2) { |
5045 | 5045 | error_log('New LP - lp updated with new preview author : '.$this->author, 0); |
@@ -5064,7 +5064,7 @@ discard block |
||
5064 | 5064 | $this->hide_toc_frame = $hide; |
5065 | 5065 | $lp_table = Database::get_course_table(TABLE_LP_MAIN); |
5066 | 5066 | $lp_id = $this->get_id(); |
5067 | - $sql = "UPDATE $lp_table SET |
|
5067 | + $sql = "update $lp_table SET |
|
5068 | 5068 | hide_toc_frame = '".(int) $this->hide_toc_frame."' |
5069 | 5069 | WHERE c_id = ".$course_id." AND id = '$lp_id'"; |
5070 | 5070 | if ($this->debug > 2) { |
@@ -5092,7 +5092,7 @@ discard block |
||
5092 | 5092 | $this->prerequisite = intval($prerequisite); |
5093 | 5093 | $lp_table = Database::get_course_table(TABLE_LP_MAIN); |
5094 | 5094 | $lp_id = $this->get_id(); |
5095 | - $sql = "UPDATE $lp_table SET prerequisite = '".$this->prerequisite."' |
|
5095 | + $sql = "update $lp_table SET prerequisite = '".$this->prerequisite."' |
|
5096 | 5096 | WHERE c_id = ".$course_id." AND id = '$lp_id'"; |
5097 | 5097 | if ($this->debug > 2) { |
5098 | 5098 | error_log('New LP - lp updated with new preview requisite : '.$this->requisite, 0); |
@@ -5118,7 +5118,7 @@ discard block |
||
5118 | 5118 | $this->proximity = $name; |
5119 | 5119 | $lp_table = Database::get_course_table(TABLE_LP_MAIN); |
5120 | 5120 | $lp_id = $this->get_id(); |
5121 | - $sql = "UPDATE $lp_table SET |
|
5121 | + $sql = "update $lp_table SET |
|
5122 | 5122 | content_local = '".Database::escape_string($name)."' |
5123 | 5123 | WHERE c_id = ".$course_id." AND id = '$lp_id'"; |
5124 | 5124 | if ($this->debug > 2) { |
@@ -5155,7 +5155,7 @@ discard block |
||
5155 | 5155 | $this->use_max_score = $use_max_score; |
5156 | 5156 | $lp_table = Database::get_course_table(TABLE_LP_MAIN); |
5157 | 5157 | $lp_id = $this->get_id(); |
5158 | - $sql = "UPDATE $lp_table SET |
|
5158 | + $sql = "update $lp_table SET |
|
5159 | 5159 | use_max_score = '".$this->use_max_score."' |
5160 | 5160 | WHERE c_id = ".$course_id." AND id = '$lp_id'"; |
5161 | 5161 | |
@@ -5257,7 +5257,7 @@ discard block |
||
5257 | 5257 | $this->modified_on = api_get_utc_datetime(); |
5258 | 5258 | $lp_table = Database::get_course_table(TABLE_LP_MAIN); |
5259 | 5259 | $lp_id = $this->get_id(); |
5260 | - $sql = "UPDATE $lp_table SET modified_on = '".$this->modified_on."' |
|
5260 | + $sql = "update $lp_table SET modified_on = '".$this->modified_on."' |
|
5261 | 5261 | WHERE c_id = ".$course_id." AND id = '$lp_id'"; |
5262 | 5262 | if ($this->debug > 2) { |
5263 | 5263 | error_log('New LP - lp updated with new expired_on : '.$this->modified_on, 0); |
@@ -5411,7 +5411,7 @@ discard block |
||
5411 | 5411 | $view_mode = 'fullscreen'; |
5412 | 5412 | break; |
5413 | 5413 | } |
5414 | - $sql = "UPDATE $lp_table SET default_view_mod = '$view_mode' |
|
5414 | + $sql = "update $lp_table SET default_view_mod = '$view_mode' |
|
5415 | 5415 | WHERE c_id = ".$course_id." AND id = ".$this->get_id(); |
5416 | 5416 | Database::query($sql); |
5417 | 5417 | $this->mode = $view_mode; |
@@ -5449,7 +5449,7 @@ discard block |
||
5449 | 5449 | $force = 1; |
5450 | 5450 | $force_return = true; |
5451 | 5451 | } |
5452 | - $sql = "UPDATE $lp_table SET force_commit = $force |
|
5452 | + $sql = "update $lp_table SET force_commit = $force |
|
5453 | 5453 | WHERE c_id = ".$course_id." AND id = ".$this->get_id(); |
5454 | 5454 | Database::query($sql); |
5455 | 5455 | $this->force_commit = $force_return; |
@@ -5486,7 +5486,7 @@ discard block |
||
5486 | 5486 | while ($row = Database::fetch_array($res)) { |
5487 | 5487 | if ($row['display_order'] != $i) { |
5488 | 5488 | // If we find a gap in the order, we need to fix it. |
5489 | - $sql = "UPDATE $lp_table SET display_order = $i |
|
5489 | + $sql = "update $lp_table SET display_order = $i |
|
5490 | 5490 | WHERE c_id = ".$course_id." AND id = ".$row['id']; |
5491 | 5491 | Database::query($sql); |
5492 | 5492 | } |
@@ -5518,7 +5518,7 @@ discard block |
||
5518 | 5518 | } elseif ($force == 0) { |
5519 | 5519 | $force = 1; |
5520 | 5520 | } |
5521 | - $sql = "UPDATE $lp_table SET prevent_reinit = $force |
|
5521 | + $sql = "update $lp_table SET prevent_reinit = $force |
|
5522 | 5522 | WHERE c_id = ".$course_id." AND id = ".$this->get_id(); |
5523 | 5523 | Database::query($sql); |
5524 | 5524 | $this->prevent_reinit = $force; |
@@ -5590,7 +5590,7 @@ discard block |
||
5590 | 5590 | $this->prevent_reinit = $prevent_reinit; |
5591 | 5591 | $this->seriousgame_mode = $sg_mode; |
5592 | 5592 | $lp_table = Database::get_course_table(TABLE_LP_MAIN); |
5593 | - $sql = "UPDATE $lp_table SET |
|
5593 | + $sql = "update $lp_table SET |
|
5594 | 5594 | prevent_reinit = $prevent_reinit , |
5595 | 5595 | seriousgame_mode = $sg_mode |
5596 | 5596 | WHERE c_id = ".$course_id." AND id = ".$this->get_id(); |
@@ -5656,7 +5656,7 @@ discard block |
||
5656 | 5656 | } elseif ($force == 0) { |
5657 | 5657 | $force = 1; |
5658 | 5658 | } |
5659 | - $sql = "UPDATE $lp_table SET seriousgame_mode = $force |
|
5659 | + $sql = "update $lp_table SET seriousgame_mode = $force |
|
5660 | 5660 | WHERE c_id = ".$course_id." AND id = ".$this->get_id(); |
5661 | 5661 | Database::query($sql); |
5662 | 5662 | $this->seriousgame_mode = $force; |
@@ -5691,7 +5691,7 @@ discard block |
||
5691 | 5691 | } elseif ($force == 0) { |
5692 | 5692 | $force = 1; |
5693 | 5693 | } |
5694 | - $sql = "UPDATE $lp_table SET debug = $force |
|
5694 | + $sql = "update $lp_table SET debug = $force |
|
5695 | 5695 | WHERE c_id = ".$course_id." AND id = ".$this->get_id(); |
5696 | 5696 | Database::query($sql); |
5697 | 5697 | $this->scorm_debug = $force; |
@@ -10908,7 +10908,7 @@ discard block |
||
10908 | 10908 | </div> |
10909 | 10909 | </body> |
10910 | 10910 | </html> |
10911 | -EOD; |
|
10911 | +eod; |
|
10912 | 10912 | if (!is_dir($archive_path.$temp_dir_short.'/document')) { |
10913 | 10913 | @mkdir($archive_path.$temp_dir_short.'/document', api_get_permissions_for_new_directories()); |
10914 | 10914 | } |
@@ -11244,12 +11244,12 @@ discard block |
||
11244 | 11244 | $tbl_lp_item = Database::get_course_table(TABLE_LP_ITEM); |
11245 | 11245 | $lp_id = $this->get_id(); |
11246 | 11246 | //Cleaning prerequisites |
11247 | - $sql = "UPDATE $tbl_lp_item SET prerequisite = '' |
|
11247 | + $sql = "update $tbl_lp_item SET prerequisite = '' |
|
11248 | 11248 | WHERE c_id = ".$course_id." AND lp_id = '$lp_id'"; |
11249 | 11249 | Database::query($sql); |
11250 | 11250 | |
11251 | 11251 | //Cleaning mastery score for exercises |
11252 | - $sql = "UPDATE $tbl_lp_item SET mastery_score = '' |
|
11252 | + $sql = "update $tbl_lp_item SET mastery_score = '' |
|
11253 | 11253 | WHERE c_id = ".$course_id." AND lp_id = '$lp_id' AND item_type = 'quiz'"; |
11254 | 11254 | Database::query($sql); |
11255 | 11255 | } |
@@ -11277,12 +11277,12 @@ discard block |
||
11277 | 11277 | // Current item is not a folder, so it qualifies to get a prerequisites |
11278 | 11278 | if ($last_item_not_dir_type == 'quiz') { |
11279 | 11279 | // if previous is quiz, mark its max score as default score to be achieved |
11280 | - $sql = "UPDATE $tbl_lp_item SET mastery_score = '$last_item_not_dir_max' |
|
11280 | + $sql = "update $tbl_lp_item SET mastery_score = '$last_item_not_dir_max' |
|
11281 | 11281 | WHERE c_id = ".$course_id." AND lp_id = '$lp_id' AND id = '$last_item_not_dir'"; |
11282 | 11282 | Database::query($sql); |
11283 | 11283 | } |
11284 | 11284 | // now simply update the prerequisite to set it to the last non-chapter item |
11285 | - $sql = "UPDATE $tbl_lp_item SET prerequisite = '$last_item_not_dir' |
|
11285 | + $sql = "update $tbl_lp_item SET prerequisite = '$last_item_not_dir' |
|
11286 | 11286 | WHERE c_id = ".$course_id." AND lp_id = '$lp_id' AND id = '$current_item_id'"; |
11287 | 11287 | Database::query($sql); |
11288 | 11288 | // record item as 'non-chapter' reference |
@@ -11548,7 +11548,7 @@ discard block |
||
11548 | 11548 | $courseId = api_get_course_int_id(); |
11549 | 11549 | $lp_table = Database::get_course_table(TABLE_LP_MAIN); |
11550 | 11550 | $lp_id = $this->get_id(); |
11551 | - $sql = "UPDATE $lp_table SET category_id = ".$this->categoryId." |
|
11551 | + $sql = "update $lp_table SET category_id = ".$this->categoryId." |
|
11552 | 11552 | WHERE c_id = $courseId AND id = $lp_id"; |
11553 | 11553 | Database::query($sql); |
11554 | 11554 | |
@@ -11579,7 +11579,7 @@ discard block |
||
11579 | 11579 | $this->subscribeUsers = (int) $value; |
11580 | 11580 | $lp_table = Database::get_course_table(TABLE_LP_MAIN); |
11581 | 11581 | $lp_id = $this->get_id(); |
11582 | - $sql = "UPDATE $lp_table SET subscribe_users = ".$this->subscribeUsers." |
|
11582 | + $sql = "update $lp_table SET subscribe_users = ".$this->subscribeUsers." |
|
11583 | 11583 | WHERE c_id = ".$this->course_int_id." AND id = $lp_id"; |
11584 | 11584 | Database::query($sql); |
11585 | 11585 | |
@@ -12154,7 +12154,7 @@ discard block |
||
12154 | 12154 | $this->accumulateScormTime = intval($value); |
12155 | 12155 | $lp_table = Database::get_course_table(TABLE_LP_MAIN); |
12156 | 12156 | $lp_id = $this->get_id(); |
12157 | - $sql = "UPDATE $lp_table |
|
12157 | + $sql = "update $lp_table |
|
12158 | 12158 | SET accumulate_scorm_time = ".$this->accumulateScormTime." |
12159 | 12159 | WHERE c_id = ".$this->course_int_id." AND id = $lp_id"; |
12160 | 12160 | Database::query($sql); |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | |
286 | 286 | /** |
287 | 287 | * @param $item |
288 | - * @param $ignore_score_color |
|
288 | + * @param boolean $ignore_score_color |
|
289 | 289 | * @return string |
290 | 290 | */ |
291 | 291 | private function build_average_column($item, $ignore_score_color) |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | |
307 | 307 | /** |
308 | 308 | * @param $item |
309 | - * @param $ignore_score_color |
|
309 | + * @param boolean $ignore_score_color |
|
310 | 310 | * @return string |
311 | 311 | */ |
312 | 312 | private function build_result_column($item, $ignore_score_color) |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | |
324 | 324 | /** |
325 | 325 | * @param $item |
326 | - * @param $ignore_score_color |
|
326 | + * @param boolean $ignore_score_color |
|
327 | 327 | * @return string |
328 | 328 | */ |
329 | 329 | private function build_mask_column($item, $ignore_score_color) |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | |
340 | 340 | /** |
341 | 341 | * @param $coursecode |
342 | - * @return mixed |
|
342 | + * @return string |
|
343 | 343 | */ |
344 | 344 | private function get_course_name_from_code_cached($coursecode) |
345 | 345 | { |
@@ -18,7 +18,7 @@ |
||
18 | 18 | * |
19 | 19 | * @param string $token |
20 | 20 | * |
21 | - * @return UserInterface |
|
21 | + * @return \FOS\UserBundle\Model\UserInterface|null |
|
22 | 22 | */ |
23 | 23 | public function findUserByConfirmationToken($token) |
24 | 24 | { |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | * provides a side connection to a vchamilo database |
185 | 185 | * @param array $_configuration |
186 | 186 | * |
187 | - * @return \Doctrine\DBAL\Driver\Connection |
|
187 | + * @return string |
|
188 | 188 | */ |
189 | 189 | public static function bootConnection(&$_configuration) |
190 | 190 | { |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | |
373 | 373 | /** |
374 | 374 | * get a proper SQLdump command |
375 | - * @param object $vchamilodata the complete new host information |
|
375 | + * @param stdClass $vchamilodata the complete new host information |
|
376 | 376 | * @return string the shell command |
377 | 377 | */ |
378 | 378 | public static function getDatabaseDumpCmd($vchamilodata) |
@@ -456,8 +456,8 @@ discard block |
||
456 | 456 | |
457 | 457 | /** |
458 | 458 | * Backups a database for having a snapshot. |
459 | - * @param $vchamilo object The Vchamilo object. |
|
460 | - * @param $outputfilerad string The output SQL file radical. |
|
459 | + * @param stdClass $vchamilo object The Vchamilo object. |
|
460 | + * @param string $outputfilerad string The output SQL file radical. |
|
461 | 461 | * @return bool If TRUE, dumping database was a success, otherwise FALSE. |
462 | 462 | */ |
463 | 463 | public static function backupDatabase($vchamilo, $outputfilerad) |
@@ -619,6 +619,8 @@ discard block |
||
619 | 619 | * this function set will map standard moodle API calls to chamilo |
620 | 620 | * internal primitives. This avoids too many changes to do in imported |
621 | 621 | * code |
622 | + * @param string $module |
|
623 | + * @param string $key |
|
622 | 624 | */ |
623 | 625 | public static function getConfig($module, $key, $isplugin = true) |
624 | 626 | { |
@@ -698,7 +700,7 @@ discard block |
||
698 | 700 | /** |
699 | 701 | * @param string $path |
700 | 702 | * |
701 | - * @return mixed |
|
703 | + * @return string |
|
702 | 704 | */ |
703 | 705 | public static function chopLastSlash($path) |
704 | 706 | { |
@@ -852,7 +854,7 @@ discard block |
||
852 | 854 | |
853 | 855 | /** |
854 | 856 | * @param object $instance |
855 | - * @return bool|\Doctrine\DBAL\Connection |
|
857 | + * @return Doctrine\ORM\EntityManagerInterface |
|
856 | 858 | */ |
857 | 859 | public static function getConnectionFromInstance($instance, $getManager = false) |
858 | 860 | { |
@@ -1297,7 +1299,7 @@ discard block |
||
1297 | 1299 | /** |
1298 | 1300 | * @param stdClass $instance |
1299 | 1301 | * |
1300 | - * @return bool|string returns the original version of the app |
|
1302 | + * @return string|false returns the original version of the app |
|
1301 | 1303 | */ |
1302 | 1304 | public static function canBeUpgraded($instance) |
1303 | 1305 | { |
@@ -186,11 +186,11 @@ discard block |
||
186 | 186 | } |
187 | 187 | |
188 | 188 | /** |
189 | - * provides a side connection to a vchamilo database |
|
190 | - * @param array $_configuration |
|
189 | + * provides a side connection to a vchamilo database |
|
190 | + * @param array $_configuration |
|
191 | 191 | * |
192 | - * @return \Doctrine\DBAL\Driver\Connection |
|
193 | - */ |
|
192 | + * @return \Doctrine\DBAL\Driver\Connection |
|
193 | + */ |
|
194 | 194 | public static function bootConnection(&$_configuration) |
195 | 195 | { |
196 | 196 | $dbParams = array( |
@@ -298,10 +298,10 @@ discard block |
||
298 | 298 | } |
299 | 299 | |
300 | 300 | /** |
301 | - * drop a vchamilo instance databases using the physical connection |
|
302 | - * @param stdClass $params |
|
303 | - * return an array of errors or false if ok |
|
304 | - */ |
|
301 | + * drop a vchamilo instance databases using the physical connection |
|
302 | + * @param stdClass $params |
|
303 | + * return an array of errors or false if ok |
|
304 | + */ |
|
305 | 305 | public static function dropDatabase($params) |
306 | 306 | { |
307 | 307 | $params = clone $params; |
@@ -376,10 +376,10 @@ discard block |
||
376 | 376 | } |
377 | 377 | |
378 | 378 | /** |
379 | - * get a proper SQLdump command |
|
380 | - * @param object $vchamilodata the complete new host information |
|
381 | - * @return string the shell command |
|
382 | - */ |
|
379 | + * get a proper SQLdump command |
|
380 | + * @param object $vchamilodata the complete new host information |
|
381 | + * @return string the shell command |
|
382 | + */ |
|
383 | 383 | public static function getDatabaseDumpCmd($vchamilodata) |
384 | 384 | { |
385 | 385 | $pgm = self::getConfig('vchamilo', 'mysql_cmd'); |
@@ -536,8 +536,8 @@ discard block |
||
536 | 536 | } |
537 | 537 | |
538 | 538 | /** |
539 | - * read manifest values in vchamilo template. |
|
540 | - */ |
|
539 | + * read manifest values in vchamilo template. |
|
540 | + */ |
|
541 | 541 | public static function getVmanifest($version) |
542 | 542 | { |
543 | 543 | $templatewwwroot = ''; |
@@ -558,8 +558,8 @@ discard block |
||
558 | 558 | } |
559 | 559 | |
560 | 560 | /** |
561 | - * make a fake vchamilo that represents the current host |
|
562 | - */ |
|
561 | + * make a fake vchamilo that represents the current host |
|
562 | + */ |
|
563 | 563 | public static function makeThis() |
564 | 564 | { |
565 | 565 | global $_configuration; |
@@ -623,10 +623,10 @@ discard block |
||
623 | 623 | } |
624 | 624 | |
625 | 625 | /** |
626 | - * this function set will map standard moodle API calls to chamilo |
|
627 | - * internal primitives. This avoids too many changes to do in imported |
|
628 | - * code |
|
629 | - */ |
|
626 | + * this function set will map standard moodle API calls to chamilo |
|
627 | + * internal primitives. This avoids too many changes to do in imported |
|
628 | + * code |
|
629 | + */ |
|
630 | 630 | public static function getConfig($module, $key, $isplugin = true) |
631 | 631 | { |
632 | 632 | if ($isplugin) { |
@@ -173,7 +173,8 @@ |
||
173 | 173 | $_configuration['vchamilo_web_root'] = "{$protocol}://".@$_SERVER['HTTP_HOST'].$contentPrefix; |
174 | 174 | |
175 | 175 | $_configuration['vchamilo_name'] = @$_SERVER['HTTP_HOST']; |
176 | - if (empty($_configuration['vchamilo_name'])) { // try again with another source if has failed |
|
176 | + if (empty($_configuration['vchamilo_name'])) { |
|
177 | +// try again with another source if has failed |
|
177 | 178 | $_configuration['vchamilo_name'] = "{$protocol}://".$_SERVER['SERVER_NAME']; |
178 | 179 | if ($_SERVER['SERVER_PORT'] != 80) { |
179 | 180 | $_configuration['vchamilo_name'] .= ':'.$_SERVER['SERVER_PORT']; |
@@ -667,7 +667,7 @@ discard block |
||
667 | 667 | |
668 | 668 | // get the protocol free hostname |
669 | 669 | Display::addFlash( |
670 | - Display::return_message("Copying {$templateDir}/data/courses => $coursePath") |
|
670 | + Display::return_message("copying {$templateDir}/data/courses => $coursePath") |
|
671 | 671 | ); |
672 | 672 | |
673 | 673 | copyDirTo( |
@@ -677,7 +677,7 @@ discard block |
||
677 | 677 | ); |
678 | 678 | |
679 | 679 | Display::addFlash( |
680 | - Display::return_message("Copying {$templateDir}/data/archive => $archivePath") |
|
680 | + Display::return_message("copying {$templateDir}/data/archive => $archivePath") |
|
681 | 681 | ); |
682 | 682 | |
683 | 683 | copyDirTo( |
@@ -687,7 +687,7 @@ discard block |
||
687 | 687 | ); |
688 | 688 | |
689 | 689 | Display::addFlash( |
690 | - Display::return_message("Copying {$templateDir}/data/home => $homePath") |
|
690 | + Display::return_message("copying {$templateDir}/data/home => $homePath") |
|
691 | 691 | ); |
692 | 692 | |
693 | 693 | copyDirTo( |
@@ -698,7 +698,7 @@ discard block |
||
698 | 698 | |
699 | 699 | // Upload |
700 | 700 | Display::addFlash( |
701 | - Display::return_message("Copying {$templateDir}/data/upload => $uploadPath") |
|
701 | + Display::return_message("copying {$templateDir}/data/upload => $uploadPath") |
|
702 | 702 | ); |
703 | 703 | |
704 | 704 | copyDirTo( |
@@ -1029,13 +1029,13 @@ discard block |
||
1029 | 1029 | $sitename = Database::escape_string($data->sitename); |
1030 | 1030 | $institution = Database::escape_string($data->institution); |
1031 | 1031 | |
1032 | - $sqls[] = "UPDATE {$settingstable} SET selected_value = '{$sitename}' |
|
1032 | + $sqls[] = "update {$settingstable} SET selected_value = '{$sitename}' |
|
1033 | 1033 | WHERE variable = 'siteName' AND category = 'Platform' "; |
1034 | 1034 | |
1035 | - $sqls[] = "UPDATE {$settingstable} SET selected_value = '{$institution}' |
|
1035 | + $sqls[] = "update {$settingstable} SET selected_value = '{$institution}' |
|
1036 | 1036 | WHERE variable = 'institution' AND category = 'Platform' "; |
1037 | 1037 | |
1038 | - $sqls[] = "UPDATE {$accessurltable} SET url = '{$data->root_web}' WHERE id = '1' "; |
|
1038 | + $sqls[] = "update {$accessurltable} SET url = '{$data->root_web}' WHERE id = '1' "; |
|
1039 | 1039 | |
1040 | 1040 | foreach ($sqls as $sql) { |
1041 | 1041 | Database::query($sql); |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | |
44 | 44 | /** |
45 | 45 | * Install the plugin |
46 | - * @return void |
|
46 | + * @return boolean |
|
47 | 47 | */ |
48 | 48 | public function install() |
49 | 49 | { |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | |
53 | 53 | /** |
54 | 54 | * Uninstall the plugin |
55 | - * @return void |
|
55 | + * @return boolean |
|
56 | 56 | */ |
57 | 57 | public function uninstall() |
58 | 58 | { |
@@ -75,7 +75,7 @@ |
||
75 | 75 | * |
76 | 76 | * @param int $resourceId |
77 | 77 | * @param int $type |
78 | - * @return boolean |
|
78 | + * @return boolean|null |
|
79 | 79 | */ |
80 | 80 | public function deleteResource($resourceId, $type) |
81 | 81 | { |
@@ -71,6 +71,8 @@ discard block |
||
71 | 71 | |
72 | 72 | /** |
73 | 73 | * @inheritdoc |
74 | + * @param string $toolbar |
|
75 | + * @param string $prefix |
|
74 | 76 | */ |
75 | 77 | public function __construct( |
76 | 78 | $toolbar = null, |
@@ -253,7 +255,7 @@ discard block |
||
253 | 255 | } |
254 | 256 | |
255 | 257 | /** |
256 | - * @return array |
|
258 | + * @return string[] |
|
257 | 259 | */ |
258 | 260 | public function getNewPageBlock() |
259 | 261 | { |
@@ -11,7 +11,7 @@ |
||
11 | 11 | |
12 | 12 | // When creating a new course this settings are added to the course |
13 | 13 | public $course_settings = array( |
14 | - array( |
|
14 | + array( |
|
15 | 15 | 'name' => 'course_block_pre_footer', |
16 | 16 | 'type' => 'textarea' |
17 | 17 | ), |