@@ -65,6 +65,9 @@ |
||
| 65 | 65 | |
| 66 | 66 | /* FUNCTIONS */ |
| 67 | 67 | |
| 68 | +/** |
|
| 69 | + * @param string $name |
|
| 70 | + */ |
|
| 68 | 71 | function make_select_session_list($name, $sessions, $attr = array()) |
| 69 | 72 | { |
| 70 | 73 | |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | |
| 86 | 86 | function display_form() |
| 87 | 87 | { |
| 88 | - $html = ''; |
|
| 88 | + $html = ''; |
|
| 89 | 89 | $sessions = SessionManager::get_sessions_list(array(), array('name', 'ASC')); |
| 90 | 90 | |
| 91 | 91 | // Link back to the documents overview |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | |
| 110 | 110 | //destination |
| 111 | 111 | $html .= '<div class="form-group">'; |
| 112 | - $html .= '<label class="col-sm-2 control-label">' . get_lang('DestinationCoursesFromSession') . ': </label>'; |
|
| 112 | + $html .= '<label class="col-sm-2 control-label">'.get_lang('DestinationCoursesFromSession').': </label>'; |
|
| 113 | 113 | $html .= '<div class="col-sm-5" id="ajax_sessions_list_destination">'; |
| 114 | 114 | $html .= '<select class="form-control" name="sessions_list_destination" onchange="javascript: xajax_search_courses(this.value,\'destination\');">'; |
| 115 | 115 | $html .= '<option value = "0">'.get_lang('ThereIsNotStillASession').'</option></select ></div>'; |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | $html .= '<button class="btn btn-success" type="submit" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES))."'".')) return false;"><em class="fa fa-files-o"></em> '.get_lang('CopyCourse').'</button>'; |
| 132 | 132 | |
| 133 | 133 | // Add Security token |
| 134 | - $html .= '<input type="hidden" value="' . Security::get_token() . '" name="sec_token">'; |
|
| 134 | + $html .= '<input type="hidden" value="'.Security::get_token().'" name="sec_token">'; |
|
| 135 | 135 | $html .= '</div></div>'; |
| 136 | 136 | $html .= '</form>'; |
| 137 | 137 | |
@@ -187,6 +187,7 @@ discard block |
||
| 187 | 187 | * Build the prefilter form. |
| 188 | 188 | * |
| 189 | 189 | * This type allow filter all other multiple select terms by one term in a dinamic way |
| 190 | + * @param string $prefilter_prefix |
|
| 190 | 191 | */ |
| 191 | 192 | function search_widget_prefilter_form($action, $show_thesaurus, $sf_terms, $op, $prefilter_prefix=NULL) { |
| 192 | 193 | $thesaurus_icon = Display::return_icon('thesaurus.gif', get_lang('SearchAdvancedOptions'), array('id'=>'thesaurus-icon')); |
@@ -277,6 +278,8 @@ discard block |
||
| 277 | 278 | |
| 278 | 279 | /** |
| 279 | 280 | * Show search form |
| 281 | + * @param string $action |
|
| 282 | + * @param boolean $show_thesaurus |
|
| 280 | 283 | */ |
| 281 | 284 | function display_search_form($action, $show_thesaurus, $sf_terms, $op) { |
| 282 | 285 | $type = (!empty($_REQUEST['type'])? htmlentities($_REQUEST['type']): 'normal'); |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | - * @return array |
|
| 35 | + * @return string[] |
|
| 36 | 36 | */ |
| 37 | 37 | public static function toolList() |
| 38 | 38 | { |
@@ -290,7 +290,6 @@ discard block |
||
| 290 | 290 | * 'page_nr' = The page to display |
| 291 | 291 | * 'hide_navigation' = true to hide the navigation |
| 292 | 292 | * @param array $query_vars Additional variables to add in the query-string |
| 293 | - * @param array $form actions Additional variables to add in the query-string |
|
| 294 | 293 | * @param mixed An array with bool values to know which columns show. |
| 295 | 294 | * i.e: $visibility_options= array(true, false) we will only show the first column |
| 296 | 295 | * Can be also only a bool value. TRUE: show all columns, FALSE: show nothing |
@@ -331,7 +330,6 @@ discard block |
||
| 331 | 330 | * 'page_nr' = The page to display |
| 332 | 331 | * 'hide_navigation' = true to hide the navigation |
| 333 | 332 | * @param array $query_vars Additional variables to add in the query-string |
| 334 | - * @param array $form actions Additional variables to add in the query-string |
|
| 335 | 333 | * @param mixed An array with bool values to know which columns show. i.e: |
| 336 | 334 | * $visibility_options= array(true, false) we will only show the first column |
| 337 | 335 | * Can be also only a bool value. TRUE: show all columns, FALSE: show nothing |
@@ -388,10 +386,11 @@ discard block |
||
| 388 | 386 | * 'per_page' = number of items to show per page |
| 389 | 387 | * 'page_nr' = The page to display |
| 390 | 388 | * @param array $query_vars Additional variables to add in the query-string |
| 391 | - * @param array $column_show Array of binaries 1= show columns 0. hide a column |
|
| 389 | + * @param integer[] $column_show Array of binaries 1= show columns 0. hide a column |
|
| 392 | 390 | * @param array $column_order An array of integers that let us decide how the columns are going to be sort. |
| 393 | 391 | * i.e: $column_order=array('1''4','3','4'); The 2nd column will be order like the 4th column |
| 394 | 392 | * @param array $form_actions Set optional forms actions |
| 393 | + * @param string $table_name |
|
| 395 | 394 | * |
| 396 | 395 | * @author Julio Montoya |
| 397 | 396 | */ |
@@ -444,7 +443,7 @@ discard block |
||
| 444 | 443 | * @param bool $filter (true) or not (false) |
| 445 | 444 | * @param bool $returnValue |
| 446 | 445 | * |
| 447 | - * @return void |
|
| 446 | + * @return string|null |
|
| 448 | 447 | */ |
| 449 | 448 | public static function display_normal_message($message, $filter = true, $returnValue = false) |
| 450 | 449 | { |
@@ -474,7 +473,7 @@ discard block |
||
| 474 | 473 | /** |
| 475 | 474 | * Displays an confirmation message. Use this if something has been done successfully |
| 476 | 475 | * @param bool Filter (true) or not (false) |
| 477 | - * @return void |
|
| 476 | + * @return string|null |
|
| 478 | 477 | */ |
| 479 | 478 | public static function display_confirmation_message ($message, $filter = true, $returnValue = false) |
| 480 | 479 | { |
@@ -491,7 +490,7 @@ discard block |
||
| 491 | 490 | * @param string $message - include any additional html |
| 492 | 491 | * tags if you need them |
| 493 | 492 | * @param bool Filter (true) or not (false) |
| 494 | - * @return void |
|
| 493 | + * @return string|null |
|
| 495 | 494 | */ |
| 496 | 495 | public static function display_error_message ($message, $filter = true, $returnValue = false) |
| 497 | 496 | { |
@@ -681,6 +680,7 @@ discard block |
||
| 681 | 680 | * @param string The alt text (probably a language variable) |
| 682 | 681 | * @param array additional attributes (for instance height, width, onclick, ...) |
| 683 | 682 | * @param integer The wanted width of the icon (to be looked for in the corresponding img/icons/ folder) |
| 683 | + * @param string $image |
|
| 684 | 684 | * @return void |
| 685 | 685 | */ |
| 686 | 686 | public static function display_icon( |
@@ -886,6 +886,7 @@ discard block |
||
| 886 | 886 | /** |
| 887 | 887 | * Displays an HTML input tag |
| 888 | 888 | * |
| 889 | + * @param string $type |
|
| 889 | 890 | */ |
| 890 | 891 | public static function input($type, $name, $value, $attributes = array()) |
| 891 | 892 | { |
@@ -902,8 +903,8 @@ discard block |
||
| 902 | 903 | } |
| 903 | 904 | |
| 904 | 905 | /** |
| 905 | - * @param $name |
|
| 906 | - * @param $value |
|
| 906 | + * @param string $name |
|
| 907 | + * @param string $value |
|
| 907 | 908 | * @param array $attributes |
| 908 | 909 | * @return string |
| 909 | 910 | */ |
@@ -918,6 +919,7 @@ discard block |
||
| 918 | 919 | /** |
| 919 | 920 | * Displays an HTML select tag |
| 920 | 921 | * |
| 922 | + * @param string $blank_item_text |
|
| 921 | 923 | */ |
| 922 | 924 | public static function select( |
| 923 | 925 | $name, |
@@ -984,8 +986,8 @@ discard block |
||
| 984 | 986 | $( "#tabs" ).tabs(); |
| 985 | 987 | }); |
| 986 | 988 | </script> |
| 987 | - * @param array $headers list of the tab titles |
|
| 988 | - * @param array $items |
|
| 989 | + * @param string[] $headers list of the tab titles |
|
| 990 | + * @param string[] $items |
|
| 989 | 991 | * @param string $id id of the container of the tab in the example "tabs" |
| 990 | 992 | * @param array $attributes for the ul |
| 991 | 993 | * @param array $ul_attributes |
@@ -1039,7 +1041,7 @@ discard block |
||
| 1039 | 1041 | |
| 1040 | 1042 | /** |
| 1041 | 1043 | * @param $headers |
| 1042 | - * @param null $selected |
|
| 1044 | + * @param integer $selected |
|
| 1043 | 1045 | * |
| 1044 | 1046 | * @return string |
| 1045 | 1047 | */ |
@@ -1077,6 +1079,7 @@ discard block |
||
| 1077 | 1079 | * As you can see both function use the same "my_grid_name" this is very important otherwise nothing will work |
| 1078 | 1080 | * |
| 1079 | 1081 | * @param string the div id, this value must be the same with the first parameter of Display::grid_js() |
| 1082 | + * @param string $div_id |
|
| 1080 | 1083 | * @return string html |
| 1081 | 1084 | * |
| 1082 | 1085 | */ |
@@ -1632,6 +1635,8 @@ discard block |
||
| 1632 | 1635 | * @param string url that will be added (for jquery see hot_courses.tpl) |
| 1633 | 1636 | * @param string point info array see function CourseManager::get_course_ranking() |
| 1634 | 1637 | * @param bool add a div wrapper |
| 1638 | + * @param string $id |
|
| 1639 | + * @param string $url |
|
| 1635 | 1640 | * @todo use templates |
| 1636 | 1641 | **/ |
| 1637 | 1642 | public static function return_rating_system($id, $url, $point_info = array(), $add_div_wrapper = true) |
@@ -1727,6 +1732,9 @@ discard block |
||
| 1727 | 1732 | return '<'.$size.'>'.Security::remove_XSS($title).'</'.$size.'>'; |
| 1728 | 1733 | } |
| 1729 | 1734 | |
| 1735 | + /** |
|
| 1736 | + * @param string $title |
|
| 1737 | + */ |
|
| 1730 | 1738 | public static function page_subheader2($title, $second_title = null) |
| 1731 | 1739 | { |
| 1732 | 1740 | return self::page_header($title, $second_title, 'h4'); |
@@ -1957,6 +1965,7 @@ discard block |
||
| 1957 | 1965 | |
| 1958 | 1966 | /** |
| 1959 | 1967 | * @todo use twig |
| 1968 | + * @param string $title |
|
| 1960 | 1969 | */ |
| 1961 | 1970 | public static function group_button($title, $elements) |
| 1962 | 1971 | { |
@@ -2174,9 +2183,9 @@ discard block |
||
| 2174 | 2183 | |
| 2175 | 2184 | /** |
| 2176 | 2185 | * @param int $id |
| 2177 | - * @param array $content |
|
| 2186 | + * @param string[] $content |
|
| 2178 | 2187 | * @param int $col |
| 2179 | - * @param bool|true $right |
|
| 2188 | + * @param boolean $right |
|
| 2180 | 2189 | * @return string |
| 2181 | 2190 | */ |
| 2182 | 2191 | public static function toolbarAction($id, $content = array(), $col = 2, $right = true) |
@@ -2258,10 +2267,10 @@ discard block |
||
| 2258 | 2267 | /** |
| 2259 | 2268 | * @param string $title |
| 2260 | 2269 | * @param string $content |
| 2261 | - * @param null $id |
|
| 2270 | + * @param string $id |
|
| 2262 | 2271 | * @param array $params |
| 2263 | - * @param null $idAccordion |
|
| 2264 | - * @param null $idCollapse |
|
| 2272 | + * @param string $idAccordion |
|
| 2273 | + * @param string $idCollapse |
|
| 2265 | 2274 | * @param bool|true $open |
| 2266 | 2275 | * @param bool|false $fullClickable |
| 2267 | 2276 | * @return null|string |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | * @param string $canHaveCourses |
| 104 | 104 | * @param int $parent_id |
| 105 | 105 | * |
| 106 | - * @return bool |
|
| 106 | + * @return false|string |
|
| 107 | 107 | */ |
| 108 | 108 | public static function addNode($code, $name, $canHaveCourses, $parent_id) |
| 109 | 109 | { |
@@ -297,8 +297,7 @@ discard block |
||
| 297 | 297 | /** |
| 298 | 298 | * Counts the number of children categories a category has |
| 299 | 299 | * @param int $categoryId The ID of the category of which we want to count the children |
| 300 | - * @param int $count The number of subcategories we counted this far |
|
| 301 | - * @return mixed The number of subcategories this category has |
|
| 300 | + * @return integer The number of subcategories this category has |
|
| 302 | 301 | */ |
| 303 | 302 | public static function courseCategoryChildrenCount($categoryId) |
| 304 | 303 | { |
@@ -476,7 +475,7 @@ discard block |
||
| 476 | 475 | /** |
| 477 | 476 | * @param int $id |
| 478 | 477 | * |
| 479 | - * @return bool |
|
| 478 | + * @return boolean|null |
|
| 480 | 479 | */ |
| 481 | 480 | public static function addToUrl($id) |
| 482 | 481 | { |
@@ -958,7 +957,7 @@ discard block |
||
| 958 | 957 | * Get Pagination HTML div |
| 959 | 958 | * @param $pageCurrent |
| 960 | 959 | * @param $pageLength |
| 961 | - * @param $pageTotal |
|
| 960 | + * @param integer $pageTotal |
|
| 962 | 961 | * @return string |
| 963 | 962 | */ |
| 964 | 963 | public static function getCatalogPagination($pageCurrent, $pageLength, $pageTotal) |
@@ -353,7 +353,7 @@ discard block |
||
| 353 | 353 | } |
| 354 | 354 | |
| 355 | 355 | /** |
| 356 | - * @return int |
|
| 356 | + * @return string |
|
| 357 | 357 | */ |
| 358 | 358 | public function selectPassPercentage() |
| 359 | 359 | { |
@@ -462,7 +462,7 @@ discard block |
||
| 462 | 462 | * tells if questions are selected randomly, and if so returns the draws |
| 463 | 463 | * |
| 464 | 464 | * @author Olivier Brouckaert |
| 465 | - * @return integer - 0 if not random, otherwise the draws |
|
| 465 | + * @return boolean - 0 if not random, otherwise the draws |
|
| 466 | 466 | */ |
| 467 | 467 | public function isRandom() |
| 468 | 468 | { |
@@ -2830,7 +2830,7 @@ discard block |
||
| 2830 | 2830 | * @param int int lp id |
| 2831 | 2831 | * @param int int lp item id |
| 2832 | 2832 | * @param int int lp item_view id |
| 2833 | - * @param float $weight |
|
| 2833 | + * @param integer $weight |
|
| 2834 | 2834 | * @param array question list |
| 2835 | 2835 | */ |
| 2836 | 2836 | public function save_stat_track_exercise_info( |
@@ -5327,6 +5327,9 @@ discard block |
||
| 5327 | 5327 | } |
| 5328 | 5328 | } |
| 5329 | 5329 | |
| 5330 | + /** |
|
| 5331 | + * @param integer $exe_id |
|
| 5332 | + */ |
|
| 5330 | 5333 | function send_notification_for_oral_questions($question_list_answers, $origin, $exe_id) |
| 5331 | 5334 | { |
| 5332 | 5335 | if (api_get_course_setting('email_alert_manager_on_new_quiz') != 1 ) { |
@@ -5478,7 +5481,7 @@ discard block |
||
| 5478 | 5481 | * @param int Maximum number of attempts (0 if no limit) |
| 5479 | 5482 | * @param int Feedback type |
| 5480 | 5483 | * @todo this was function was added due the import exercise via CSV |
| 5481 | - * @return int New exercise ID |
|
| 5484 | + * @return string New exercise ID |
|
| 5482 | 5485 | */ |
| 5483 | 5486 | public function createExercise( |
| 5484 | 5487 | $title, |
@@ -6813,7 +6816,7 @@ discard block |
||
| 6813 | 6816 | * @param bool $show_comment |
| 6814 | 6817 | * @param null $exercise_feedback |
| 6815 | 6818 | * @param bool $show_answers |
| 6816 | - * @param null $modelType |
|
| 6819 | + * @param integer $modelType |
|
| 6817 | 6820 | * @param bool $categoryMinusOne |
| 6818 | 6821 | * @return bool|null|string |
| 6819 | 6822 | */ |
@@ -954,7 +954,7 @@ |
||
| 954 | 954 | /** |
| 955 | 955 | * This function has been created for avoiding changes directly within QuickForm class. |
| 956 | 956 | * When we use it, the element is threated as 'required' to be dealt during validation. |
| 957 | - * @param array $element The array of elements |
|
| 957 | + * @param array $elements The array of elements |
|
| 958 | 958 | * @param string $message The message displayed |
| 959 | 959 | */ |
| 960 | 960 | public function add_multiple_required_rule($elements, $message) |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | $renderer->setHeaderTemplate('<legend>{header}</legend>'); |
| 100 | 100 | |
| 101 | 101 | //Set required field template |
| 102 | - $this->setRequiredNote('<span class="form_required">*</span> <small>' . get_lang('ThisFieldIsRequired') . '</small>'); |
|
| 102 | + $this->setRequiredNote('<span class="form_required">*</span> <small>'.get_lang('ThisFieldIsRequired').'</small>'); |
|
| 103 | 103 | $noteTemplate = <<<EOT |
| 104 | 104 | <div class="form-group"> |
| 105 | 105 | <div class="col-sm-offset-2 col-sm-10">{requiredNote}</div> |
@@ -902,8 +902,8 @@ discard block |
||
| 902 | 902 | $this->with_progress_bar = true; |
| 903 | 903 | $id = $this->getAttribute('id'); |
| 904 | 904 | |
| 905 | - $this->updateAttributes("onsubmit=\"javascript: addProgress('" . $id . "')\""); |
|
| 906 | - $this->addHtml('<script src="' . api_get_path(WEB_LIBRARY_JS_PATH) . 'upload.js" type="text/javascript"></script>'); |
|
| 905 | + $this->updateAttributes("onsubmit=\"javascript: addProgress('".$id."')\""); |
|
| 906 | + $this->addHtml('<script src="'.api_get_path(WEB_LIBRARY_JS_PATH).'upload.js" type="text/javascript"></script>'); |
|
| 907 | 907 | } |
| 908 | 908 | |
| 909 | 909 | /** |
@@ -1402,7 +1402,7 @@ discard block |
||
| 1402 | 1402 | .prop('href', file.url); |
| 1403 | 1403 | $(data.context.children()[index]).parent().wrap(link); |
| 1404 | 1404 | |
| 1405 | - var successMessage = $('<div class=\"col-sm-3\">').html($('<span class=\"alert alert-success\"/>').text('" . addslashes(get_lang('UplUploadSucceeded')) . "')); |
|
| 1405 | + var successMessage = $('<div class=\"col-sm-3\">').html($('<span class=\"alert alert-success\"/>').text('" . addslashes(get_lang('UplUploadSucceeded'))."')); |
|
| 1406 | 1406 | $(data.context.children()[index]).parent().append(successMessage); |
| 1407 | 1407 | } else if (file.error) { |
| 1408 | 1408 | var error = $('<div class=\"col-sm-3\">').html($('<span class=\"alert alert-danger\"/>').text(file.error)); |
@@ -1411,7 +1411,7 @@ discard block |
||
| 1411 | 1411 | }); |
| 1412 | 1412 | }).on('fileuploadfail', function (e, data) { |
| 1413 | 1413 | $.each(data.files, function (index) { |
| 1414 | - var failedMessage = '" . addslashes(get_lang('UplUploadFailed')) . "'; |
|
| 1414 | + var failedMessage = '" . addslashes(get_lang('UplUploadFailed'))."'; |
|
| 1415 | 1415 | var error = $('<div class=\"col-sm-3\">').html($('<span class=\"alert alert-danger\"/>').text(failedMessage)); |
| 1416 | 1416 | $(data.context.children()[index]).parent().append(error); |
| 1417 | 1417 | }); |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | * This function saves a change in a wiki page |
| 259 | 259 | * @author Patrick Cool <[email protected]>, Ghent University |
| 260 | 260 | * @param array $values |
| 261 | - * @return language string saying that the changes are stored |
|
| 261 | + * @return string string saying that the changes are stored |
|
| 262 | 262 | **/ |
| 263 | 263 | public function save_wiki($values) |
| 264 | 264 | { |
@@ -1196,6 +1196,7 @@ discard block |
||
| 1196 | 1196 | * Checks if this navigation tab has to be set to active |
| 1197 | 1197 | * @author Patrick Cool <[email protected]>, Ghent University |
| 1198 | 1198 | * |
| 1199 | + * @param string $paramwk |
|
| 1199 | 1200 | * @return string html code |
| 1200 | 1201 | */ |
| 1201 | 1202 | public function is_active_navigation_tab($paramwk) |
@@ -1711,6 +1712,7 @@ discard block |
||
| 1711 | 1712 | |
| 1712 | 1713 | /** |
| 1713 | 1714 | * Sends pending e-mails |
| 1715 | + * @param string $type |
|
| 1714 | 1716 | */ |
| 1715 | 1717 | public function check_emailcue($id_or_ref, $type, $lastime='', $lastuser='') |
| 1716 | 1718 | { |
@@ -2011,6 +2013,7 @@ discard block |
||
| 2011 | 2013 | |
| 2012 | 2014 | /** |
| 2013 | 2015 | * Exports the wiki page to PDF |
| 2016 | + * @param string $course_code |
|
| 2014 | 2017 | */ |
| 2015 | 2018 | public function export_to_pdf($id, $course_code) |
| 2016 | 2019 | { |
@@ -2478,6 +2481,7 @@ discard block |
||
| 2478 | 2481 | /** |
| 2479 | 2482 | * Draws an HTML form select with the given options |
| 2480 | 2483 | * |
| 2484 | + * @param string $name |
|
| 2481 | 2485 | */ |
| 2482 | 2486 | public function make_select($name,$values,$checked='') |
| 2483 | 2487 | { |
@@ -2514,7 +2518,7 @@ discard block |
||
| 2514 | 2518 | /** |
| 2515 | 2519 | * Get wiki information |
| 2516 | 2520 | * @param int|bool wiki id |
| 2517 | - * @return array wiki data |
|
| 2521 | + * @return string wiki data |
|
| 2518 | 2522 | */ |
| 2519 | 2523 | public function getWikiDataFromDb($id) |
| 2520 | 2524 | { |
@@ -2561,6 +2565,7 @@ discard block |
||
| 2561 | 2565 | * Get wiki information |
| 2562 | 2566 | * @param string wiki id |
| 2563 | 2567 | * @param int $courseId |
| 2568 | + * @param string $title |
|
| 2564 | 2569 | * @return array wiki data |
| 2565 | 2570 | */ |
| 2566 | 2571 | public function getPageByTitle($title, $courseId = null) |
@@ -2593,6 +2598,8 @@ discard block |
||
| 2593 | 2598 | * @param int $courseId |
| 2594 | 2599 | * @param string |
| 2595 | 2600 | * @param string |
| 2601 | + * @param string $groupfilter |
|
| 2602 | + * @param string $condition_session |
|
| 2596 | 2603 | * @return bool |
| 2597 | 2604 | */ |
| 2598 | 2605 | public function deletePage($title, $courseId, $groupfilter = null, $condition_session = null) |
@@ -3644,6 +3651,7 @@ discard block |
||
| 3644 | 3651 | |
| 3645 | 3652 | /** |
| 3646 | 3653 | * Show all pages |
| 3654 | + * @param string $action |
|
| 3647 | 3655 | */ |
| 3648 | 3656 | public function allPages($action) |
| 3649 | 3657 | { |
@@ -4200,7 +4208,7 @@ discard block |
||
| 4200 | 4208 | |
| 4201 | 4209 | /** |
| 4202 | 4210 | * Restore page |
| 4203 | - * @return bool |
|
| 4211 | + * @return false|null |
|
| 4204 | 4212 | */ |
| 4205 | 4213 | public function restorePage() |
| 4206 | 4214 | { |
@@ -4302,7 +4310,7 @@ discard block |
||
| 4302 | 4310 | } |
| 4303 | 4311 | |
| 4304 | 4312 | /** |
| 4305 | - * @param int|bool $wikiId |
|
| 4313 | + * @param false|string $wikiId |
|
| 4306 | 4314 | */ |
| 4307 | 4315 | public function setWikiData($wikiId) |
| 4308 | 4316 | { |
@@ -1415,7 +1415,7 @@ discard block |
||
| 1415 | 1415 | |
| 1416 | 1416 | /** |
| 1417 | 1417 | * Get the emoji list to include in chat |
| 1418 | - * @return array |
|
| 1418 | + * @return string[] |
|
| 1419 | 1419 | */ |
| 1420 | 1420 | public static function getEmojisToInclude() |
| 1421 | 1421 | { |
@@ -1738,7 +1738,7 @@ discard block |
||
| 1738 | 1738 | |
| 1739 | 1739 | /** |
| 1740 | 1740 | * Get the number of users connected in chat |
| 1741 | - * @return mixed |
|
| 1741 | + * @return integer |
|
| 1742 | 1742 | */ |
| 1743 | 1743 | public function countUsersOnline() |
| 1744 | 1744 | { |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | return ''; |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | - Emojione\Emojione::$imagePathPNG = api_get_path(WEB_PUBLIC_PATH) . 'bundles/chamilocore/js/emojione/png/'; |
|
| 70 | + Emojione\Emojione::$imagePathPNG = api_get_path(WEB_PUBLIC_PATH).'bundles/chamilocore/js/emojione/png/'; |
|
| 71 | 71 | Emojione\Emojione::$ascii = true; |
| 72 | 72 | |
| 73 | 73 | $message = trim($message); |
@@ -113,15 +113,15 @@ discard block |
||
| 113 | 113 | $user = $em->find('ChamiloUserBundle:User', $this->userId); |
| 114 | 114 | $courseInfo = api_get_course_info_by_id($this->courseId); |
| 115 | 115 | $isMaster = (bool) api_is_course_admin(); |
| 116 | - $document_path = api_get_path(SYS_COURSE_PATH) . $courseInfo['path'] . '/document'; |
|
| 116 | + $document_path = api_get_path(SYS_COURSE_PATH).$courseInfo['path'].'/document'; |
|
| 117 | 117 | $basepath_chat = '/chat_files'; |
| 118 | 118 | |
| 119 | 119 | if (!$this->groupId) { |
| 120 | 120 | $group_info = GroupManager::get_group_properties($this->groupId); |
| 121 | - $basepath_chat = $group_info['directory'] . '/chat_files'; |
|
| 121 | + $basepath_chat = $group_info['directory'].'/chat_files'; |
|
| 122 | 122 | } |
| 123 | 123 | |
| 124 | - $chat_path = $document_path . $basepath_chat . '/'; |
|
| 124 | + $chat_path = $document_path.$basepath_chat.'/'; |
|
| 125 | 125 | |
| 126 | 126 | if (!is_dir($chat_path)) { |
| 127 | 127 | if (is_file($chat_path)) { |
@@ -131,25 +131,25 @@ discard block |
||
| 131 | 131 | |
| 132 | 132 | $date_now = date('Y-m-d'); |
| 133 | 133 | $timeNow = date('d/m/y H:i:s'); |
| 134 | - $basename_chat = 'messages-' . $date_now; |
|
| 134 | + $basename_chat = 'messages-'.$date_now; |
|
| 135 | 135 | |
| 136 | 136 | if ($this->groupId && !$friendId) { |
| 137 | - $basename_chat = 'messages-' . $date_now . '_gid-' . $this->groupId; |
|
| 137 | + $basename_chat = 'messages-'.$date_now.'_gid-'.$this->groupId; |
|
| 138 | 138 | } elseif ($this->sessionId && !$friendId) { |
| 139 | - $basename_chat = 'messages-' . $date_now . '_sid-' . $this->sessionId; |
|
| 139 | + $basename_chat = 'messages-'.$date_now.'_sid-'.$this->sessionId; |
|
| 140 | 140 | } elseif ($friendId) { |
| 141 | 141 | if ($this->userId < $friendId) { |
| 142 | - $basename_chat = 'messages-' . $date_now . '_uid-' . $this->userId . '-' . $friendId; |
|
| 142 | + $basename_chat = 'messages-'.$date_now.'_uid-'.$this->userId.'-'.$friendId; |
|
| 143 | 143 | } else { |
| 144 | - $basename_chat = 'messages-' . $date_now . '_uid-' . $friendId . '-' . $this->userId; |
|
| 144 | + $basename_chat = 'messages-'.$date_now.'_uid-'.$friendId.'-'.$this->userId; |
|
| 145 | 145 | } |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | $message = self::prepareMessage($message); |
| 149 | 149 | |
| 150 | - $fileTitle = $basename_chat . '.log.html'; |
|
| 151 | - $filePath = $basepath_chat . '/' . $fileTitle; |
|
| 152 | - $absoluteFilePath = $chat_path . $fileTitle; |
|
| 150 | + $fileTitle = $basename_chat.'.log.html'; |
|
| 151 | + $filePath = $basepath_chat.'/'.$fileTitle; |
|
| 152 | + $absoluteFilePath = $chat_path.$fileTitle; |
|
| 153 | 153 | |
| 154 | 154 | if (!file_exists($absoluteFilePath)) { |
| 155 | 155 | $doc_id = add_document($courseInfo, $filePath, 'file', 0, $fileTitle); |
@@ -182,23 +182,23 @@ discard block |
||
| 182 | 182 | $fileContent = ' |
| 183 | 183 | <div class="message-teacher"> |
| 184 | 184 | <div class="content-message"> |
| 185 | - <div class="chat-message-block-name">' . $user->getCompleteName() . '</div> |
|
| 186 | - <div class="chat-message-block-content">' . $message . '</div> |
|
| 187 | - <div class="message-date">' . $timeNow . '</div> |
|
| 185 | + <div class="chat-message-block-name">' . $user->getCompleteName().'</div> |
|
| 186 | + <div class="chat-message-block-content">' . $message.'</div> |
|
| 187 | + <div class="message-date">' . $timeNow.'</div> |
|
| 188 | 188 | </div> |
| 189 | 189 | <div class="icon-message"></div> |
| 190 | - <img class="chat-image" src="' . $userPhoto . '"> |
|
| 190 | + <img class="chat-image" src="' . $userPhoto.'"> |
|
| 191 | 191 | </div> |
| 192 | 192 | '; |
| 193 | 193 | } else { |
| 194 | 194 | $fileContent = ' |
| 195 | 195 | <div class="message-student"> |
| 196 | - <img class="chat-image" src="' . $userPhoto . '"> |
|
| 196 | + <img class="chat-image" src="' . $userPhoto.'"> |
|
| 197 | 197 | <div class="icon-message"></div> |
| 198 | 198 | <div class="content-message"> |
| 199 | - <div class="chat-message-block-name">' . $user->getCompleteName() . '</div> |
|
| 200 | - <div class="chat-message-block-content">' . $message . '</div> |
|
| 201 | - <div class="message-date">' . $timeNow . '</div> |
|
| 199 | + <div class="chat-message-block-name">' . $user->getCompleteName().'</div> |
|
| 200 | + <div class="chat-message-block-content">' . $message.'</div> |
|
| 201 | + <div class="message-date">' . $timeNow.'</div> |
|
| 202 | 202 | </div> |
| 203 | 203 | </div> |
| 204 | 204 | '; |
@@ -293,9 +293,9 @@ discard block |
||
| 293 | 293 | $extraCondition = null; |
| 294 | 294 | |
| 295 | 295 | if ($this->groupId) { |
| 296 | - $extraCondition = 'AND ccc.toGroupId = ' . intval($this->groupId); |
|
| 296 | + $extraCondition = 'AND ccc.toGroupId = '.intval($this->groupId); |
|
| 297 | 297 | } else { |
| 298 | - $extraCondition = 'AND ccc.sessionId = ' . intval($this->sessionId); |
|
| 298 | + $extraCondition = 'AND ccc.sessionId = '.intval($this->sessionId); |
|
| 299 | 299 | } |
| 300 | 300 | |
| 301 | 301 | $currentTime = new DateTime(api_get_utc_datetime(), new DateTimeZone('UTC')); |
@@ -1394,7 +1394,7 @@ discard block |
||
| 1394 | 1394 | { |
| 1395 | 1395 | return [ |
| 1396 | 1396 | ':bowtie:', |
| 1397 | - ':smile:'| |
|
| 1397 | + ':smile:' | |
|
| 1398 | 1398 | ':laughing:', |
| 1399 | 1399 | ':blush:', |
| 1400 | 1400 | ':smiley:', |
@@ -1467,17 +1467,17 @@ discard block |
||
| 1467 | 1467 | public function getFileName($absolute = false, $friendId = 0) |
| 1468 | 1468 | { |
| 1469 | 1469 | $date = date('Y-m-d'); |
| 1470 | - $base = 'messages-' . $date . '.log.html'; |
|
| 1470 | + $base = 'messages-'.$date.'.log.html'; |
|
| 1471 | 1471 | |
| 1472 | 1472 | if ($this->groupId && !$friendId) { |
| 1473 | - $base = 'messages-' . $date . '_gid-' . $this->groupId . '.log.html'; |
|
| 1473 | + $base = 'messages-'.$date.'_gid-'.$this->groupId.'.log.html'; |
|
| 1474 | 1474 | } elseif ($this->sessionId && !$friendId) { |
| 1475 | - $base = 'messages-' . $date . '_sid-' . $this->sessionId . '.log.html'; |
|
| 1475 | + $base = 'messages-'.$date.'_sid-'.$this->sessionId.'.log.html'; |
|
| 1476 | 1476 | } elseif ($friendId) { |
| 1477 | 1477 | if ($this->userId < $friendId) { |
| 1478 | - $base = 'messages-' . $date . '_uid-' . $this->userId . '-' . $friendId . '.log.html'; |
|
| 1478 | + $base = 'messages-'.$date.'_uid-'.$this->userId.'-'.$friendId.'.log.html'; |
|
| 1479 | 1479 | } else { |
| 1480 | - $base = 'messages-' . $date . '_uid-' . $friendId . '-' . $this->userId . '.log.html'; |
|
| 1480 | + $base = 'messages-'.$date.'_uid-'.$friendId.'-'.$this->userId.'.log.html'; |
|
| 1481 | 1481 | } |
| 1482 | 1482 | } |
| 1483 | 1483 | |
@@ -1486,16 +1486,16 @@ discard block |
||
| 1486 | 1486 | } |
| 1487 | 1487 | |
| 1488 | 1488 | $courseInfo = api_get_course_info_by_id($this->courseId); |
| 1489 | - $document_path = api_get_path(SYS_COURSE_PATH) . $courseInfo['path'] . '/document'; |
|
| 1489 | + $document_path = api_get_path(SYS_COURSE_PATH).$courseInfo['path'].'/document'; |
|
| 1490 | 1490 | |
| 1491 | - $chatPath = $document_path . '/chat_files/'; |
|
| 1491 | + $chatPath = $document_path.'/chat_files/'; |
|
| 1492 | 1492 | |
| 1493 | 1493 | if ($this->groupId) { |
| 1494 | 1494 | $group_info = GroupManager::get_group_properties($this->groupId); |
| 1495 | - $chatPath = $document_path . $group_info['directory'] . '/chat_files/'; |
|
| 1495 | + $chatPath = $document_path.$group_info['directory'].'/chat_files/'; |
|
| 1496 | 1496 | } |
| 1497 | 1497 | |
| 1498 | - return $chatPath . $base; |
|
| 1498 | + return $chatPath.$base; |
|
| 1499 | 1499 | } |
| 1500 | 1500 | |
| 1501 | 1501 | /** |
@@ -1508,16 +1508,16 @@ discard block |
||
| 1508 | 1508 | { |
| 1509 | 1509 | $courseInfo = api_get_course_info_by_id($this->courseId); |
| 1510 | 1510 | $date_now = date('Y-m-d'); |
| 1511 | - $isMaster = (bool)api_is_course_admin(); |
|
| 1511 | + $isMaster = (bool) api_is_course_admin(); |
|
| 1512 | 1512 | $basepath_chat = '/chat_files'; |
| 1513 | - $document_path = api_get_path(SYS_COURSE_PATH) . $courseInfo['path'] . '/document'; |
|
| 1513 | + $document_path = api_get_path(SYS_COURSE_PATH).$courseInfo['path'].'/document'; |
|
| 1514 | 1514 | |
| 1515 | 1515 | if ($this->groupId) { |
| 1516 | 1516 | $group_info = GroupManager:: get_group_properties($this->groupId); |
| 1517 | - $basepath_chat = $group_info['directory'] . '/chat_files'; |
|
| 1517 | + $basepath_chat = $group_info['directory'].'/chat_files'; |
|
| 1518 | 1518 | } |
| 1519 | 1519 | |
| 1520 | - $chat_path = $document_path . $basepath_chat . '/'; |
|
| 1520 | + $chat_path = $document_path.$basepath_chat.'/'; |
|
| 1521 | 1521 | |
| 1522 | 1522 | if (!is_dir($chat_path)) { |
| 1523 | 1523 | if (is_file($chat_path)) { |
@@ -1544,24 +1544,24 @@ discard block |
||
| 1544 | 1544 | } |
| 1545 | 1545 | } |
| 1546 | 1546 | |
| 1547 | - $filename_chat = 'messages-' . $date_now . '.log.html'; |
|
| 1547 | + $filename_chat = 'messages-'.$date_now.'.log.html'; |
|
| 1548 | 1548 | |
| 1549 | 1549 | if ($this->groupId && !$friendId) { |
| 1550 | - $filename_chat = 'messages-' . $date_now . '_gid-' . $this->groupId . '.log.html'; |
|
| 1550 | + $filename_chat = 'messages-'.$date_now.'_gid-'.$this->groupId.'.log.html'; |
|
| 1551 | 1551 | } else if ($this->sessionId && !$friendId) { |
| 1552 | - $filename_chat = 'messages-' . $date_now . '_sid-' . $this->sessionId . '.log.html'; |
|
| 1552 | + $filename_chat = 'messages-'.$date_now.'_sid-'.$this->sessionId.'.log.html'; |
|
| 1553 | 1553 | } elseif ($friendId) { |
| 1554 | 1554 | if ($this->userId < $friendId) { |
| 1555 | - $filename_chat = 'messages-' . $date_now . '_uid-' . $this->userId . '-' . $friendId . '.log.html'; |
|
| 1555 | + $filename_chat = 'messages-'.$date_now.'_uid-'.$this->userId.'-'.$friendId.'.log.html'; |
|
| 1556 | 1556 | } else { |
| 1557 | - $filename_chat = 'messages-' . $date_now . '_uid-' . $friendId . '-' . $this->userId . '.log.html'; |
|
| 1557 | + $filename_chat = 'messages-'.$date_now.'_uid-'.$friendId.'-'.$this->userId.'.log.html'; |
|
| 1558 | 1558 | } |
| 1559 | 1559 | } |
| 1560 | 1560 | |
| 1561 | - if (!file_exists($chat_path . $filename_chat)) { |
|
| 1562 | - @fclose(fopen($chat_path . $filename_chat, 'w')); |
|
| 1561 | + if (!file_exists($chat_path.$filename_chat)) { |
|
| 1562 | + @fclose(fopen($chat_path.$filename_chat, 'w')); |
|
| 1563 | 1563 | if (!api_is_anonymous()) { |
| 1564 | - $doc_id = add_document($courseInfo, $basepath_chat . '/' . $filename_chat, 'file', 0, $filename_chat); |
|
| 1564 | + $doc_id = add_document($courseInfo, $basepath_chat.'/'.$filename_chat, 'file', 0, $filename_chat); |
|
| 1565 | 1565 | api_item_property_update( |
| 1566 | 1566 | $courseInfo, |
| 1567 | 1567 | TOOL_DOCUMENT, |
@@ -1590,17 +1590,17 @@ discard block |
||
| 1590 | 1590 | } |
| 1591 | 1591 | } |
| 1592 | 1592 | |
| 1593 | - $basename_chat = 'messages-' . $date_now; |
|
| 1593 | + $basename_chat = 'messages-'.$date_now; |
|
| 1594 | 1594 | |
| 1595 | 1595 | if ($this->groupId && !$friendId) { |
| 1596 | - $basename_chat = 'messages-' . $date_now . '_gid-' . $this->groupId; |
|
| 1596 | + $basename_chat = 'messages-'.$date_now.'_gid-'.$this->groupId; |
|
| 1597 | 1597 | } else if ($this->sessionId && !$friendId) { |
| 1598 | - $basename_chat = 'messages-' . $date_now . '_sid-' . $this->sessionId; |
|
| 1598 | + $basename_chat = 'messages-'.$date_now.'_sid-'.$this->sessionId; |
|
| 1599 | 1599 | } elseif ($friendId) { |
| 1600 | 1600 | if ($this->userId < $friendId) { |
| 1601 | - $basename_chat = 'messages-' . $date_now . '_uid-' . $this->userId . '-' . $friendId; |
|
| 1601 | + $basename_chat = 'messages-'.$date_now.'_uid-'.$this->userId.'-'.$friendId; |
|
| 1602 | 1602 | } else { |
| 1603 | - $basename_chat = 'messages-' . $date_now . '_uid-' . $friendId . '-' . $this->userId; |
|
| 1603 | + $basename_chat = 'messages-'.$date_now.'_uid-'.$friendId.'-'.$this->userId; |
|
| 1604 | 1604 | } |
| 1605 | 1605 | } |
| 1606 | 1606 | |
@@ -1608,19 +1608,19 @@ discard block |
||
| 1608 | 1608 | |
| 1609 | 1609 | $i = 1; |
| 1610 | 1610 | |
| 1611 | - while (file_exists($chat_path . $basename_chat . '-' . $i . '.log.html')) { |
|
| 1611 | + while (file_exists($chat_path.$basename_chat.'-'.$i.'.log.html')) { |
|
| 1612 | 1612 | $i++; |
| 1613 | 1613 | } |
| 1614 | 1614 | |
| 1615 | - @rename($chat_path . $basename_chat . '.log.html', $chat_path . $basename_chat . '-' . $i . '.log.html'); |
|
| 1616 | - @fclose(fopen($chat_path . $basename_chat . '.log.html', 'w')); |
|
| 1615 | + @rename($chat_path.$basename_chat.'.log.html', $chat_path.$basename_chat.'-'.$i.'.log.html'); |
|
| 1616 | + @fclose(fopen($chat_path.$basename_chat.'.log.html', 'w')); |
|
| 1617 | 1617 | |
| 1618 | 1618 | $doc_id = add_document( |
| 1619 | 1619 | $courseInfo, |
| 1620 | - $basepath_chat . '/' . $basename_chat . '-' . $i . '.log.html', |
|
| 1620 | + $basepath_chat.'/'.$basename_chat.'-'.$i.'.log.html', |
|
| 1621 | 1621 | 'file', |
| 1622 | - filesize($chat_path . $basename_chat . '-' . $i . '.log.html'), |
|
| 1623 | - $basename_chat . '-' . $i . '.log.html' |
|
| 1622 | + filesize($chat_path.$basename_chat.'-'.$i.'.log.html'), |
|
| 1623 | + $basename_chat.'-'.$i.'.log.html' |
|
| 1624 | 1624 | ); |
| 1625 | 1625 | |
| 1626 | 1626 | api_item_property_update( |
@@ -1651,7 +1651,7 @@ discard block |
||
| 1651 | 1651 | |
| 1652 | 1652 | $doc_id = DocumentManager::get_document_id( |
| 1653 | 1653 | $courseInfo, |
| 1654 | - $basepath_chat . '/' . $basename_chat . '.log.html' |
|
| 1654 | + $basepath_chat.'/'.$basename_chat.'.log.html' |
|
| 1655 | 1655 | ); |
| 1656 | 1656 | |
| 1657 | 1657 | update_existing_document($courseInfo, $doc_id, 0); |
@@ -1660,8 +1660,8 @@ discard block |
||
| 1660 | 1660 | $remove = 0; |
| 1661 | 1661 | $content = array(); |
| 1662 | 1662 | |
| 1663 | - if (file_exists($chat_path . $basename_chat . '.log.html')) { |
|
| 1664 | - $content = file($chat_path . $basename_chat . '.log.html'); |
|
| 1663 | + if (file_exists($chat_path.$basename_chat.'.log.html')) { |
|
| 1664 | + $content = file($chat_path.$basename_chat.'.log.html'); |
|
| 1665 | 1665 | $nbr_lines = sizeof($content); |
| 1666 | 1666 | $remove = $nbr_lines - 100; |
| 1667 | 1667 | } |
@@ -1674,7 +1674,7 @@ discard block |
||
| 1674 | 1674 | |
| 1675 | 1675 | if (isset($_GET['origin']) && $_GET['origin'] == 'whoisonline') { |
| 1676 | 1676 | //the caller |
| 1677 | - $content[0] = get_lang('CallSent') . '<br />' . $content[0]; |
|
| 1677 | + $content[0] = get_lang('CallSent').'<br />'.$content[0]; |
|
| 1678 | 1678 | } |
| 1679 | 1679 | |
| 1680 | 1680 | $history = '<div id="content-chat">'; |
@@ -1689,7 +1689,7 @@ discard block |
||
| 1689 | 1689 | $history .= ' |
| 1690 | 1690 | <div id="clear-chat"> |
| 1691 | 1691 | <button type="button" id="chat-reset" class="btn btn-danger btn-sm"> |
| 1692 | - ' . get_lang('ClearList') . ' |
|
| 1692 | + ' . get_lang('ClearList').' |
|
| 1693 | 1693 | </button> |
| 1694 | 1694 | </div> |
| 1695 | 1695 | '; |
@@ -1710,9 +1710,9 @@ discard block |
||
| 1710 | 1710 | $extraCondition = null; |
| 1711 | 1711 | |
| 1712 | 1712 | if ($this->groupId) { |
| 1713 | - $extraCondition = 'AND ccc.toGroupId = ' . intval($this->groupId); |
|
| 1713 | + $extraCondition = 'AND ccc.toGroupId = '.intval($this->groupId); |
|
| 1714 | 1714 | } else { |
| 1715 | - $extraCondition = 'AND ccc.sessionId = ' . intval($this->sessionId); |
|
| 1715 | + $extraCondition = 'AND ccc.sessionId = '.intval($this->sessionId); |
|
| 1716 | 1716 | } |
| 1717 | 1717 | |
| 1718 | 1718 | $number = Database::getManager() |
@@ -1742,9 +1742,9 @@ discard block |
||
| 1742 | 1742 | $extraCondition = null; |
| 1743 | 1743 | |
| 1744 | 1744 | if ($this->groupId) { |
| 1745 | - $extraCondition = 'AND ccc.toGroupId = ' . intval($this->groupId); |
|
| 1745 | + $extraCondition = 'AND ccc.toGroupId = '.intval($this->groupId); |
|
| 1746 | 1746 | } else { |
| 1747 | - $extraCondition = 'AND ccc.sessionId = ' . intval($this->sessionId); |
|
| 1747 | + $extraCondition = 'AND ccc.sessionId = '.intval($this->sessionId); |
|
| 1748 | 1748 | } |
| 1749 | 1749 | |
| 1750 | 1750 | $number = Database::getManager() |
@@ -1780,7 +1780,7 @@ discard block |
||
| 1780 | 1780 | 'lastname' => $user->getLastname(), |
| 1781 | 1781 | 'status' => !$this->sessionId ? $subscription->getStatus() : $user->getStatus(), |
| 1782 | 1782 | 'image_url' => UserManager::getUserPicture($user->getId(), USER_IMAGE_SIZE_MEDIUM), |
| 1783 | - 'profile_url' => api_get_path(WEB_CODE_PATH) . 'social/profile.php?u=' . $user->getId(), |
|
| 1783 | + 'profile_url' => api_get_path(WEB_CODE_PATH).'social/profile.php?u='.$user->getId(), |
|
| 1784 | 1784 | 'complete_name' => $user->getCompleteName(), |
| 1785 | 1785 | 'username' => $user->getUsername(), |
| 1786 | 1786 | 'email' => $user->getEmail(), |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | * @param string $course Course code |
| 88 | 88 | * @param integer $lp_id |
| 89 | 89 | * @param integer $user_id |
| 90 | - * @return mixed True on success, false on error |
|
| 90 | + * @return boolean True on success, false on error |
|
| 91 | 91 | */ |
| 92 | 92 | public function __construct($course, $lp_id, $user_id) |
| 93 | 93 | { |
@@ -491,7 +491,7 @@ discard block |
||
| 491 | 491 | * @param int $max_time_allowed |
| 492 | 492 | * @param int $userId |
| 493 | 493 | * |
| 494 | - * @return int |
|
| 494 | + * @return false|string |
|
| 495 | 495 | */ |
| 496 | 496 | public function add_item( |
| 497 | 497 | $parent, |
@@ -1043,7 +1043,7 @@ discard block |
||
| 1043 | 1043 | * @param array $courseInfo |
| 1044 | 1044 | * @param integer Learnpath ID |
| 1045 | 1045 | * @param string Whether to delete data or keep it (default: 'keep', others: 'remove') |
| 1046 | - * @return boolean True on success, false on failure (might change that to return number of elements deleted) |
|
| 1046 | + * @return false|null True on success, false on failure (might change that to return number of elements deleted) |
|
| 1047 | 1047 | */ |
| 1048 | 1048 | public function delete($courseInfo = null, $id = null, $delete = 'keep') |
| 1049 | 1049 | { |
@@ -1182,7 +1182,7 @@ discard block |
||
| 1182 | 1182 | * @param integer $id Elem ID (0 if first) |
| 1183 | 1183 | * @param integer $remove Whether to remove the resource/data from the |
| 1184 | 1184 | * system or leave it (default: 'keep', others 'remove') |
| 1185 | - * @return integer Number of elements moved |
|
| 1185 | + * @return false|null Number of elements moved |
|
| 1186 | 1186 | * @todo implement resource removal |
| 1187 | 1187 | */ |
| 1188 | 1188 | public function delete_item($id, $remove = 'keep') |
@@ -1264,7 +1264,7 @@ discard block |
||
| 1264 | 1264 | * @param array $audio The array resulting of the $_FILES[mp3] element |
| 1265 | 1265 | * @param int $max_time_allowed |
| 1266 | 1266 | * @param string $url |
| 1267 | - * @return boolean True on success, false on error |
|
| 1267 | + * @return false|null True on success, false on error |
|
| 1268 | 1268 | */ |
| 1269 | 1269 | public function edit_item( |
| 1270 | 1270 | $id, |
@@ -1783,7 +1783,7 @@ discard block |
||
| 1783 | 1783 | |
| 1784 | 1784 | /** |
| 1785 | 1785 | * Gets the first element URL. |
| 1786 | - * @return string URL to load into the viewer |
|
| 1786 | + * @return false|null URL to load into the viewer |
|
| 1787 | 1787 | */ |
| 1788 | 1788 | public function first() |
| 1789 | 1789 | { |
@@ -2297,6 +2297,7 @@ discard block |
||
| 2297 | 2297 | * @param int $student_id |
| 2298 | 2298 | * @param string Course code (optional) |
| 2299 | 2299 | * @param int $sessionId |
| 2300 | + * @param string $courseCode |
|
| 2300 | 2301 | * @return bool |
| 2301 | 2302 | */ |
| 2302 | 2303 | public static function is_lp_visible_for_student( |
@@ -2594,7 +2595,7 @@ discard block |
||
| 2594 | 2595 | |
| 2595 | 2596 | /** |
| 2596 | 2597 | * Gets the learnpath session id |
| 2597 | - * @return string Learnpath theme |
|
| 2598 | + * @return integer Learnpath theme |
|
| 2598 | 2599 | */ |
| 2599 | 2600 | public function get_lp_session_id() |
| 2600 | 2601 | { |
@@ -2627,7 +2628,7 @@ discard block |
||
| 2627 | 2628 | /** |
| 2628 | 2629 | * @param string $size |
| 2629 | 2630 | * @param string $path_type |
| 2630 | - * @return bool|string |
|
| 2631 | + * @return string|false |
|
| 2631 | 2632 | */ |
| 2632 | 2633 | public function get_preview_image_path($size = null, $path_type = 'web') |
| 2633 | 2634 | { |
@@ -2773,6 +2774,8 @@ discard block |
||
| 2773 | 2774 | * Returns the XML DOM document's node |
| 2774 | 2775 | * @param resource Reference to a list of objects to search for the given ITEM_* |
| 2775 | 2776 | * @param string The identifier to look for |
| 2777 | + * @param DOMNodeList $children |
|
| 2778 | + * @param string $id |
|
| 2776 | 2779 | * @return mixed The reference to the element found with that identifier. False if not found |
| 2777 | 2780 | */ |
| 2778 | 2781 | public function get_scorm_xml_node(& $children, $id) |
@@ -3020,7 +3023,7 @@ discard block |
||
| 3020 | 3023 | /** |
| 3021 | 3024 | * Generate and return the table of contents for this learnpath. The (flat) table returned can be |
| 3022 | 3025 | * used by get_html_toc() to be ready to display |
| 3023 | - * @return array TOC as a table with 4 elements per row: title, link, status and level |
|
| 3026 | + * @return boolean TOC as a table with 4 elements per row: title, link, status and level |
|
| 3024 | 3027 | */ |
| 3025 | 3028 | public function get_toc() |
| 3026 | 3029 | { |
@@ -3156,7 +3159,7 @@ discard block |
||
| 3156 | 3159 | } |
| 3157 | 3160 | |
| 3158 | 3161 | /** |
| 3159 | - * @return array |
|
| 3162 | + * @return string[] |
|
| 3160 | 3163 | */ |
| 3161 | 3164 | public static function getChapterTypes() |
| 3162 | 3165 | { |
@@ -4062,7 +4065,7 @@ discard block |
||
| 4062 | 4065 | * Open a resource = initialise all local variables relative to this resource. Depending on the child |
| 4063 | 4066 | * class, this might be redefined to allow several behaviours depending on the document type. |
| 4064 | 4067 | * @param integer Resource ID |
| 4065 | - * @return boolean True on success, false otherwise |
|
| 4068 | + * @return boolean|null True on success, false otherwise |
|
| 4066 | 4069 | */ |
| 4067 | 4070 | public function open($id) |
| 4068 | 4071 | { |
@@ -4191,7 +4194,7 @@ discard block |
||
| 4191 | 4194 | * Can be used as abstract |
| 4192 | 4195 | * @param integer $lp_id Learnpath id |
| 4193 | 4196 | * @param string $set_visibility New visibility (v/i - visible/invisible) |
| 4194 | - * @return bool |
|
| 4197 | + * @return false|null |
|
| 4195 | 4198 | */ |
| 4196 | 4199 | public static function toggle_publish($lp_id, $set_visibility = 'v') |
| 4197 | 4200 | { |
@@ -4276,7 +4279,7 @@ discard block |
||
| 4276 | 4279 | * Make sure the results are saved with anoter method. This method should probably be |
| 4277 | 4280 | * redefined in children classes. |
| 4278 | 4281 | * To use a similar method statically, use the create_new_attempt() method |
| 4279 | - * @return string URL to load in the viewer |
|
| 4282 | + * @return boolean URL to load in the viewer |
|
| 4280 | 4283 | */ |
| 4281 | 4284 | public function restart() |
| 4282 | 4285 | { |
@@ -4354,6 +4357,7 @@ discard block |
||
| 4354 | 4357 | * Saves the given item |
| 4355 | 4358 | * @param integer $item_id. Optional (will take from $_REQUEST if null) |
| 4356 | 4359 | * @param boolean $from_outside Save from url params (true) or from current attributes (false). Optional. Defaults to true |
| 4360 | + * @param integer $item_id |
|
| 4357 | 4361 | * @return boolean |
| 4358 | 4362 | */ |
| 4359 | 4363 | public function save_item($item_id = null, $from_outside = true) |
@@ -4851,7 +4855,7 @@ discard block |
||
| 4851 | 4855 | |
| 4852 | 4856 | /** |
| 4853 | 4857 | * Sets use_max_score |
| 4854 | - * @param string $use_max_score Optional string giving the new location of this learnpath |
|
| 4858 | + * @param integer $use_max_score Optional string giving the new location of this learnpath |
|
| 4855 | 4859 | * @return boolean True on success / False on error |
| 4856 | 4860 | */ |
| 4857 | 4861 | public function set_use_max_score($use_max_score = 1) |
@@ -5254,6 +5258,7 @@ discard block |
||
| 5254 | 5258 | * Register the attempt mode into db thanks to flags prevent_reinit and seriousgame_mode flags |
| 5255 | 5259 | * |
| 5256 | 5260 | * @param string 'seriousgame', 'single' or 'multiple' |
| 5261 | + * @param string $mode |
|
| 5257 | 5262 | * @return boolean |
| 5258 | 5263 | * @author ndiechburg <[email protected]> |
| 5259 | 5264 | **/ |
@@ -5296,7 +5301,7 @@ discard block |
||
| 5296 | 5301 | /** |
| 5297 | 5302 | * Switch between multiple attempt, single attempt or serious_game mode (only for scorm) |
| 5298 | 5303 | * |
| 5299 | - * @return boolean |
|
| 5304 | + * @return boolean|null |
|
| 5300 | 5305 | * @author ndiechburg <[email protected]> |
| 5301 | 5306 | **/ |
| 5302 | 5307 | public function switch_attempt_mode() |
@@ -5487,7 +5492,6 @@ discard block |
||
| 5487 | 5492 | /** |
| 5488 | 5493 | * Function that creates a html list of learning path items so that we can add audio files to them |
| 5489 | 5494 | * @author Kevin Van Den Haute |
| 5490 | - * @param int $lp_id |
|
| 5491 | 5495 | * @return string |
| 5492 | 5496 | */ |
| 5493 | 5497 | public function overview() |
@@ -6501,7 +6505,7 @@ discard block |
||
| 6501 | 6505 | /** |
| 6502 | 6506 | * Function that displays a list with al the resources that |
| 6503 | 6507 | * could be added to the learning path |
| 6504 | - * @return string |
|
| 6508 | + * @return boolean |
|
| 6505 | 6509 | */ |
| 6506 | 6510 | public function display_resources() |
| 6507 | 6511 | { |
@@ -10046,7 +10050,7 @@ discard block |
||
| 10046 | 10050 | |
| 10047 | 10051 | /** |
| 10048 | 10052 | * @param int $lp_id |
| 10049 | - * @return bool |
|
| 10053 | + * @return false|null |
|
| 10050 | 10054 | */ |
| 10051 | 10055 | public function scorm_export_to_pdf($lp_id) |
| 10052 | 10056 | { |
@@ -10581,7 +10585,7 @@ discard block |
||
| 10581 | 10585 | |
| 10582 | 10586 | /** |
| 10583 | 10587 | * @param int $itemId |
| 10584 | - * @return learnpathItem|false |
|
| 10588 | + * @return string |
|
| 10585 | 10589 | */ |
| 10586 | 10590 | public function getItem($itemId) |
| 10587 | 10591 | { |
@@ -10631,7 +10635,6 @@ discard block |
||
| 10631 | 10635 | /** |
| 10632 | 10636 | * Set whether this is a learning path with the possibility to subscribe |
| 10633 | 10637 | * users or not |
| 10634 | - * @param int $subscribeUsers (0 = false, 1 = true) |
|
| 10635 | 10638 | */ |
| 10636 | 10639 | public function setSubscribeUsers($value) |
| 10637 | 10640 | { |
@@ -10756,7 +10759,7 @@ discard block |
||
| 10756 | 10759 | |
| 10757 | 10760 | /** |
| 10758 | 10761 | * Get the item of exercise type (evaluation type) |
| 10759 | - * @return array The final evaluation. Otherwise return false |
|
| 10762 | + * @return integer The final evaluation. Otherwise return false |
|
| 10760 | 10763 | */ |
| 10761 | 10764 | public function getFinalEvaluationItem() |
| 10762 | 10765 | { |
@@ -10980,7 +10983,7 @@ discard block |
||
| 10980 | 10983 | /** |
| 10981 | 10984 | * Create a forum for this learning path |
| 10982 | 10985 | * @param type $forumCategoryId |
| 10983 | - * @return int The forum ID if was created. Otherwise return false |
|
| 10986 | + * @return false|string The forum ID if was created. Otherwise return false |
|
| 10984 | 10987 | */ |
| 10985 | 10988 | public function createForum($forumCategoryId) |
| 10986 | 10989 | { |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | // Percentage progress as saved in the db. |
| 59 | 59 | public $progress_db = '0'; |
| 60 | 60 | public $proximity; // Wether the content is distant or local or unknown. |
| 61 | - public $refs_list = array (); //list of items by ref => db_id. Used only for prerequisites match. |
|
| 61 | + public $refs_list = array(); //list of items by ref => db_id. Used only for prerequisites match. |
|
| 62 | 62 | // !!!This array (refs_list) is built differently depending on the nature of the LP. |
| 63 | 63 | // If SCORM, uses ref, if Chamilo, uses id to keep a unique value. |
| 64 | 64 | public $type; //type of learnpath. Could be 'dokeos', 'scorm', 'scorm2004', 'aicc', ... |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | if (!empty($row['expired_on'])) { |
| 163 | - $this->expired_on = $row['expired_on']; |
|
| 163 | + $this->expired_on = $row['expired_on']; |
|
| 164 | 164 | } |
| 165 | 165 | if ($this->type == 2) { |
| 166 | 166 | if ($row['force_commit'] == 1) { |
@@ -204,12 +204,12 @@ discard block |
||
| 204 | 204 | ORDER BY view_count DESC"; |
| 205 | 205 | $res = Database::query($sql); |
| 206 | 206 | if ($this->debug > 2) { |
| 207 | - error_log('New LP - learnpath::__construct() ' . __LINE__ . ' - querying lp_view: ' . $sql, 0); |
|
| 207 | + error_log('New LP - learnpath::__construct() '.__LINE__.' - querying lp_view: '.$sql, 0); |
|
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | if (Database :: num_rows($res) > 0) { |
| 211 | 211 | if ($this->debug > 2) { |
| 212 | - error_log('New LP - learnpath::__construct() ' . __LINE__ . ' - Found previous view', 0); |
|
| 212 | + error_log('New LP - learnpath::__construct() '.__LINE__.' - Found previous view', 0); |
|
| 213 | 213 | } |
| 214 | 214 | $row = Database :: fetch_array($res); |
| 215 | 215 | $this->attempt = $row['view_count']; |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | $this->lp_view_session_id = $row['session_id']; |
| 220 | 220 | } else if (!api_is_invitee()) { |
| 221 | 221 | if ($this->debug > 2) { |
| 222 | - error_log('New LP - learnpath::__construct() ' . __LINE__ . ' - NOT Found previous view', 0); |
|
| 222 | + error_log('New LP - learnpath::__construct() '.__LINE__.' - NOT Found previous view', 0); |
|
| 223 | 223 | } |
| 224 | 224 | $this->attempt = 1; |
| 225 | 225 | $params = [ |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | $this->lp_view_id = Database::insert_id(); |
| 235 | 235 | |
| 236 | 236 | if ($this->debug > 2) { |
| 237 | - error_log('New LP - learnpath::__construct() ' . __LINE__ . ' - inserting new lp_view: ' . $sql, 0); |
|
| 237 | + error_log('New LP - learnpath::__construct() '.__LINE__.' - inserting new lp_view: '.$sql, 0); |
|
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | $sql = "UPDATE $lp_table SET id = iid WHERE iid = ".$this->lp_view_id; |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | $res = Database::query($sql); |
| 250 | 250 | |
| 251 | 251 | if ($this->debug > 2) { |
| 252 | - error_log('New LP - learnpath::__construct() ' . __LINE__ . ' - query lp items: ' . $sql, 0); |
|
| 252 | + error_log('New LP - learnpath::__construct() '.__LINE__.' - query lp items: '.$sql, 0); |
|
| 253 | 253 | error_log('-- Start while--', 0); |
| 254 | 254 | } |
| 255 | 255 | |
@@ -269,8 +269,8 @@ discard block |
||
| 269 | 269 | $this->refs_list[$oItem->ref] = $my_item_id; |
| 270 | 270 | if ($this->debug > 2) { |
| 271 | 271 | error_log( |
| 272 | - 'New LP - learnpath::__construct() - ' . |
|
| 273 | - 'aicc object with id ' . $my_item_id . |
|
| 272 | + 'New LP - learnpath::__construct() - '. |
|
| 273 | + 'aicc object with id '.$my_item_id. |
|
| 274 | 274 | ' set in items[]', |
| 275 | 275 | 0 |
| 276 | 276 | ); |
@@ -289,19 +289,19 @@ discard block |
||
| 289 | 289 | |
| 290 | 290 | $this->refs_list[$oItem->ref] = $my_item_id; |
| 291 | 291 | if ($this->debug > 2) { |
| 292 | - error_log('New LP - object with id ' . $my_item_id . ' set in items[]', 0); |
|
| 292 | + error_log('New LP - object with id '.$my_item_id.' set in items[]', 0); |
|
| 293 | 293 | } |
| 294 | 294 | } |
| 295 | 295 | break; |
| 296 | 296 | case 1: |
| 297 | 297 | default: |
| 298 | 298 | if ($this->debug > 2) { |
| 299 | - error_log('New LP - learnpath::__construct() ' . __LINE__ . ' - calling learnpathItem', 0); |
|
| 299 | + error_log('New LP - learnpath::__construct() '.__LINE__.' - calling learnpathItem', 0); |
|
| 300 | 300 | } |
| 301 | 301 | $oItem = new learnpathItem($row['id'], $user_id, $course_id, $row); |
| 302 | 302 | |
| 303 | 303 | if ($this->debug > 2) { |
| 304 | - error_log('New LP - learnpath::__construct() ' . __LINE__ . ' - end calling learnpathItem', 0); |
|
| 304 | + error_log('New LP - learnpath::__construct() '.__LINE__.' - end calling learnpathItem', 0); |
|
| 305 | 305 | } |
| 306 | 306 | if (is_object($oItem)) { |
| 307 | 307 | $my_item_id = $oItem->get_id(); |
@@ -312,8 +312,8 @@ discard block |
||
| 312 | 312 | $this->refs_list[$my_item_id] = $my_item_id; |
| 313 | 313 | if ($this->debug > 2) { |
| 314 | 314 | error_log( |
| 315 | - 'New LP - learnpath::__construct() ' . __LINE__ . |
|
| 316 | - ' - object with id ' . $my_item_id . ' set in items[]', |
|
| 315 | + 'New LP - learnpath::__construct() '.__LINE__. |
|
| 316 | + ' - object with id '.$my_item_id.' set in items[]', |
|
| 317 | 317 | 0 |
| 318 | 318 | ); |
| 319 | 319 | } |
@@ -332,13 +332,13 @@ discard block |
||
| 332 | 332 | $this->items[$row['id']]->set_lp_view($this->lp_view_id, $course_id); |
| 333 | 333 | if ($this->items[$row['id']]->get_type() == TOOL_HOTPOTATOES) { |
| 334 | 334 | $this->items[$row['id']]->current_start_time = 0; |
| 335 | - $this->items[$row['id']]->current_stop_time = 0; |
|
| 335 | + $this->items[$row['id']]->current_stop_time = 0; |
|
| 336 | 336 | } |
| 337 | 337 | } |
| 338 | 338 | } |
| 339 | 339 | |
| 340 | 340 | if ($this->debug > 2) { |
| 341 | - error_log('New LP - learnpath::__construct() ' . __LINE__ . ' ----- end while ----', 0); |
|
| 341 | + error_log('New LP - learnpath::__construct() '.__LINE__.' ----- end while ----', 0); |
|
| 342 | 342 | } |
| 343 | 343 | |
| 344 | 344 | if (!empty($lp_item_id_list)) { |
@@ -430,7 +430,7 @@ discard block |
||
| 430 | 430 | // TODO: Define the current item better. |
| 431 | 431 | $this->first(); |
| 432 | 432 | if ($this->debug > 2) { |
| 433 | - error_log('New LP - learnpath::__construct() ' . __LINE__ . ' - End of learnpath constructor for learnpath ' . $this->get_id(), 0); |
|
| 433 | + error_log('New LP - learnpath::__construct() '.__LINE__.' - End of learnpath constructor for learnpath '.$this->get_id(), 0); |
|
| 434 | 434 | } |
| 435 | 435 | return true; |
| 436 | 436 | } |
@@ -507,7 +507,7 @@ discard block |
||
| 507 | 507 | ) { |
| 508 | 508 | $course_id = $this->course_info['real_id']; |
| 509 | 509 | if ($this->debug > 0) { |
| 510 | - error_log('New LP - In learnpath::add_item(' . $parent . ',' . $previous . ',' . $type . ',' . $id . ',' . $title . ')', 0); |
|
| 510 | + error_log('New LP - In learnpath::add_item('.$parent.','.$previous.','.$type.','.$id.','.$title.')', 0); |
|
| 511 | 511 | } |
| 512 | 512 | if (empty($course_id)) { |
| 513 | 513 | // Sometimes Oogie doesn't catch the course info but sets $this->cc |
@@ -529,7 +529,7 @@ discard block |
||
| 529 | 529 | FROM $tbl_lp_item |
| 530 | 530 | WHERE |
| 531 | 531 | c_id = $course_id AND |
| 532 | - lp_id = " . $this->get_id() . " AND |
|
| 532 | + lp_id = ".$this->get_id()." AND |
|
| 533 | 533 | parent_item_id = " . $parent; |
| 534 | 534 | |
| 535 | 535 | $res_count = Database::query($sql); |
@@ -539,11 +539,11 @@ discard block |
||
| 539 | 539 | if ($num > 0) { |
| 540 | 540 | if ($previous == 0) { |
| 541 | 541 | $sql = "SELECT id, next_item_id, display_order |
| 542 | - FROM " . $tbl_lp_item . " |
|
| 542 | + FROM " . $tbl_lp_item." |
|
| 543 | 543 | WHERE |
| 544 | 544 | c_id = $course_id AND |
| 545 | - lp_id = " . $this->get_id() . " AND |
|
| 546 | - parent_item_id = " . $parent . " AND |
|
| 545 | + lp_id = ".$this->get_id()." AND |
|
| 546 | + parent_item_id = " . $parent." AND |
|
| 547 | 547 | previous_item_id = 0 OR |
| 548 | 548 | previous_item_id=" . $parent; |
| 549 | 549 | $result = Database::query($sql); |
@@ -557,7 +557,7 @@ discard block |
||
| 557 | 557 | FROM $tbl_lp_item |
| 558 | 558 | WHERE |
| 559 | 559 | c_id = $course_id AND |
| 560 | - lp_id = " . $this->get_id() . " AND |
|
| 560 | + lp_id = ".$this->get_id()." AND |
|
| 561 | 561 | id = " . $previous; |
| 562 | 562 | |
| 563 | 563 | $result = Database::query($sql); |
@@ -577,8 +577,8 @@ discard block |
||
| 577 | 577 | $typeCleaned = Database::escape_string($type); |
| 578 | 578 | if ($type == 'quiz') { |
| 579 | 579 | $sql = 'SELECT SUM(ponderation) |
| 580 | - FROM ' . Database :: get_course_table(TABLE_QUIZ_QUESTION) . ' as quiz_question |
|
| 581 | - INNER JOIN ' . Database :: get_course_table(TABLE_QUIZ_TEST_QUESTION) . ' as quiz_rel_question |
|
| 580 | + FROM ' . Database :: get_course_table(TABLE_QUIZ_QUESTION).' as quiz_question |
|
| 581 | + INNER JOIN ' . Database :: get_course_table(TABLE_QUIZ_TEST_QUESTION).' as quiz_rel_question |
|
| 582 | 582 | ON |
| 583 | 583 | quiz_question.id = quiz_rel_question.question_id AND |
| 584 | 584 | quiz_question.c_id = quiz_rel_question.c_id |
@@ -624,7 +624,7 @@ discard block |
||
| 624 | 624 | $new_item_id = Database::insert($tbl_lp_item, $params); |
| 625 | 625 | |
| 626 | 626 | if ($this->debug > 2) { |
| 627 | - error_log('New LP - Inserting dir/chapter: ' . $new_item_id, 0); |
|
| 627 | + error_log('New LP - Inserting dir/chapter: '.$new_item_id, 0); |
|
| 628 | 628 | } |
| 629 | 629 | |
| 630 | 630 | if ($new_item_id) { |
@@ -640,28 +640,28 @@ discard block |
||
| 640 | 640 | Database::query($sql); |
| 641 | 641 | |
| 642 | 642 | // Update all the items after the new item. |
| 643 | - $sql = "UPDATE " . $tbl_lp_item . " |
|
| 643 | + $sql = "UPDATE ".$tbl_lp_item." |
|
| 644 | 644 | SET display_order = display_order + 1 |
| 645 | 645 | WHERE |
| 646 | 646 | c_id = $course_id AND |
| 647 | - lp_id = " . $this->get_id() . " AND |
|
| 648 | - id <> " . $new_item_id . " AND |
|
| 649 | - parent_item_id = " . $parent . " AND |
|
| 647 | + lp_id = ".$this->get_id()." AND |
|
| 648 | + id <> " . $new_item_id." AND |
|
| 649 | + parent_item_id = " . $parent." AND |
|
| 650 | 650 | display_order > " . $display_order; |
| 651 | 651 | Database::query($sql); |
| 652 | 652 | |
| 653 | 653 | // Update the item that should come after the new item. |
| 654 | - $sql = "UPDATE " . $tbl_lp_item . " |
|
| 655 | - SET ref = " . $new_item_id . " |
|
| 656 | - WHERE c_id = $course_id AND id = " . $new_item_id; |
|
| 654 | + $sql = "UPDATE ".$tbl_lp_item." |
|
| 655 | + SET ref = " . $new_item_id." |
|
| 656 | + WHERE c_id = $course_id AND id = ".$new_item_id; |
|
| 657 | 657 | Database::query($sql); |
| 658 | 658 | |
| 659 | 659 | // Upload audio. |
| 660 | 660 | if (!empty($_FILES['mp3']['name'])) { |
| 661 | 661 | // Create the audio folder if it does not exist yet. |
| 662 | - $filepath = api_get_path(SYS_COURSE_PATH) . $_course['path'] . '/document/'; |
|
| 663 | - if (!is_dir($filepath . 'audio')) { |
|
| 664 | - mkdir($filepath . 'audio', api_get_permissions_for_new_directories()); |
|
| 662 | + $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/'; |
|
| 663 | + if (!is_dir($filepath.'audio')) { |
|
| 664 | + mkdir($filepath.'audio', api_get_permissions_for_new_directories()); |
|
| 665 | 665 | $audio_id = add_document( |
| 666 | 666 | $_course, |
| 667 | 667 | '/audio', |
@@ -704,7 +704,7 @@ discard block |
||
| 704 | 704 | $file_path = handle_uploaded_document( |
| 705 | 705 | $_course, |
| 706 | 706 | $_FILES['mp3'], |
| 707 | - api_get_path(SYS_COURSE_PATH) . $_course['path'] . '/document', |
|
| 707 | + api_get_path(SYS_COURSE_PATH).$_course['path'].'/document', |
|
| 708 | 708 | '/audio', |
| 709 | 709 | $userId, |
| 710 | 710 | '', |
@@ -720,8 +720,8 @@ discard block |
||
| 720 | 720 | |
| 721 | 721 | // Store the mp3 file in the lp_item table. |
| 722 | 722 | $sql = "UPDATE $tbl_lp_item SET |
| 723 | - audio = '" . Database::escape_string($file) . "' |
|
| 724 | - WHERE id = '" . intval($new_item_id) . "'"; |
|
| 723 | + audio = '".Database::escape_string($file)."' |
|
| 724 | + WHERE id = '" . intval($new_item_id)."'"; |
|
| 725 | 725 | Database::query($sql); |
| 726 | 726 | } |
| 727 | 727 | } |
@@ -798,7 +798,7 @@ discard block |
||
| 798 | 798 | while (Database :: num_rows($res_name)) { |
| 799 | 799 | // There is already one such name, update the current one a bit. |
| 800 | 800 | $i++; |
| 801 | - $name = $name . ' - ' . $i; |
|
| 801 | + $name = $name.' - '.$i; |
|
| 802 | 802 | $check_name = "SELECT * FROM $tbl_lp WHERE c_id = $course_id AND name = '$name'"; |
| 803 | 803 | $res_name = Database::query($check_name); |
| 804 | 804 | } |
@@ -911,7 +911,7 @@ discard block |
||
| 911 | 911 | // if $item points to an object and there is a parent. |
| 912 | 912 | if ($debug) { |
| 913 | 913 | error_log( |
| 914 | - 'Autocompleting parent of item ' . $item . ' "'.$currentItem->get_title().'" (item ' . $parent_id . ' "'.$parent->get_title().'") ', |
|
| 914 | + 'Autocompleting parent of item '.$item.' "'.$currentItem->get_title().'" (item '.$parent_id.' "'.$parent->get_title().'") ', |
|
| 915 | 915 | 0 |
| 916 | 916 | ); |
| 917 | 917 | } |
@@ -939,7 +939,7 @@ discard block |
||
| 939 | 939 | if ($childItemId != $item) { |
| 940 | 940 | if ($debug) { |
| 941 | 941 | error_log( |
| 942 | - 'Looking at brother #'.$childItemId . ' "' . $childItem->get_title() . '", status is ' . $childItem->get_status(), |
|
| 942 | + 'Looking at brother #'.$childItemId.' "'.$childItem->get_title().'", status is '.$childItem->get_status(), |
|
| 943 | 943 | 0 |
| 944 | 944 | ); |
| 945 | 945 | } |
@@ -959,7 +959,7 @@ discard block |
||
| 959 | 959 | } else { |
| 960 | 960 | if ($debug > 2) { |
| 961 | 961 | error_log( |
| 962 | - 'Found one incomplete child of parent #' . $parent_id . ': child #'.$childItemId . ' "' . $childItem->get_title() . '", is ' . $childItem->get_status().' db_item_view_id:#'.$childItem->db_item_view_id, |
|
| 962 | + 'Found one incomplete child of parent #'.$parent_id.': child #'.$childItemId.' "'.$childItem->get_title().'", is '.$childItem->get_status().' db_item_view_id:#'.$childItem->db_item_view_id, |
|
| 963 | 963 | 0 |
| 964 | 964 | ); |
| 965 | 965 | } |
@@ -1065,15 +1065,15 @@ discard block |
||
| 1065 | 1065 | // Delete lp item id. |
| 1066 | 1066 | foreach ($this->items as $id => $dummy) { |
| 1067 | 1067 | $sql = "DELETE FROM $lp_item_view |
| 1068 | - WHERE c_id = $course_id AND lp_item_id = '" . $id . "'"; |
|
| 1068 | + WHERE c_id = $course_id AND lp_item_id = '".$id."'"; |
|
| 1069 | 1069 | Database::query($sql); |
| 1070 | 1070 | } |
| 1071 | 1071 | |
| 1072 | 1072 | // Proposed by Christophe (nickname: clefevre) |
| 1073 | - $sql = "DELETE FROM $lp_item WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id; |
|
| 1073 | + $sql = "DELETE FROM $lp_item WHERE c_id = ".$course_id." AND lp_id = ".$this->lp_id; |
|
| 1074 | 1074 | Database::query($sql); |
| 1075 | 1075 | |
| 1076 | - $sql = "DELETE FROM $lp_view WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id; |
|
| 1076 | + $sql = "DELETE FROM $lp_view WHERE c_id = ".$course_id." AND lp_id = ".$this->lp_id; |
|
| 1077 | 1077 | Database::query($sql); |
| 1078 | 1078 | |
| 1079 | 1079 | self::toggle_publish($this->lp_id, 'i'); |
@@ -1081,33 +1081,33 @@ discard block |
||
| 1081 | 1081 | if ($this->type == 2 || $this->type == 3) { |
| 1082 | 1082 | // This is a scorm learning path, delete the files as well. |
| 1083 | 1083 | $sql = "SELECT path FROM $lp |
| 1084 | - WHERE c_id = ".$course_id." AND id = " . $this->lp_id; |
|
| 1084 | + WHERE c_id = ".$course_id." AND id = ".$this->lp_id; |
|
| 1085 | 1085 | $res = Database::query($sql); |
| 1086 | 1086 | if (Database :: num_rows($res) > 0) { |
| 1087 | 1087 | $row = Database :: fetch_array($res); |
| 1088 | 1088 | $path = $row['path']; |
| 1089 | 1089 | $sql = "SELECT id FROM $lp |
| 1090 | - WHERE c_id = ".$course_id." AND path = '$path' AND id != " . $this->lp_id; |
|
| 1090 | + WHERE c_id = ".$course_id." AND path = '$path' AND id != ".$this->lp_id; |
|
| 1091 | 1091 | $res = Database::query($sql); |
| 1092 | 1092 | if (Database :: num_rows($res) > 0) { |
| 1093 | 1093 | // Another learning path uses this directory, so don't delete it. |
| 1094 | 1094 | if ($this->debug > 2) { |
| 1095 | - error_log('New LP - In learnpath::delete(), found other LP using path ' . $path . ', keeping directory', 0); |
|
| 1095 | + error_log('New LP - In learnpath::delete(), found other LP using path '.$path.', keeping directory', 0); |
|
| 1096 | 1096 | } |
| 1097 | 1097 | } else { |
| 1098 | 1098 | // No other LP uses that directory, delete it. |
| 1099 | - $course_rel_dir = api_get_course_path() . '/scorm/'; // scorm dir web path starting from /courses |
|
| 1100 | - $course_scorm_dir = api_get_path(SYS_COURSE_PATH) . $course_rel_dir; // The absolute system path for this course. |
|
| 1101 | - if ($delete == 'remove' && is_dir($course_scorm_dir . $path) and !empty ($course_scorm_dir)) { |
|
| 1099 | + $course_rel_dir = api_get_course_path().'/scorm/'; // scorm dir web path starting from /courses |
|
| 1100 | + $course_scorm_dir = api_get_path(SYS_COURSE_PATH).$course_rel_dir; // The absolute system path for this course. |
|
| 1101 | + if ($delete == 'remove' && is_dir($course_scorm_dir.$path) and !empty ($course_scorm_dir)) { |
|
| 1102 | 1102 | if ($this->debug > 2) { |
| 1103 | - error_log('New LP - In learnpath::delete(), found SCORM, deleting directory: ' . $course_scorm_dir . $path, 0); |
|
| 1103 | + error_log('New LP - In learnpath::delete(), found SCORM, deleting directory: '.$course_scorm_dir.$path, 0); |
|
| 1104 | 1104 | } |
| 1105 | 1105 | // Proposed by Christophe (clefevre). |
| 1106 | 1106 | if (strcmp(substr($path, -2), "/.") == 0) { |
| 1107 | 1107 | $path = substr($path, 0, -1); // Remove "." at the end. |
| 1108 | 1108 | } |
| 1109 | 1109 | //exec('rm -rf ' . $course_scorm_dir . $path); // See Bug #5208, this is not OS-portable way. |
| 1110 | - rmdirr($course_scorm_dir . $path); |
|
| 1110 | + rmdirr($course_scorm_dir.$path); |
|
| 1111 | 1111 | } |
| 1112 | 1112 | } |
| 1113 | 1113 | } |
@@ -1120,7 +1120,7 @@ discard block |
||
| 1120 | 1120 | WHERE c_id = ".$course_id." AND (link LIKE '$link%' AND image='scormbuilder.gif')"; |
| 1121 | 1121 | Database::query($sql); |
| 1122 | 1122 | |
| 1123 | - $sql = "DELETE FROM $lp WHERE c_id = ".$course_id." AND id = " . $this->lp_id; |
|
| 1123 | + $sql = "DELETE FROM $lp WHERE c_id = ".$course_id." AND id = ".$this->lp_id; |
|
| 1124 | 1124 | Database::query($sql); |
| 1125 | 1125 | // Updates the display order of all lps. |
| 1126 | 1126 | $this->update_display_order(); |
@@ -1158,7 +1158,7 @@ discard block |
||
| 1158 | 1158 | { |
| 1159 | 1159 | $course_id = $this->course_info['real_id']; |
| 1160 | 1160 | if ($this->debug > 0) { |
| 1161 | - error_log('New LP - In learnpath::delete_children_items(' . $id . ')', 0); |
|
| 1161 | + error_log('New LP - In learnpath::delete_children_items('.$id.')', 0); |
|
| 1162 | 1162 | } |
| 1163 | 1163 | $num = 0; |
| 1164 | 1164 | if (empty ($id) || $id != strval(intval($id))) { |
@@ -1169,7 +1169,7 @@ discard block |
||
| 1169 | 1169 | $res = Database::query($sql); |
| 1170 | 1170 | while ($row = Database :: fetch_array($res)) { |
| 1171 | 1171 | $num += $this->delete_children_items($row['id']); |
| 1172 | - $sql_del = "DELETE FROM $lp_item WHERE c_id = ".$course_id." AND id = " . $row['id']; |
|
| 1172 | + $sql_del = "DELETE FROM $lp_item WHERE c_id = ".$course_id." AND id = ".$row['id']; |
|
| 1173 | 1173 | Database::query($sql_del); |
| 1174 | 1174 | $num++; |
| 1175 | 1175 | } |
@@ -1210,12 +1210,12 @@ discard block |
||
| 1210 | 1210 | // Delete children items. |
| 1211 | 1211 | $num = $this->delete_children_items($id); |
| 1212 | 1212 | if ($this->debug > 2) { |
| 1213 | - error_log('New LP - learnpath::delete_item() - deleted ' . $num . ' children of element ' . $id, 0); |
|
| 1213 | + error_log('New LP - learnpath::delete_item() - deleted '.$num.' children of element '.$id, 0); |
|
| 1214 | 1214 | } |
| 1215 | 1215 | // Now delete the item. |
| 1216 | 1216 | $sql_del = "DELETE FROM $lp_item WHERE c_id = $course_id AND id = $id"; |
| 1217 | 1217 | if ($this->debug > 2) { |
| 1218 | - error_log('New LP - Deleting item: ' . $sql_del, 0); |
|
| 1218 | + error_log('New LP - Deleting item: '.$sql_del, 0); |
|
| 1219 | 1219 | } |
| 1220 | 1220 | Database::query($sql_del); |
| 1221 | 1221 | // Now update surrounding items. |
@@ -1290,15 +1290,15 @@ discard block |
||
| 1290 | 1290 | } |
| 1291 | 1291 | |
| 1292 | 1292 | $tbl_lp_item = Database :: get_course_table(TABLE_LP_ITEM); |
| 1293 | - $sql_select = "SELECT * FROM " . $tbl_lp_item . " WHERE c_id = ".$course_id." AND id = " . $id; |
|
| 1293 | + $sql_select = "SELECT * FROM ".$tbl_lp_item." WHERE c_id = ".$course_id." AND id = ".$id; |
|
| 1294 | 1294 | $res_select = Database::query($sql_select); |
| 1295 | 1295 | $row_select = Database :: fetch_array($res_select); |
| 1296 | 1296 | $audio_update_sql = ''; |
| 1297 | 1297 | if (is_array($audio) && !empty ($audio['tmp_name']) && $audio['error'] === 0) { |
| 1298 | 1298 | // Create the audio folder if it does not exist yet. |
| 1299 | - $filepath = api_get_path(SYS_COURSE_PATH) . $_course['path'] . '/document/'; |
|
| 1300 | - if (!is_dir($filepath . 'audio')) { |
|
| 1301 | - mkdir($filepath . 'audio', api_get_permissions_for_new_directories()); |
|
| 1299 | + $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/'; |
|
| 1300 | + if (!is_dir($filepath.'audio')) { |
|
| 1301 | + mkdir($filepath.'audio', api_get_permissions_for_new_directories()); |
|
| 1302 | 1302 | $audio_id = add_document( |
| 1303 | 1303 | $_course, |
| 1304 | 1304 | '/audio', |
@@ -1336,11 +1336,11 @@ discard block |
||
| 1336 | 1336 | $pi = pathinfo($audio['name']); |
| 1337 | 1337 | if ($pi['extension'] == 'mp3') { |
| 1338 | 1338 | $c_det = api_get_course_info($this->cc); |
| 1339 | - $bp = api_get_path(SYS_COURSE_PATH) . $c_det['path'] . '/document'; |
|
| 1339 | + $bp = api_get_path(SYS_COURSE_PATH).$c_det['path'].'/document'; |
|
| 1340 | 1340 | $path = handle_uploaded_document($c_det, $audio, $bp, '/audio', api_get_user_id(), 0, null, 0, 'rename', false, 0); |
| 1341 | 1341 | $path = substr($path, 7); |
| 1342 | 1342 | // Update reference in lp_item - audio path is the path from inside de document/audio/ dir. |
| 1343 | - $audio_update_sql = ", audio = '" . Database::escape_string($path) . "' "; |
|
| 1343 | + $audio_update_sql = ", audio = '".Database::escape_string($path)."' "; |
|
| 1344 | 1344 | } |
| 1345 | 1345 | } |
| 1346 | 1346 | |
@@ -1350,13 +1350,13 @@ discard block |
||
| 1350 | 1350 | // TODO: htmlspecialchars to be checked for encoding related problems. |
| 1351 | 1351 | if ($same_parent && $same_previous) { |
| 1352 | 1352 | // Only update title and description. |
| 1353 | - $sql = "UPDATE " . $tbl_lp_item . " |
|
| 1354 | - SET title = '" . Database::escape_string($title) . "', |
|
| 1355 | - prerequisite = '" . $prerequisites . "', |
|
| 1356 | - description = '" . Database::escape_string($description) . "' |
|
| 1357 | - " . $audio_update_sql . ", |
|
| 1358 | - max_time_allowed = '" . Database::escape_string($max_time_allowed) . "' |
|
| 1359 | - WHERE c_id = ".$course_id." AND id = " . $id; |
|
| 1353 | + $sql = "UPDATE ".$tbl_lp_item." |
|
| 1354 | + SET title = '" . Database::escape_string($title)."', |
|
| 1355 | + prerequisite = '" . $prerequisites."', |
|
| 1356 | + description = '" . Database::escape_string($description)."' |
|
| 1357 | + " . $audio_update_sql.", |
|
| 1358 | + max_time_allowed = '" . Database::escape_string($max_time_allowed)."' |
|
| 1359 | + WHERE c_id = ".$course_id." AND id = ".$id; |
|
| 1360 | 1360 | Database::query($sql); |
| 1361 | 1361 | } else { |
| 1362 | 1362 | $old_parent = $row_select['parent_item_id']; |
@@ -1371,27 +1371,27 @@ discard block |
||
| 1371 | 1371 | |
| 1372 | 1372 | if ($old_previous != 0) { |
| 1373 | 1373 | // Next |
| 1374 | - $sql = "UPDATE " . $tbl_lp_item . " |
|
| 1375 | - SET next_item_id = " . $old_next . " |
|
| 1376 | - WHERE c_id = ".$course_id." AND id = " . $old_previous; |
|
| 1374 | + $sql = "UPDATE ".$tbl_lp_item." |
|
| 1375 | + SET next_item_id = " . $old_next." |
|
| 1376 | + WHERE c_id = ".$course_id." AND id = ".$old_previous; |
|
| 1377 | 1377 | Database::query($sql); |
| 1378 | 1378 | } |
| 1379 | 1379 | |
| 1380 | 1380 | if ($old_next != 0) { |
| 1381 | 1381 | // Previous |
| 1382 | - $sql = "UPDATE " . $tbl_lp_item . " |
|
| 1383 | - SET previous_item_id = " . $old_previous . " |
|
| 1384 | - WHERE c_id = ".$course_id." AND id = " . $old_next; |
|
| 1382 | + $sql = "UPDATE ".$tbl_lp_item." |
|
| 1383 | + SET previous_item_id = " . $old_previous." |
|
| 1384 | + WHERE c_id = ".$course_id." AND id = ".$old_next; |
|
| 1385 | 1385 | Database::query($sql); |
| 1386 | 1386 | } |
| 1387 | 1387 | |
| 1388 | 1388 | // display_order - 1 for every item with a display_order bigger then the display_order of the current item. |
| 1389 | - $sql = "UPDATE " . $tbl_lp_item . " |
|
| 1389 | + $sql = "UPDATE ".$tbl_lp_item." |
|
| 1390 | 1390 | SET display_order = display_order - 1 |
| 1391 | 1391 | WHERE |
| 1392 | 1392 | c_id = ".$course_id." AND |
| 1393 | - display_order > " . $old_order . " AND |
|
| 1394 | - lp_id = " . $this->lp_id . " AND |
|
| 1393 | + display_order > " . $old_order." AND |
|
| 1394 | + lp_id = " . $this->lp_id." AND |
|
| 1395 | 1395 | parent_item_id = " . $old_parent; |
| 1396 | 1396 | Database::query($sql); |
| 1397 | 1397 | /* END -- virtually remove the current item id */ |
@@ -1401,11 +1401,11 @@ discard block |
||
| 1401 | 1401 | if ($previous == 0) { |
| 1402 | 1402 | // Select the data of the item that should come after the current item. |
| 1403 | 1403 | $sql = "SELECT id, display_order |
| 1404 | - FROM " . $tbl_lp_item . " |
|
| 1404 | + FROM " . $tbl_lp_item." |
|
| 1405 | 1405 | WHERE |
| 1406 | 1406 | c_id = ".$course_id." AND |
| 1407 | - lp_id = " . $this->lp_id . " AND |
|
| 1408 | - parent_item_id = " . $parent . " AND |
|
| 1407 | + lp_id = " . $this->lp_id." AND |
|
| 1408 | + parent_item_id = " . $parent." AND |
|
| 1409 | 1409 | previous_item_id = " . $previous; |
| 1410 | 1410 | $res_select_old = Database::query($sql); |
| 1411 | 1411 | $row_select_old = Database::fetch_array($res_select_old); |
@@ -1421,8 +1421,8 @@ discard block |
||
| 1421 | 1421 | } else { |
| 1422 | 1422 | // Select the data of the item that should come before the current item. |
| 1423 | 1423 | $sql = "SELECT next_item_id, display_order |
| 1424 | - FROM " . $tbl_lp_item . " |
|
| 1425 | - WHERE c_id = ".$course_id." AND id = " . $previous; |
|
| 1424 | + FROM " . $tbl_lp_item." |
|
| 1425 | + WHERE c_id = ".$course_id." AND id = ".$previous; |
|
| 1426 | 1426 | $res_select_old = Database::query($sql); |
| 1427 | 1427 | $row_select_old = Database :: fetch_array($res_select_old); |
| 1428 | 1428 | $new_next = $row_select_old['next_item_id']; |
@@ -1431,57 +1431,57 @@ discard block |
||
| 1431 | 1431 | |
| 1432 | 1432 | // TODO: htmlspecialchars to be checked for encoding related problems. |
| 1433 | 1433 | // Update the current item with the new data. |
| 1434 | - $sql = "UPDATE " . $tbl_lp_item . " |
|
| 1434 | + $sql = "UPDATE ".$tbl_lp_item." |
|
| 1435 | 1435 | SET |
| 1436 | - title = '" . Database::escape_string($title) . "', |
|
| 1437 | - description = '" . Database::escape_string($description) . "', |
|
| 1438 | - parent_item_id = " . $parent . ", |
|
| 1439 | - previous_item_id = " . $previous . ", |
|
| 1440 | - next_item_id = " . $new_next . ", |
|
| 1441 | - display_order = " . $new_order . " |
|
| 1442 | - " . $audio_update_sql . " |
|
| 1443 | - WHERE c_id = ".$course_id." AND id = " . $id; |
|
| 1436 | + title = '" . Database::escape_string($title)."', |
|
| 1437 | + description = '" . Database::escape_string($description)."', |
|
| 1438 | + parent_item_id = " . $parent.", |
|
| 1439 | + previous_item_id = " . $previous.", |
|
| 1440 | + next_item_id = " . $new_next.", |
|
| 1441 | + display_order = " . $new_order." |
|
| 1442 | + " . $audio_update_sql." |
|
| 1443 | + WHERE c_id = ".$course_id." AND id = ".$id; |
|
| 1444 | 1444 | Database::query($sql); |
| 1445 | 1445 | |
| 1446 | 1446 | if ($previous != 0) { |
| 1447 | 1447 | // Update the previous item's next_item_id. |
| 1448 | - $sql = "UPDATE " . $tbl_lp_item . " |
|
| 1449 | - SET next_item_id = " . $id . " |
|
| 1450 | - WHERE c_id = ".$course_id." AND id = " . $previous; |
|
| 1448 | + $sql = "UPDATE ".$tbl_lp_item." |
|
| 1449 | + SET next_item_id = " . $id." |
|
| 1450 | + WHERE c_id = ".$course_id." AND id = ".$previous; |
|
| 1451 | 1451 | Database::query($sql); |
| 1452 | 1452 | } |
| 1453 | 1453 | |
| 1454 | 1454 | if ($new_next != 0) { |
| 1455 | 1455 | // Update the next item's previous_item_id. |
| 1456 | - $sql = "UPDATE " . $tbl_lp_item . " |
|
| 1457 | - SET previous_item_id = " . $id . " |
|
| 1458 | - WHERE c_id = ".$course_id." AND id = " . $new_next; |
|
| 1456 | + $sql = "UPDATE ".$tbl_lp_item." |
|
| 1457 | + SET previous_item_id = " . $id." |
|
| 1458 | + WHERE c_id = ".$course_id." AND id = ".$new_next; |
|
| 1459 | 1459 | Database::query($sql); |
| 1460 | 1460 | } |
| 1461 | 1461 | |
| 1462 | 1462 | if ($old_prerequisite != $prerequisites) { |
| 1463 | - $sql = "UPDATE " . $tbl_lp_item . " |
|
| 1464 | - SET prerequisite = '" . $prerequisites . "' |
|
| 1465 | - WHERE c_id = ".$course_id." AND id = " . $id; |
|
| 1463 | + $sql = "UPDATE ".$tbl_lp_item." |
|
| 1464 | + SET prerequisite = '" . $prerequisites."' |
|
| 1465 | + WHERE c_id = ".$course_id." AND id = ".$id; |
|
| 1466 | 1466 | Database::query($sql); |
| 1467 | 1467 | } |
| 1468 | 1468 | |
| 1469 | 1469 | if ($old_max_time_allowed != $max_time_allowed) { |
| 1470 | 1470 | // update max time allowed |
| 1471 | - $sql = "UPDATE " . $tbl_lp_item . " |
|
| 1472 | - SET max_time_allowed = " . $max_time_allowed . " |
|
| 1473 | - WHERE c_id = ".$course_id." AND id = " . $id; |
|
| 1471 | + $sql = "UPDATE ".$tbl_lp_item." |
|
| 1472 | + SET max_time_allowed = " . $max_time_allowed." |
|
| 1473 | + WHERE c_id = ".$course_id." AND id = ".$id; |
|
| 1474 | 1474 | Database::query($sql); |
| 1475 | 1475 | } |
| 1476 | 1476 | |
| 1477 | 1477 | // Update all the items with the same or a bigger display_order than the current item. |
| 1478 | - $sql = "UPDATE " . $tbl_lp_item . " |
|
| 1478 | + $sql = "UPDATE ".$tbl_lp_item." |
|
| 1479 | 1479 | SET display_order = display_order + 1 |
| 1480 | 1480 | WHERE |
| 1481 | 1481 | c_id = ".$course_id." AND |
| 1482 | - lp_id = " . $this->get_id() . " AND |
|
| 1483 | - id <> " . $id . " AND |
|
| 1484 | - parent_item_id = " . $parent . " AND |
|
| 1482 | + lp_id = " . $this->get_id()." AND |
|
| 1483 | + id <> " . $id." AND |
|
| 1484 | + parent_item_id = " . $parent." AND |
|
| 1485 | 1485 | display_order >= " . $new_order; |
| 1486 | 1486 | |
| 1487 | 1487 | Database::query($sql); |
@@ -1507,7 +1507,7 @@ discard block |
||
| 1507 | 1507 | { |
| 1508 | 1508 | $course_id = api_get_course_int_id(); |
| 1509 | 1509 | if ($this->debug > 0) { |
| 1510 | - error_log('New LP - In learnpath::edit_item_prereq(' . $id . ',' . $prerequisite_id . ',' . $mastery_score . ',' . $max_score . ')', 0); |
|
| 1510 | + error_log('New LP - In learnpath::edit_item_prereq('.$id.','.$prerequisite_id.','.$mastery_score.','.$max_score.')', 0); |
|
| 1511 | 1511 | } |
| 1512 | 1512 | |
| 1513 | 1513 | if (empty($id) || ($id != strval(intval($id))) || empty ($prerequisite_id)) { |
@@ -1596,7 +1596,7 @@ discard block |
||
| 1596 | 1596 | |
| 1597 | 1597 | if (empty($id) || $id != strval(intval($id))) { |
| 1598 | 1598 | |
| 1599 | - return array (); |
|
| 1599 | + return array(); |
|
| 1600 | 1600 | } |
| 1601 | 1601 | |
| 1602 | 1602 | $lp_item = Database :: get_course_table(TABLE_LP_ITEM); |
@@ -1636,7 +1636,7 @@ discard block |
||
| 1636 | 1636 | { |
| 1637 | 1637 | $course_id = api_get_course_int_id(); |
| 1638 | 1638 | if ($this->debug > 0) { |
| 1639 | - error_log('New LP - In learnpath::get_brother_items(' . $id . ')', 0); |
|
| 1639 | + error_log('New LP - In learnpath::get_brother_items('.$id.')', 0); |
|
| 1640 | 1640 | } |
| 1641 | 1641 | |
| 1642 | 1642 | if (empty ($id) || $id != strval(intval($id))) { |
@@ -1652,13 +1652,13 @@ discard block |
||
| 1652 | 1652 | $sql_bros = "SELECT * FROM $lp_item WHERE c_id = ".$course_id." AND parent_item_id = $parent |
| 1653 | 1653 | ORDER BY display_order"; |
| 1654 | 1654 | $res_bros = Database::query($sql_bros); |
| 1655 | - $list = array (); |
|
| 1655 | + $list = array(); |
|
| 1656 | 1656 | while ($row_bro = Database :: fetch_array($res_bros)) { |
| 1657 | 1657 | $list[] = $row_bro; |
| 1658 | 1658 | } |
| 1659 | 1659 | return $list; |
| 1660 | 1660 | } |
| 1661 | - return array (); |
|
| 1661 | + return array(); |
|
| 1662 | 1662 | } |
| 1663 | 1663 | |
| 1664 | 1664 | /** |
@@ -1731,7 +1731,7 @@ discard block |
||
| 1731 | 1731 | $current = $this->current; |
| 1732 | 1732 | } |
| 1733 | 1733 | if ($this->debug > 2) { |
| 1734 | - error_log('New LP - In learnpath::get_current_item_id() - Returning ' . $current, 0); |
|
| 1734 | + error_log('New LP - In learnpath::get_current_item_id() - Returning '.$current, 0); |
|
| 1735 | 1735 | } |
| 1736 | 1736 | return $current; |
| 1737 | 1737 | } |
@@ -1810,7 +1810,7 @@ discard block |
||
| 1810 | 1810 | //&& !$this->items[$this->last_item_seen]->is_done() |
| 1811 | 1811 | ) { |
| 1812 | 1812 | if ($this->debug > 2) { |
| 1813 | - error_log('New LP - In learnpath::first() - Last item seen is ' . $this->last_item_seen.' of type '.$this->items[$this->last_item_seen]->get_type(), 0); |
|
| 1813 | + error_log('New LP - In learnpath::first() - Last item seen is '.$this->last_item_seen.' of type '.$this->items[$this->last_item_seen]->get_type(), 0); |
|
| 1814 | 1814 | } |
| 1815 | 1815 | $index = -1; |
| 1816 | 1816 | foreach ($this->ordered_items as $myindex => $item_id) { |
@@ -1822,7 +1822,7 @@ discard block |
||
| 1822 | 1822 | if ($index == -1) { |
| 1823 | 1823 | // Index hasn't changed, so item not found - panic (this shouldn't happen). |
| 1824 | 1824 | if ($this->debug > 2) { |
| 1825 | - error_log('New LP - Last item (' . $this->last_item_seen . ') was found in items but not in ordered_items, panic!', 0); |
|
| 1825 | + error_log('New LP - Last item ('.$this->last_item_seen.') was found in items but not in ordered_items, panic!', 0); |
|
| 1826 | 1826 | } |
| 1827 | 1827 | return false; |
| 1828 | 1828 | } else { |
@@ -1837,7 +1837,7 @@ discard block |
||
| 1837 | 1837 | $index = 0; |
| 1838 | 1838 | // Loop through all ordered items and stop at the first item that is |
| 1839 | 1839 | // not a directory *and* that has not been completed yet. |
| 1840 | - while ( !empty($this->ordered_items[$index]) AND |
|
| 1840 | + while (!empty($this->ordered_items[$index]) AND |
|
| 1841 | 1841 | is_a($this->items[$this->ordered_items[$index]], 'learnpathItem') AND |
| 1842 | 1842 | ( |
| 1843 | 1843 | $this->items[$this->ordered_items[$index]]->get_type() == 'dir' OR |
@@ -1850,14 +1850,14 @@ discard block |
||
| 1850 | 1850 | $this->current = isset($this->ordered_items[$index]) ? $this->ordered_items[$index] : null; |
| 1851 | 1851 | $this->index = $index; |
| 1852 | 1852 | if ($this->debug > 2) { |
| 1853 | - error_log('$index ' . $index); |
|
| 1853 | + error_log('$index '.$index); |
|
| 1854 | 1854 | } |
| 1855 | 1855 | if ($this->debug > 2) { |
| 1856 | - error_log('New LP - In learnpath::first() - No last item seen. New last = ' . $this->last . '(' . $this->ordered_items[$index] . ')', 0); |
|
| 1856 | + error_log('New LP - In learnpath::first() - No last item seen. New last = '.$this->last.'('.$this->ordered_items[$index].')', 0); |
|
| 1857 | 1857 | } |
| 1858 | 1858 | } |
| 1859 | 1859 | if ($this->debug > 2) { |
| 1860 | - error_log('New LP - In learnpath::first() - First item is ' . $this->get_current_item_id()); |
|
| 1860 | + error_log('New LP - In learnpath::first() - First item is '.$this->get_current_item_id()); |
|
| 1861 | 1861 | } |
| 1862 | 1862 | } |
| 1863 | 1863 | |
@@ -1870,7 +1870,7 @@ discard block |
||
| 1870 | 1870 | public function get_js_info($item_id = 0) |
| 1871 | 1871 | { |
| 1872 | 1872 | if ($this->debug > 0) { |
| 1873 | - error_log('New LP - In learnpath::get_js_info(' . $item_id . ')', 0); |
|
| 1873 | + error_log('New LP - In learnpath::get_js_info('.$item_id.')', 0); |
|
| 1874 | 1874 | } |
| 1875 | 1875 | |
| 1876 | 1876 | $info = ''; |
@@ -1880,34 +1880,34 @@ discard block |
||
| 1880 | 1880 | //if item is defined, return values from DB |
| 1881 | 1881 | $oItem = $this->items[$item_id]; |
| 1882 | 1882 | $info .= '<script language="javascript">'; |
| 1883 | - $info .= "top.set_score(" . $oItem->get_score() . ");\n"; |
|
| 1884 | - $info .= "top.set_max(" . $oItem->get_max() . ");\n"; |
|
| 1885 | - $info .= "top.set_min(" . $oItem->get_min() . ");\n"; |
|
| 1886 | - $info .= "top.set_lesson_status('" . $oItem->get_status() . "');"; |
|
| 1887 | - $info .= "top.set_session_time('" . $oItem->get_scorm_time('js') . "');"; |
|
| 1888 | - $info .= "top.set_suspend_data('" . $oItem->get_suspend_data() . "');"; |
|
| 1889 | - $info .= "top.set_saved_lesson_status('" . $oItem->get_status() . "');"; |
|
| 1883 | + $info .= "top.set_score(".$oItem->get_score().");\n"; |
|
| 1884 | + $info .= "top.set_max(".$oItem->get_max().");\n"; |
|
| 1885 | + $info .= "top.set_min(".$oItem->get_min().");\n"; |
|
| 1886 | + $info .= "top.set_lesson_status('".$oItem->get_status()."');"; |
|
| 1887 | + $info .= "top.set_session_time('".$oItem->get_scorm_time('js')."');"; |
|
| 1888 | + $info .= "top.set_suspend_data('".$oItem->get_suspend_data()."');"; |
|
| 1889 | + $info .= "top.set_saved_lesson_status('".$oItem->get_status()."');"; |
|
| 1890 | 1890 | $info .= "top.set_flag_synchronized();"; |
| 1891 | 1891 | $info .= '</script>'; |
| 1892 | 1892 | if ($this->debug > 2) { |
| 1893 | - error_log('New LP - in learnpath::get_js_info(' . $item_id . ') - returning: ' . $info, 0); |
|
| 1893 | + error_log('New LP - in learnpath::get_js_info('.$item_id.') - returning: '.$info, 0); |
|
| 1894 | 1894 | } |
| 1895 | 1895 | return $info; |
| 1896 | 1896 | |
| 1897 | 1897 | } else { |
| 1898 | 1898 | // If item_id is empty, just update to default SCORM data. |
| 1899 | 1899 | $info .= '<script language="javascript">'; |
| 1900 | - $info .= "top.set_score(" . learnpathItem :: get_score() . ");\n"; |
|
| 1901 | - $info .= "top.set_max(" . learnpathItem :: get_max() . ");\n"; |
|
| 1902 | - $info .= "top.set_min(" . learnpathItem :: get_min() . ");\n"; |
|
| 1903 | - $info .= "top.set_lesson_status('" . learnpathItem :: get_status() . "');"; |
|
| 1904 | - $info .= "top.set_session_time('" . learnpathItem :: getScormTimeFromParameter('js') . "');"; |
|
| 1905 | - $info .= "top.set_suspend_data('" . learnpathItem :: get_suspend_data() . "');"; |
|
| 1906 | - $info .= "top.set_saved_lesson_status('" . learnpathItem :: get_status() . "');"; |
|
| 1900 | + $info .= "top.set_score(".learnpathItem :: get_score().");\n"; |
|
| 1901 | + $info .= "top.set_max(".learnpathItem :: get_max().");\n"; |
|
| 1902 | + $info .= "top.set_min(".learnpathItem :: get_min().");\n"; |
|
| 1903 | + $info .= "top.set_lesson_status('".learnpathItem :: get_status()."');"; |
|
| 1904 | + $info .= "top.set_session_time('".learnpathItem :: getScormTimeFromParameter('js')."');"; |
|
| 1905 | + $info .= "top.set_suspend_data('".learnpathItem :: get_suspend_data()."');"; |
|
| 1906 | + $info .= "top.set_saved_lesson_status('".learnpathItem :: get_status()."');"; |
|
| 1907 | 1907 | $info .= "top.set_flag_synchronized();"; |
| 1908 | 1908 | $info .= '</script>'; |
| 1909 | 1909 | if ($this->debug > 2) { |
| 1910 | - error_log('New LP - in learnpath::get_js_info(' . $item_id . ') - returning: ' . $info, 0); |
|
| 1910 | + error_log('New LP - in learnpath::get_js_info('.$item_id.') - returning: '.$info, 0); |
|
| 1911 | 1911 | } |
| 1912 | 1912 | return $info; |
| 1913 | 1913 | } |
@@ -1965,8 +1965,8 @@ discard block |
||
| 1965 | 1965 | if ($this->debug > 0) { |
| 1966 | 1966 | error_log('New LP - In learnpath::get_navigation_bar()', 0); |
| 1967 | 1967 | } |
| 1968 | - if(empty($idBar)){ |
|
| 1969 | - $idBar='control-top'; |
|
| 1968 | + if (empty($idBar)) { |
|
| 1969 | + $idBar = 'control-top'; |
|
| 1970 | 1970 | } |
| 1971 | 1971 | /* if(empty($display)){ |
| 1972 | 1972 | $display='display:block'; |
@@ -1979,16 +1979,16 @@ discard block |
||
| 1979 | 1979 | $navbar = ' |
| 1980 | 1980 | <span id="'.$idBar.'" class="buttons"> |
| 1981 | 1981 | <a class="icon-toolbar" href="lp_controller.php?action=stats&'.api_get_cidreq(true).'&lp_id='.$lp_id.'" onclick="window.parent.API.save_asset();return true;" target="content_name" title="stats" id="stats_link"> |
| 1982 | - <span class="fa fa-info"></span><span class="sr-only">' . get_lang('Reporting') . '</span> |
|
| 1982 | + <span class="fa fa-info"></span><span class="sr-only">' . get_lang('Reporting').'</span> |
|
| 1983 | 1983 | </a> |
| 1984 | - <a class="icon-toolbar" id="scorm-previous" href="#" onclick="switch_item(' . $mycurrentitemid . ',\'previous\');return false;" title="previous"> |
|
| 1985 | - <span class="fa fa-chevron-left"></span><span class="sr-only">' . get_lang('ScormPrevious') . '</span> |
|
| 1984 | + <a class="icon-toolbar" id="scorm-previous" href="#" onclick="switch_item(' . $mycurrentitemid.',\'previous\');return false;" title="previous"> |
|
| 1985 | + <span class="fa fa-chevron-left"></span><span class="sr-only">' . get_lang('ScormPrevious').'</span> |
|
| 1986 | 1986 | </a> |
| 1987 | - <a class="icon-toolbar" id="scorm-next" href="#" onclick="switch_item(' . $mycurrentitemid . ',\'next\');return false;" title="next"> |
|
| 1988 | - <span class="fa fa-chevron-right"></span><span class="sr-only">' . get_lang('ScormNext') . '</span> |
|
| 1987 | + <a class="icon-toolbar" id="scorm-next" href="#" onclick="switch_item(' . $mycurrentitemid.',\'next\');return false;" title="next"> |
|
| 1988 | + <span class="fa fa-chevron-right"></span><span class="sr-only">' . get_lang('ScormNext').'</span> |
|
| 1989 | 1989 | </a> |
| 1990 | 1990 | <a class="icon-toolbar" id="view-embedded" href="lp_controller.php?action=mode&mode=embedded" target="_top" title="embedded mode"> |
| 1991 | - <span class="fa fa-columns"></span><span class="sr-only">' . get_lang('ScormExitFullScreen') . '</span> |
|
| 1991 | + <span class="fa fa-columns"></span><span class="sr-only">' . get_lang('ScormExitFullScreen').'</span> |
|
| 1992 | 1992 | </a> |
| 1993 | 1993 | </span>'; |
| 1994 | 1994 | |
@@ -1996,13 +1996,13 @@ discard block |
||
| 1996 | 1996 | $navbar = ' |
| 1997 | 1997 | <span id="'.$idBar.'" class="buttons text-right"> |
| 1998 | 1998 | <a class="icon-toolbar" href="lp_controller.php?action=stats&'.api_get_cidreq(true).'&lp_id='.$lp_id.'" onclick="window.parent.API.save_asset();return true;" target="content_name" title="stats" id="stats_link"> |
| 1999 | - <span class="fa fa-info"></span><span class="sr-only">' . get_lang('Reporting') . '</span> |
|
| 1999 | + <span class="fa fa-info"></span><span class="sr-only">' . get_lang('Reporting').'</span> |
|
| 2000 | 2000 | </a> |
| 2001 | - <a class="icon-toolbar" id="scorm-previous" href="#" onclick="switch_item(' . $mycurrentitemid . ',\'previous\');return false;" title="previous"> |
|
| 2002 | - <span class="fa fa-chevron-left"></span><span class="sr-only">' . get_lang('ScormPrevious') . '</span> |
|
| 2001 | + <a class="icon-toolbar" id="scorm-previous" href="#" onclick="switch_item(' . $mycurrentitemid.',\'previous\');return false;" title="previous"> |
|
| 2002 | + <span class="fa fa-chevron-left"></span><span class="sr-only">' . get_lang('ScormPrevious').'</span> |
|
| 2003 | 2003 | </a> |
| 2004 | - <a class="icon-toolbar" id="scorm-next" href="#" onclick="switch_item(' . $mycurrentitemid . ',\'next\');return false;" title="next"> |
|
| 2005 | - <span class="fa fa-chevron-right"></span><span class="sr-only">' . get_lang('ScormNext') . '</span> |
|
| 2004 | + <a class="icon-toolbar" id="scorm-next" href="#" onclick="switch_item(' . $mycurrentitemid.',\'next\');return false;" title="next"> |
|
| 2005 | + <span class="fa fa-chevron-right"></span><span class="sr-only">' . get_lang('ScormNext').'</span> |
|
| 2006 | 2006 | </a> |
| 2007 | 2007 | </span>'; |
| 2008 | 2008 | } |
@@ -2023,11 +2023,11 @@ discard block |
||
| 2023 | 2023 | $index = $this->index; |
| 2024 | 2024 | $index++; |
| 2025 | 2025 | if ($this->debug > 2) { |
| 2026 | - error_log('New LP - Now looking at ordered_items[' . ($index) . '] - type is ' . $this->items[$this->ordered_items[$index]]->type, 0); |
|
| 2026 | + error_log('New LP - Now looking at ordered_items['.($index).'] - type is '.$this->items[$this->ordered_items[$index]]->type, 0); |
|
| 2027 | 2027 | } |
| 2028 | 2028 | while (!empty ($this->ordered_items[$index]) AND ($this->items[$this->ordered_items[$index]]->get_type() == 'dir') AND $index < $this->max_ordered_items) { |
| 2029 | 2029 | $index++; |
| 2030 | - if ($index == $this->max_ordered_items){ |
|
| 2030 | + if ($index == $this->max_ordered_items) { |
|
| 2031 | 2031 | if ($this->items[$this->ordered_items[$index]]->get_type() == 'dir') { |
| 2032 | 2032 | return $this->index; |
| 2033 | 2033 | } else { |
@@ -2039,7 +2039,7 @@ discard block |
||
| 2039 | 2039 | return $this->index; |
| 2040 | 2040 | } |
| 2041 | 2041 | if ($this->debug > 2) { |
| 2042 | - error_log('New LP - index is now ' . $index, 0); |
|
| 2042 | + error_log('New LP - index is now '.$index, 0); |
|
| 2043 | 2043 | } |
| 2044 | 2044 | return $index; |
| 2045 | 2045 | } |
@@ -2057,7 +2057,7 @@ discard block |
||
| 2057 | 2057 | if (!empty ($new_index)) { |
| 2058 | 2058 | if (isset ($this->ordered_items[$new_index])) { |
| 2059 | 2059 | if ($this->debug > 2) { |
| 2060 | - error_log('New LP - In learnpath::get_next_index() - Returning ' . $this->ordered_items[$new_index], 0); |
|
| 2060 | + error_log('New LP - In learnpath::get_next_index() - Returning '.$this->ordered_items[$new_index], 0); |
|
| 2061 | 2061 | } |
| 2062 | 2062 | return $this->ordered_items[$new_index]; |
| 2063 | 2063 | } |
@@ -2120,7 +2120,7 @@ discard block |
||
| 2120 | 2120 | break; // Exit the foreach loop. |
| 2121 | 2121 | } elseif ( |
| 2122 | 2122 | preg_match('/aicc\//i', $thisContent['filename']) || |
| 2123 | - in_array(strtolower(pathinfo($thisContent['filename'], PATHINFO_EXTENSION)), array( 'crs','au','des','cst')) |
|
| 2123 | + in_array(strtolower(pathinfo($thisContent['filename'], PATHINFO_EXTENSION)), array('crs', 'au', 'des', 'cst')) |
|
| 2124 | 2124 | ) { |
| 2125 | 2125 | $ext = strtolower(pathinfo($thisContent['filename'], PATHINFO_EXTENSION)); |
| 2126 | 2126 | switch ($ext) { |
@@ -2162,7 +2162,7 @@ discard block |
||
| 2162 | 2162 | error_log('New LP - In learnpath::get_previous_index()', 0); |
| 2163 | 2163 | } |
| 2164 | 2164 | $index = $this->index; |
| 2165 | - if (isset ($this->ordered_items[$index -1])) { |
|
| 2165 | + if (isset ($this->ordered_items[$index - 1])) { |
|
| 2166 | 2166 | $index--; |
| 2167 | 2167 | while (isset($this->ordered_items[$index]) && ($this->items[$this->ordered_items[$index]]->get_type() == 'dir')) { |
| 2168 | 2168 | $index--; |
@@ -2172,7 +2172,7 @@ discard block |
||
| 2172 | 2172 | } |
| 2173 | 2173 | } else { |
| 2174 | 2174 | if ($this->debug > 2) { |
| 2175 | - error_log('New LP - get_previous_index() - there was no previous index available, reusing ' . $index, 0); |
|
| 2175 | + error_log('New LP - get_previous_index() - there was no previous index available, reusing '.$index, 0); |
|
| 2176 | 2176 | } |
| 2177 | 2177 | // There is no previous item. |
| 2178 | 2178 | } |
@@ -2215,8 +2215,8 @@ discard block |
||
| 2215 | 2215 | { |
| 2216 | 2216 | $course_id = api_get_course_int_id(); |
| 2217 | 2217 | $_course = api_get_course_info(); |
| 2218 | - $tbl_lp_item = Database :: get_course_table(TABLE_LP_ITEM); |
|
| 2219 | - $tbl_lp_item_view = Database :: get_course_table(TABLE_LP_ITEM_VIEW); |
|
| 2218 | + $tbl_lp_item = Database :: get_course_table(TABLE_LP_ITEM); |
|
| 2219 | + $tbl_lp_item_view = Database :: get_course_table(TABLE_LP_ITEM_VIEW); |
|
| 2220 | 2220 | |
| 2221 | 2221 | // Getting all the information about the item. |
| 2222 | 2222 | $sql = "SELECT * FROM $tbl_lp_item as lp |
@@ -2227,15 +2227,15 @@ discard block |
||
| 2227 | 2227 | lp.c_id = $course_id AND |
| 2228 | 2228 | lp_view.c_id = $course_id"; |
| 2229 | 2229 | $result = Database::query($sql); |
| 2230 | - $row = Database::fetch_assoc($result); |
|
| 2230 | + $row = Database::fetch_assoc($result); |
|
| 2231 | 2231 | $output = ''; |
| 2232 | 2232 | |
| 2233 | 2233 | if (!empty ($row['audio'])) { |
| 2234 | 2234 | $list = $_SESSION['oLP']->get_toc(); |
| 2235 | 2235 | $type_quiz = false; |
| 2236 | 2236 | |
| 2237 | - foreach($list as $toc) { |
|
| 2238 | - if ($toc['id'] == $_SESSION['oLP']->current && ($toc['type']=='quiz') ) { |
|
| 2237 | + foreach ($list as $toc) { |
|
| 2238 | + if ($toc['id'] == $_SESSION['oLP']->current && ($toc['type'] == 'quiz')) { |
|
| 2239 | 2239 | $type_quiz = true; |
| 2240 | 2240 | } |
| 2241 | 2241 | } |
@@ -2297,7 +2297,7 @@ discard block |
||
| 2297 | 2297 | $courseCode = null, |
| 2298 | 2298 | $sessionId = null |
| 2299 | 2299 | ) { |
| 2300 | - $lp_id = (int)$lp_id; |
|
| 2300 | + $lp_id = (int) $lp_id; |
|
| 2301 | 2301 | $courseInfo = api_get_course_info($courseCode); |
| 2302 | 2302 | $sessionId = intval($sessionId); |
| 2303 | 2303 | |
@@ -2461,10 +2461,10 @@ discard block |
||
| 2461 | 2461 | */ |
| 2462 | 2462 | public static function get_progress_bar($percentage = -1, $text_add = '') |
| 2463 | 2463 | { |
| 2464 | - $text = $percentage . $text_add; |
|
| 2464 | + $text = $percentage.$text_add; |
|
| 2465 | 2465 | $output = '<div class="progress"> |
| 2466 | - <div id="progress_bar_value" class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="' .$percentage. '" aria-valuemin="0" aria-valuemax="100" style="width: '.$text.';"> |
|
| 2467 | - '. $text .' |
|
| 2466 | + <div id="progress_bar_value" class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="' .$percentage.'" aria-valuemin="0" aria-valuemax="100" style="width: '.$text.';"> |
|
| 2467 | + '. $text.' |
|
| 2468 | 2468 | </div> |
| 2469 | 2469 | </div>'; |
| 2470 | 2470 | |
@@ -2500,16 +2500,16 @@ discard block |
||
| 2500 | 2500 | } |
| 2501 | 2501 | $total_items = $this->getTotalItemsCountWithoutDirs(); |
| 2502 | 2502 | if ($this->debug > 2) { |
| 2503 | - error_log('New LP - Total items available in this learnpath: ' . $total_items, 0); |
|
| 2503 | + error_log('New LP - Total items available in this learnpath: '.$total_items, 0); |
|
| 2504 | 2504 | } |
| 2505 | 2505 | $completeItems = $this->get_complete_items_count(); |
| 2506 | 2506 | if ($this->debug > 2) { |
| 2507 | - error_log('New LP - Items completed so far: ' . $completeItems, 0); |
|
| 2507 | + error_log('New LP - Items completed so far: '.$completeItems, 0); |
|
| 2508 | 2508 | } |
| 2509 | 2509 | if ($add != 0) { |
| 2510 | 2510 | $completeItems += $add; |
| 2511 | 2511 | if ($this->debug > 2) { |
| 2512 | - error_log('New LP - Items completed so far (+modifier): ' . $completeItems, 0); |
|
| 2512 | + error_log('New LP - Items completed so far (+modifier): '.$completeItems, 0); |
|
| 2513 | 2513 | } |
| 2514 | 2514 | } |
| 2515 | 2515 | $text = ''; |
@@ -2527,7 +2527,7 @@ discard block |
||
| 2527 | 2527 | $text = '%'; |
| 2528 | 2528 | } elseif ($mode == 'abs') { |
| 2529 | 2529 | $percentage = $completeItems; |
| 2530 | - $text = '/' . $total_items; |
|
| 2530 | + $text = '/'.$total_items; |
|
| 2531 | 2531 | } |
| 2532 | 2532 | |
| 2533 | 2533 | return array( |
@@ -2723,7 +2723,7 @@ discard block |
||
| 2723 | 2723 | // and replace them, one by one, by the internal IDs (chamilo db) |
| 2724 | 2724 | // TODO: Modify the '*' replacement to replace the multiplier in front of it |
| 2725 | 2725 | // by a space as well. |
| 2726 | - $find = array ( |
|
| 2726 | + $find = array( |
|
| 2727 | 2727 | '&', |
| 2728 | 2728 | '|', |
| 2729 | 2729 | '~', |
@@ -2735,7 +2735,7 @@ discard block |
||
| 2735 | 2735 | '(', |
| 2736 | 2736 | ')' |
| 2737 | 2737 | ); |
| 2738 | - $replace = array ( |
|
| 2738 | + $replace = array( |
|
| 2739 | 2739 | ' ', |
| 2740 | 2740 | ' ', |
| 2741 | 2741 | ' ', |
@@ -2752,7 +2752,7 @@ discard block |
||
| 2752 | 2752 | foreach ($ids as $id) { |
| 2753 | 2753 | $id = trim($id); |
| 2754 | 2754 | if (isset ($this->refs_list[$id])) { |
| 2755 | - $prereq = preg_replace('/[^a-zA-Z_0-9](' . $id . ')[^a-zA-Z_0-9]/', 'ITEM_' . $this->refs_list[$id], $prereq); |
|
| 2755 | + $prereq = preg_replace('/[^a-zA-Z_0-9]('.$id.')[^a-zA-Z_0-9]/', 'ITEM_'.$this->refs_list[$id], $prereq); |
|
| 2756 | 2756 | } |
| 2757 | 2757 | } |
| 2758 | 2758 | |
@@ -2798,9 +2798,9 @@ discard block |
||
| 2798 | 2798 | if ($this->debug > 0) { |
| 2799 | 2799 | error_log('New LP - In learnpath::get_items_status_list()', 0); |
| 2800 | 2800 | } |
| 2801 | - $list = array (); |
|
| 2801 | + $list = array(); |
|
| 2802 | 2802 | foreach ($this->ordered_items as $item_id) { |
| 2803 | - $list[] = array ( |
|
| 2803 | + $list[] = array( |
|
| 2804 | 2804 | $item_id => $this->items[$item_id]->get_status() |
| 2805 | 2805 | ); |
| 2806 | 2806 | } |
@@ -2854,7 +2854,7 @@ discard block |
||
| 2854 | 2854 | $res = Database::query($sql); |
| 2855 | 2855 | $num = Database :: num_rows($res); |
| 2856 | 2856 | if ($num > 0) { |
| 2857 | - $list[] = array ( |
|
| 2857 | + $list[] = array( |
|
| 2858 | 2858 | 'order_id' => api_htmlentities(get_lang('Order'), ENT_QUOTES), |
| 2859 | 2859 | 'id' => api_htmlentities(get_lang('InteractionID'), ENT_QUOTES), |
| 2860 | 2860 | 'type' => api_htmlentities(get_lang('Type'), ENT_QUOTES), |
@@ -2865,7 +2865,7 @@ discard block |
||
| 2865 | 2865 | 'latency' => api_htmlentities(get_lang('LatencyTimeSpent'), ENT_QUOTES) |
| 2866 | 2866 | ); |
| 2867 | 2867 | while ($row = Database :: fetch_array($res)) { |
| 2868 | - $list[] = array ( |
|
| 2868 | + $list[] = array( |
|
| 2869 | 2869 | 'order_id' => ($row['order_id'] + 1), |
| 2870 | 2870 | 'id' => urldecode($row['interaction_id']), //urldecode because they often have %2F or stuff like that |
| 2871 | 2871 | 'type' => $row['interaction_type'], |
@@ -2933,7 +2933,7 @@ discard block |
||
| 2933 | 2933 | 'status' => api_htmlentities(get_lang('ObjectiveStatus'), ENT_QUOTES) |
| 2934 | 2934 | ); |
| 2935 | 2935 | while ($row = Database :: fetch_array($res)) { |
| 2936 | - $list[] = array ( |
|
| 2936 | + $list[] = array( |
|
| 2937 | 2937 | 'order_id' => ($row['order_id'] + 1), |
| 2938 | 2938 | 'objective_id' => urldecode($row['objective_id']), // urldecode() because they often have %2F or stuff like that. |
| 2939 | 2939 | 'score_raw' => $row['score_raw'], |
@@ -2960,7 +2960,7 @@ discard block |
||
| 2960 | 2960 | $toc = array(); |
| 2961 | 2961 | foreach ($this->ordered_items as $item_id) { |
| 2962 | 2962 | if ($this->debug > 2) { |
| 2963 | - error_log('learnpath::get_toc(): getting info for item ' . $item_id, 0); |
|
| 2963 | + error_log('learnpath::get_toc(): getting info for item '.$item_id, 0); |
|
| 2964 | 2964 | } |
| 2965 | 2965 | // TODO: Change this link generation and use new function instead. |
| 2966 | 2966 | $toc[] = array( |
@@ -2974,7 +2974,7 @@ discard block |
||
| 2974 | 2974 | ); |
| 2975 | 2975 | } |
| 2976 | 2976 | if ($this->debug > 2) { |
| 2977 | - error_log('New LP - In learnpath::get_toc() - TOC array: ' . print_r($toc, true), 0); |
|
| 2977 | + error_log('New LP - In learnpath::get_toc() - TOC array: '.print_r($toc, true), 0); |
|
| 2978 | 2978 | } |
| 2979 | 2979 | return $toc; |
| 2980 | 2980 | } |
@@ -2991,10 +2991,10 @@ discard block |
||
| 2991 | 2991 | } |
| 2992 | 2992 | $toc = $varname.' = new Array();'; |
| 2993 | 2993 | foreach ($this->ordered_items as $item_id) { |
| 2994 | - $toc.= $varname."['i$item_id'] = '".$this->items[$item_id]->get_type()."';"; |
|
| 2994 | + $toc .= $varname."['i$item_id'] = '".$this->items[$item_id]->get_type()."';"; |
|
| 2995 | 2995 | } |
| 2996 | 2996 | if ($this->debug > 2) { |
| 2997 | - error_log('New LP - In learnpath::get_items_details_as_js() - TOC array: ' . print_r($toc, true), 0); |
|
| 2997 | + error_log('New LP - In learnpath::get_items_details_as_js() - TOC array: '.print_r($toc, true), 0); |
|
| 2998 | 2998 | } |
| 2999 | 2999 | return $toc; |
| 3000 | 3000 | } |
@@ -3018,7 +3018,7 @@ discard block |
||
| 3018 | 3018 | } |
| 3019 | 3019 | } |
| 3020 | 3020 | if ($this->debug > 2) { |
| 3021 | - error_log('New LP - In learnpath::get_type() - Returning ' . ($res ? $res : 'false'), 0); |
|
| 3021 | + error_log('New LP - In learnpath::get_type() - Returning '.($res ? $res : 'false'), 0); |
|
| 3022 | 3022 | } |
| 3023 | 3023 | return $res; |
| 3024 | 3024 | } |
@@ -3034,7 +3034,7 @@ discard block |
||
| 3034 | 3034 | $tbl_lp = Database :: get_course_table(TABLE_LP_MAIN); |
| 3035 | 3035 | $lp_id = intval($lp_id); |
| 3036 | 3036 | $sql = "SELECT lp_type FROM $tbl_lp |
| 3037 | - WHERE c_id = $course_id AND id = '" . $lp_id . "'"; |
|
| 3037 | + WHERE c_id = $course_id AND id = '".$lp_id."'"; |
|
| 3038 | 3038 | $res = Database::query($sql); |
| 3039 | 3039 | if ($res === false) { |
| 3040 | 3040 | return null; |
@@ -3131,7 +3131,7 @@ discard block |
||
| 3131 | 3131 | $dirTypes = self::getChapterTypes(); |
| 3132 | 3132 | |
| 3133 | 3133 | if (in_array($item['type'], $dirTypes)) { |
| 3134 | - $rowColor ='scorm_item_section '; |
|
| 3134 | + $rowColor = 'scorm_item_section '; |
|
| 3135 | 3135 | } |
| 3136 | 3136 | if ($item['id'] == $this->current) { |
| 3137 | 3137 | $rowColor = 'scorm_item_normal '.$rowColor.' scorm_highlight'; |
@@ -3139,7 +3139,7 @@ discard block |
||
| 3139 | 3139 | $rowColor = 'scorm_item_normal '.$rowColor.' '; |
| 3140 | 3140 | } |
| 3141 | 3141 | |
| 3142 | - $html .= '<div id="toc_' . $item['id'] . '" class="' . $rowColor . ' ' . $class_name[$item['status']] . '">'; |
|
| 3142 | + $html .= '<div id="toc_'.$item['id'].'" class="'.$rowColor.' '.$class_name[$item['status']].'">'; |
|
| 3143 | 3143 | |
| 3144 | 3144 | // Learning path title |
| 3145 | 3145 | $title = $item['title']; |
@@ -3169,7 +3169,7 @@ discard block |
||
| 3169 | 3169 | $html .= stripslashes($title); |
| 3170 | 3170 | } else { |
| 3171 | 3171 | $this->get_link('http', $item['id'], $toc_list); |
| 3172 | - $html .= '<a class="items-list" href="#" onclick="switch_item(' .$mycurrentitemid . ',' .$item['id'] . ');' .'return false;" >' . stripslashes($title) . '</a>'; |
|
| 3172 | + $html .= '<a class="items-list" href="#" onclick="switch_item('.$mycurrentitemid.','.$item['id'].');'.'return false;" >'.stripslashes($title).'</a>'; |
|
| 3173 | 3173 | } |
| 3174 | 3174 | $html .= "</div>"; |
| 3175 | 3175 | |
@@ -3203,12 +3203,12 @@ discard block |
||
| 3203 | 3203 | if ($this->get_lp_session_id() == api_get_session_id()) { |
| 3204 | 3204 | $html .= '<div id="actions_lp" class="actions_lp"><hr>'; |
| 3205 | 3205 | $html .= '<div class="btn-group">'; |
| 3206 | - $html .= "<a class='btn btn-sm btn-default' href='lp_controller.php?" . api_get_cidreq()."&gradebook=$gradebook&action=build&lp_id=" . $this->lp_id . "&isStudentView=false' target='_parent'>" . |
|
| 3207 | - Display::returnFontAwesomeIcon('street-view') . get_lang('Overview') . "</a>"; |
|
| 3208 | - $html .= "<a class='btn btn-sm btn-default' href='lp_controller.php?" . api_get_cidreq()."&action=add_item&type=step&lp_id=" . $this->lp_id . "&isStudentView=false' target='_parent'>" . |
|
| 3209 | - Display::returnFontAwesomeIcon('pencil') . get_lang('Edit') . "</a>"; |
|
| 3210 | - $html .= '<a class="btn btn-sm btn-default" href="lp_controller.php?'.api_get_cidreq()."&gradebook=$gradebook&action=edit&lp_id=" . $this->lp_id.'&isStudentView=false">' . |
|
| 3211 | - Display::returnFontAwesomeIcon('cog') . get_lang('Settings').'</a>'; |
|
| 3206 | + $html .= "<a class='btn btn-sm btn-default' href='lp_controller.php?".api_get_cidreq()."&gradebook=$gradebook&action=build&lp_id=".$this->lp_id."&isStudentView=false' target='_parent'>". |
|
| 3207 | + Display::returnFontAwesomeIcon('street-view').get_lang('Overview')."</a>"; |
|
| 3208 | + $html .= "<a class='btn btn-sm btn-default' href='lp_controller.php?".api_get_cidreq()."&action=add_item&type=step&lp_id=".$this->lp_id."&isStudentView=false' target='_parent'>". |
|
| 3209 | + Display::returnFontAwesomeIcon('pencil').get_lang('Edit')."</a>"; |
|
| 3210 | + $html .= '<a class="btn btn-sm btn-default" href="lp_controller.php?'.api_get_cidreq()."&gradebook=$gradebook&action=edit&lp_id=".$this->lp_id.'&isStudentView=false">'. |
|
| 3211 | + Display::returnFontAwesomeIcon('cog').get_lang('Settings').'</a>'; |
|
| 3212 | 3212 | $html .= '</div>'; |
| 3213 | 3213 | $html .= '</div>'; |
| 3214 | 3214 | } |
@@ -3260,11 +3260,11 @@ discard block |
||
| 3260 | 3260 | $course_id = $this->get_course_int_id(); |
| 3261 | 3261 | |
| 3262 | 3262 | if ($this->debug > 0) { |
| 3263 | - error_log('New LP - In learnpath::get_link(' . $type . ',' . $item_id . ')', 0); |
|
| 3263 | + error_log('New LP - In learnpath::get_link('.$type.','.$item_id.')', 0); |
|
| 3264 | 3264 | } |
| 3265 | 3265 | if (empty($item_id)) { |
| 3266 | 3266 | if ($this->debug > 2) { |
| 3267 | - error_log('New LP - In learnpath::get_link() - no item id given in learnpath::get_link(), using current: ' . $this->get_current_item_id(), 0); |
|
| 3267 | + error_log('New LP - In learnpath::get_link() - no item id given in learnpath::get_link(), using current: '.$this->get_current_item_id(), 0); |
|
| 3268 | 3268 | } |
| 3269 | 3269 | $item_id = $this->get_current_item_id(); |
| 3270 | 3270 | } |
@@ -3296,7 +3296,7 @@ discard block |
||
| 3296 | 3296 | ON (li.lp_id = l.id AND l.c_id = $course_id AND li.c_id = $course_id ) |
| 3297 | 3297 | WHERE li.id = $item_id "; |
| 3298 | 3298 | if ($this->debug > 2) { |
| 3299 | - error_log('New LP - In learnpath::get_link() - selecting item ' . $sql, 0); |
|
| 3299 | + error_log('New LP - In learnpath::get_link() - selecting item '.$sql, 0); |
|
| 3300 | 3300 | } |
| 3301 | 3301 | $res = Database::query($sql); |
| 3302 | 3302 | if (Database :: num_rows($res) > 0) { |
@@ -3310,9 +3310,9 @@ discard block |
||
| 3310 | 3310 | if (empty($lp_item_params) && strpos($lp_item_path, '?') !== false) { |
| 3311 | 3311 | list($lp_item_path, $lp_item_params) = explode('?', $lp_item_path); |
| 3312 | 3312 | } |
| 3313 | - $sys_course_path = api_get_path(SYS_COURSE_PATH) . api_get_course_path(); |
|
| 3313 | + $sys_course_path = api_get_path(SYS_COURSE_PATH).api_get_course_path(); |
|
| 3314 | 3314 | if ($type == 'http') { |
| 3315 | - $course_path = api_get_path(WEB_COURSE_PATH) . api_get_course_path(); //web path |
|
| 3315 | + $course_path = api_get_path(WEB_COURSE_PATH).api_get_course_path(); //web path |
|
| 3316 | 3316 | } else { |
| 3317 | 3317 | $course_path = $sys_course_path; //system path |
| 3318 | 3318 | } |
@@ -3323,8 +3323,8 @@ discard block |
||
| 3323 | 3323 | } |
| 3324 | 3324 | |
| 3325 | 3325 | if ($this->debug > 2) { |
| 3326 | - error_log('New LP - In learnpath::get_link() - $lp_type ' . $lp_type, 0); |
|
| 3327 | - error_log('New LP - In learnpath::get_link() - $lp_item_type ' . $lp_item_type, 0); |
|
| 3326 | + error_log('New LP - In learnpath::get_link() - $lp_type '.$lp_type, 0); |
|
| 3327 | + error_log('New LP - In learnpath::get_link() - $lp_item_type '.$lp_item_type, 0); |
|
| 3328 | 3328 | } |
| 3329 | 3329 | |
| 3330 | 3330 | // Now go through the specific cases to get the end of the path |
@@ -3338,7 +3338,7 @@ discard block |
||
| 3338 | 3338 | $this->get_view_id() |
| 3339 | 3339 | ); |
| 3340 | 3340 | if ($this->debug > 0) { |
| 3341 | - error_log('rl_get_resource_link_for_learnpath - file: ' . $file, 0); |
|
| 3341 | + error_log('rl_get_resource_link_for_learnpath - file: '.$file, 0); |
|
| 3342 | 3342 | } |
| 3343 | 3343 | |
| 3344 | 3344 | switch ($lp_item_type) { |
@@ -3348,10 +3348,10 @@ discard block |
||
| 3348 | 3348 | case 'link': |
| 3349 | 3349 | if (Link::is_youtube_link($file)) { |
| 3350 | 3350 | $src = Link::get_youtube_video_id($file); |
| 3351 | - $file = api_get_path(WEB_CODE_PATH) . 'lp/embed.php?type=youtube&source='.$src; |
|
| 3351 | + $file = api_get_path(WEB_CODE_PATH).'lp/embed.php?type=youtube&source='.$src; |
|
| 3352 | 3352 | } elseif (Link::isVimeoLink($file)) { |
| 3353 | 3353 | $src = Link::getVimeoLinkId($file); |
| 3354 | - $file = api_get_path(WEB_CODE_PATH) . 'lp/embed.php?type=vimeo&source='.$src; |
|
| 3354 | + $file = api_get_path(WEB_CODE_PATH).'lp/embed.php?type=vimeo&source='.$src; |
|
| 3355 | 3355 | } else { |
| 3356 | 3356 | // If the current site is HTTPS and the link is |
| 3357 | 3357 | // HTTP, browsers will refuse opening the link |
@@ -3364,7 +3364,7 @@ discard block |
||
| 3364 | 3364 | //this is the special intervention case |
| 3365 | 3365 | $file = api_get_path( |
| 3366 | 3366 | WEB_CODE_PATH |
| 3367 | - ) . 'lp/embed.php?type=nonhttps&source='.urlencode($file); |
|
| 3367 | + ).'lp/embed.php?type=nonhttps&source='.urlencode($file); |
|
| 3368 | 3368 | } |
| 3369 | 3369 | } |
| 3370 | 3370 | } |
@@ -3410,7 +3410,7 @@ discard block |
||
| 3410 | 3410 | status='completed'"; |
| 3411 | 3411 | $result = Database::query($sql); |
| 3412 | 3412 | $row_count = Database:: fetch_row($result); |
| 3413 | - $count_item_view = (int)$row_count[0]; |
|
| 3413 | + $count_item_view = (int) $row_count[0]; |
|
| 3414 | 3414 | $not_multiple_attempt = 0; |
| 3415 | 3415 | if ($prevent_reinit === 1 && $count_item_view > 0) { |
| 3416 | 3416 | $not_multiple_attempt = 1; |
@@ -3429,7 +3429,7 @@ discard block |
||
| 3429 | 3429 | break; |
| 3430 | 3430 | case 2 : |
| 3431 | 3431 | if ($this->debug > 2) { |
| 3432 | - error_log('New LP - In learnpath::get_link() ' . __LINE__ . ' - Item type: ' . $lp_item_type, 0); |
|
| 3432 | + error_log('New LP - In learnpath::get_link() '.__LINE__.' - Item type: '.$lp_item_type, 0); |
|
| 3433 | 3433 | } |
| 3434 | 3434 | |
| 3435 | 3435 | if ($lp_item_type != 'dir') { |
@@ -3443,19 +3443,19 @@ discard block |
||
| 3443 | 3443 | //if ($this->prerequisites_match($item_id)) { |
| 3444 | 3444 | if (preg_match('#^[a-zA-Z]{2,5}://#', $lp_item_path) != 0) { |
| 3445 | 3445 | if ($this->debug > 2) { |
| 3446 | - error_log('New LP - In learnpath::get_link() ' . __LINE__ . ' - Found match for protocol in ' . $lp_item_path, 0); |
|
| 3446 | + error_log('New LP - In learnpath::get_link() '.__LINE__.' - Found match for protocol in '.$lp_item_path, 0); |
|
| 3447 | 3447 | } |
| 3448 | 3448 | // Distant url, return as is. |
| 3449 | 3449 | $file = $lp_item_path; |
| 3450 | 3450 | } else { |
| 3451 | 3451 | if ($this->debug > 2) { |
| 3452 | - error_log('New LP - In learnpath::get_link() ' . __LINE__ . ' - No starting protocol in ' . $lp_item_path, 0); |
|
| 3452 | + error_log('New LP - In learnpath::get_link() '.__LINE__.' - No starting protocol in '.$lp_item_path, 0); |
|
| 3453 | 3453 | } |
| 3454 | 3454 | // Prevent getting untranslatable urls. |
| 3455 | 3455 | $lp_item_path = preg_replace('/%2F/', '/', $lp_item_path); |
| 3456 | 3456 | $lp_item_path = preg_replace('/%3A/', ':', $lp_item_path); |
| 3457 | 3457 | // Prepare the path. |
| 3458 | - $file = $course_path . '/scorm/' . $lp_path . '/' . $lp_item_path; |
|
| 3458 | + $file = $course_path.'/scorm/'.$lp_path.'/'.$lp_item_path; |
|
| 3459 | 3459 | // TODO: Fix this for urls with protocol header. |
| 3460 | 3460 | $file = str_replace('//', '/', $file); |
| 3461 | 3461 | $file = str_replace(':/', '://', $file); |
@@ -3463,11 +3463,11 @@ discard block |
||
| 3463 | 3463 | $lp_path = substr($lp_path, 0, -1); |
| 3464 | 3464 | } |
| 3465 | 3465 | |
| 3466 | - if (!is_file(realpath($sys_course_path . '/scorm/' . $lp_path . '/' . $lp_item_path))) { |
|
| 3466 | + if (!is_file(realpath($sys_course_path.'/scorm/'.$lp_path.'/'.$lp_item_path))) { |
|
| 3467 | 3467 | // if file not found. |
| 3468 | 3468 | $decoded = html_entity_decode($lp_item_path); |
| 3469 | 3469 | list ($decoded) = explode('?', $decoded); |
| 3470 | - if (!is_file(realpath($sys_course_path . '/scorm/' . $lp_path . '/' . $decoded))) { |
|
| 3470 | + if (!is_file(realpath($sys_course_path.'/scorm/'.$lp_path.'/'.$decoded))) { |
|
| 3471 | 3471 | |
| 3472 | 3472 | $file = self::rl_get_resource_link_for_learnpath( |
| 3473 | 3473 | $course_id, |
@@ -3487,14 +3487,14 @@ discard block |
||
| 3487 | 3487 | } |
| 3488 | 3488 | } |
| 3489 | 3489 | } else { |
| 3490 | - $file = $course_path . '/scorm/' . $lp_path . '/' . $decoded; |
|
| 3490 | + $file = $course_path.'/scorm/'.$lp_path.'/'.$decoded; |
|
| 3491 | 3491 | } |
| 3492 | 3492 | } |
| 3493 | 3493 | } |
| 3494 | 3494 | |
| 3495 | 3495 | // We want to use parameters if they were defined in the imsmanifest |
| 3496 | 3496 | if (strpos($file, 'blank.php') === false) { |
| 3497 | - $file .= (strstr($file, '?') === false ? '?' : '') . $lp_item_params; |
|
| 3497 | + $file .= (strstr($file, '?') === false ? '?' : '').$lp_item_params; |
|
| 3498 | 3498 | } |
| 3499 | 3499 | } else { |
| 3500 | 3500 | $file = 'lp_content.php?type=dir'; |
@@ -3502,12 +3502,12 @@ discard block |
||
| 3502 | 3502 | break; |
| 3503 | 3503 | case 3 : |
| 3504 | 3504 | if ($this->debug > 2) { |
| 3505 | - error_log('New LP - In learnpath::get_link() ' . __LINE__ . ' - Item type: ' . $lp_item_type, 0); |
|
| 3505 | + error_log('New LP - In learnpath::get_link() '.__LINE__.' - Item type: '.$lp_item_type, 0); |
|
| 3506 | 3506 | } |
| 3507 | 3507 | // Formatting AICC HACP append URL. |
| 3508 | - $aicc_append = '?aicc_sid=' . urlencode(session_id()) . '&aicc_url=' . urlencode(api_get_path(WEB_CODE_PATH) . 'lp/aicc_hacp.php') . '&'; |
|
| 3508 | + $aicc_append = '?aicc_sid='.urlencode(session_id()).'&aicc_url='.urlencode(api_get_path(WEB_CODE_PATH).'lp/aicc_hacp.php').'&'; |
|
| 3509 | 3509 | if (!empty($lp_item_params)) { |
| 3510 | - $aicc_append .= $lp_item_params . '&'; |
|
| 3510 | + $aicc_append .= $lp_item_params.'&'; |
|
| 3511 | 3511 | } |
| 3512 | 3512 | if ($lp_item_type != 'dir') { |
| 3513 | 3513 | // Quite complex here: |
@@ -3519,7 +3519,7 @@ discard block |
||
| 3519 | 3519 | |
| 3520 | 3520 | if (preg_match('#^[a-zA-Z]{2,5}://#', $lp_item_path) != 0) { |
| 3521 | 3521 | if ($this->debug > 2) { |
| 3522 | - error_log('New LP - In learnpath::get_link() ' . __LINE__ . ' - Found match for protocol in ' . $lp_item_path, 0); |
|
| 3522 | + error_log('New LP - In learnpath::get_link() '.__LINE__.' - Found match for protocol in '.$lp_item_path, 0); |
|
| 3523 | 3523 | } |
| 3524 | 3524 | // Distant url, return as is. |
| 3525 | 3525 | $file = $lp_item_path; |
@@ -3532,19 +3532,19 @@ discard block |
||
| 3532 | 3532 | if (stripos($file, '<servername>') !== false) { |
| 3533 | 3533 | //$file = str_replace('<servername>',$course_path.'/scorm/'.$lp_path.'/',$lp_item_path); |
| 3534 | 3534 | $web_course_path = str_replace('https://', '', str_replace('http://', '', $course_path)); |
| 3535 | - $file = str_replace('<servername>', $web_course_path . '/scorm/' . $lp_path, $lp_item_path); |
|
| 3535 | + $file = str_replace('<servername>', $web_course_path.'/scorm/'.$lp_path, $lp_item_path); |
|
| 3536 | 3536 | } |
| 3537 | 3537 | // |
| 3538 | 3538 | $file .= $aicc_append; |
| 3539 | 3539 | } else { |
| 3540 | 3540 | if ($this->debug > 2) { |
| 3541 | - error_log('New LP - In learnpath::get_link() ' . __LINE__ . ' - No starting protocol in ' . $lp_item_path, 0); |
|
| 3541 | + error_log('New LP - In learnpath::get_link() '.__LINE__.' - No starting protocol in '.$lp_item_path, 0); |
|
| 3542 | 3542 | } |
| 3543 | 3543 | // Prevent getting untranslatable urls. |
| 3544 | 3544 | $lp_item_path = preg_replace('/%2F/', '/', $lp_item_path); |
| 3545 | 3545 | $lp_item_path = preg_replace('/%3A/', ':', $lp_item_path); |
| 3546 | 3546 | // Prepare the path - lp_path might be unusable because it includes the "aicc" subdir name. |
| 3547 | - $file = $course_path . '/scorm/' . $lp_path . '/' . $lp_item_path; |
|
| 3547 | + $file = $course_path.'/scorm/'.$lp_path.'/'.$lp_item_path; |
|
| 3548 | 3548 | // TODO: Fix this for urls with protocol header. |
| 3549 | 3549 | $file = str_replace('//', '/', $file); |
| 3550 | 3550 | $file = str_replace(':/', '://', $file); |
@@ -3563,7 +3563,7 @@ discard block |
||
| 3563 | 3563 | $file = !empty($file) ? str_replace('&', '&', $file) : ''; |
| 3564 | 3564 | } |
| 3565 | 3565 | if ($this->debug > 2) { |
| 3566 | - error_log('New LP - In learnpath::get_link() - returning "' . $file . '" from get_link', 0); |
|
| 3566 | + error_log('New LP - In learnpath::get_link() - returning "'.$file.'" from get_link', 0); |
|
| 3567 | 3567 | } |
| 3568 | 3568 | return $file; |
| 3569 | 3569 | } |
@@ -3581,7 +3581,7 @@ discard block |
||
| 3581 | 3581 | $search = ''; |
| 3582 | 3582 | // Use $attempt_num to enable multi-views management (disabled so far). |
| 3583 | 3583 | if ($attempt_num != 0 AND intval(strval($attempt_num)) == $attempt_num) { |
| 3584 | - $search = 'AND view_count = ' . $attempt_num; |
|
| 3584 | + $search = 'AND view_count = '.$attempt_num; |
|
| 3585 | 3585 | } |
| 3586 | 3586 | // When missing $attempt_num, search for a unique lp_view record for this lp and user. |
| 3587 | 3587 | $lp_view_table = Database :: get_course_table(TABLE_LP_VIEW); |
@@ -3591,9 +3591,9 @@ discard block |
||
| 3591 | 3591 | |
| 3592 | 3592 | $sql = "SELECT id, view_count FROM $lp_view_table |
| 3593 | 3593 | WHERE |
| 3594 | - c_id = " . $course_id . " AND |
|
| 3595 | - lp_id = " . $this->get_id() . " AND |
|
| 3596 | - user_id = " . $this->get_user_id() . " AND |
|
| 3594 | + c_id = ".$course_id." AND |
|
| 3595 | + lp_id = " . $this->get_id()." AND |
|
| 3596 | + user_id = " . $this->get_user_id()." AND |
|
| 3597 | 3597 | session_id = $sessionId |
| 3598 | 3598 | $search |
| 3599 | 3599 | ORDER BY view_count DESC"; |
@@ -3604,7 +3604,7 @@ discard block |
||
| 3604 | 3604 | } else if (!api_is_invitee()) { |
| 3605 | 3605 | // There is no database record, create one. |
| 3606 | 3606 | $sql = "INSERT INTO $lp_view_table (c_id, lp_id,user_id, view_count, session_id) VALUES |
| 3607 | - ($course_id, " . $this->get_id() . "," . $this->get_user_id() . ", 1, $sessionId)"; |
|
| 3607 | + ($course_id, ".$this->get_id().",".$this->get_user_id().", 1, $sessionId)"; |
|
| 3608 | 3608 | Database::query($sql); |
| 3609 | 3609 | $id = Database :: insert_id(); |
| 3610 | 3610 | $this->lp_view_id = $id; |
@@ -3704,15 +3704,15 @@ discard block |
||
| 3704 | 3704 | { |
| 3705 | 3705 | $course_id = api_get_course_int_id(); |
| 3706 | 3706 | if ($this->debug > 0) { |
| 3707 | - error_log('New LP - In learnpath::move_item(' . $id . ',' . $direction . ')', 0); |
|
| 3707 | + error_log('New LP - In learnpath::move_item('.$id.','.$direction.')', 0); |
|
| 3708 | 3708 | } |
| 3709 | 3709 | if (empty($id) || empty($direction)) { |
| 3710 | 3710 | return false; |
| 3711 | 3711 | } |
| 3712 | 3712 | $tbl_lp_item = Database :: get_course_table(TABLE_LP_ITEM); |
| 3713 | 3713 | $sql_sel = "SELECT * |
| 3714 | - FROM " . $tbl_lp_item . " |
|
| 3715 | - WHERE c_id = ".$course_id." AND id = " . $id; |
|
| 3714 | + FROM " . $tbl_lp_item." |
|
| 3715 | + WHERE c_id = ".$course_id." AND id = ".$id; |
|
| 3716 | 3716 | $res_sel = Database::query($sql_sel); |
| 3717 | 3717 | // Check if elem exists. |
| 3718 | 3718 | if (Database :: num_rows($res_sel) < 1) { |
@@ -3737,7 +3737,7 @@ discard block |
||
| 3737 | 3737 | WHERE c_id = ".$course_id." AND id = $previous"; |
| 3738 | 3738 | |
| 3739 | 3739 | if ($this->debug > 2) { |
| 3740 | - error_log('Selecting previous: ' . $sql_sel2, 0); |
|
| 3740 | + error_log('Selecting previous: '.$sql_sel2, 0); |
|
| 3741 | 3741 | } |
| 3742 | 3742 | $res_sel2 = Database::query($sql_sel2); |
| 3743 | 3743 | if (Database :: num_rows($res_sel2) < 1) { |
@@ -3790,7 +3790,7 @@ discard block |
||
| 3790 | 3790 | } |
| 3791 | 3791 | Database::query($sql_upd2); |
| 3792 | 3792 | } |
| 3793 | - $display = $display -1; |
|
| 3793 | + $display = $display - 1; |
|
| 3794 | 3794 | } |
| 3795 | 3795 | break; |
| 3796 | 3796 | case 'down': |
@@ -3801,7 +3801,7 @@ discard block |
||
| 3801 | 3801 | } else { |
| 3802 | 3802 | $sql_sel2 = "SELECT * FROM $tbl_lp_item WHERE c_id = ".$course_id." AND id = $next"; |
| 3803 | 3803 | if ($this->debug > 2) { |
| 3804 | - error_log('Selecting next: ' . $sql_sel2, 0); |
|
| 3804 | + error_log('Selecting next: '.$sql_sel2, 0); |
|
| 3805 | 3805 | } |
| 3806 | 3806 | $res_sel2 = Database::query($sql_sel2); |
| 3807 | 3807 | if (Database :: num_rows($res_sel2) < 1) { |
@@ -3839,7 +3839,7 @@ discard block |
||
| 3839 | 3839 | WHERE c_id = ".$course_id." AND id = $next_next"; |
| 3840 | 3840 | Database::query($sql_upd2); |
| 3841 | 3841 | } |
| 3842 | - $display = $display +1; |
|
| 3842 | + $display = $display + 1; |
|
| 3843 | 3843 | } |
| 3844 | 3844 | break; |
| 3845 | 3845 | default : |
@@ -3862,8 +3862,8 @@ discard block |
||
| 3862 | 3862 | $res = Database::query($sql); |
| 3863 | 3863 | if ($res === false) |
| 3864 | 3864 | return false; |
| 3865 | - $lps = array (); |
|
| 3866 | - $lp_order = array (); |
|
| 3865 | + $lps = array(); |
|
| 3866 | + $lp_order = array(); |
|
| 3867 | 3867 | $num = Database :: num_rows($res); |
| 3868 | 3868 | // First check the order is correct, globally (might be wrong because |
| 3869 | 3869 | // of versions < 1.8.4) |
@@ -3873,7 +3873,7 @@ discard block |
||
| 3873 | 3873 | if ($row['display_order'] != $i) { // If we find a gap in the order, we need to fix it. |
| 3874 | 3874 | $need_fix = true; |
| 3875 | 3875 | $sql_u = "UPDATE $lp_table SET display_order = $i |
| 3876 | - WHERE c_id = ".$course_id." AND id = " . $row['id']; |
|
| 3876 | + WHERE c_id = ".$course_id." AND id = ".$row['id']; |
|
| 3877 | 3877 | Database::query($sql_u); |
| 3878 | 3878 | } |
| 3879 | 3879 | $row['display_order'] = $i; |
@@ -3886,10 +3886,10 @@ discard block |
||
| 3886 | 3886 | $order = $lps[$lp_id]['display_order']; |
| 3887 | 3887 | if ($order > 1) { // If it's the first element, no need to move up. |
| 3888 | 3888 | $sql_u1 = "UPDATE $lp_table SET display_order = $order |
| 3889 | - WHERE c_id = ".$course_id." AND id = " . $lp_order[$order - 1]; |
|
| 3889 | + WHERE c_id = ".$course_id." AND id = ".$lp_order[$order - 1]; |
|
| 3890 | 3890 | Database::query($sql_u1); |
| 3891 | - $sql_u2 = "UPDATE $lp_table SET display_order = " . ($order - 1) . " |
|
| 3892 | - WHERE c_id = ".$course_id." AND id = " . $lp_id; |
|
| 3891 | + $sql_u2 = "UPDATE $lp_table SET display_order = ".($order - 1)." |
|
| 3892 | + WHERE c_id = ".$course_id." AND id = ".$lp_id; |
|
| 3893 | 3893 | Database::query($sql_u2); |
| 3894 | 3894 | } |
| 3895 | 3895 | } |
@@ -3923,7 +3923,7 @@ discard block |
||
| 3923 | 3923 | if ($row['display_order'] != $i) { // If we find a gap in the order, we need to fix it. |
| 3924 | 3924 | $need_fix = true; |
| 3925 | 3925 | $sql_u = "UPDATE $lp_table SET display_order = $i |
| 3926 | - WHERE c_id = ".$course_id." AND id = " . $row['id']; |
|
| 3926 | + WHERE c_id = ".$course_id." AND id = ".$row['id']; |
|
| 3927 | 3927 | Database::query($sql_u); |
| 3928 | 3928 | } |
| 3929 | 3929 | $row['display_order'] = $i; |
@@ -3936,10 +3936,10 @@ discard block |
||
| 3936 | 3936 | $order = $lps[$lp_id]['display_order']; |
| 3937 | 3937 | if ($order < $max) { // If it's the first element, no need to move up. |
| 3938 | 3938 | $sql_u1 = "UPDATE $lp_table SET display_order = $order |
| 3939 | - WHERE c_id = ".$course_id." AND id = " . $lp_order[$order + 1]; |
|
| 3939 | + WHERE c_id = ".$course_id." AND id = ".$lp_order[$order + 1]; |
|
| 3940 | 3940 | Database::query($sql_u1); |
| 3941 | - $sql_u2 = "UPDATE $lp_table SET display_order = " . ($order + 1) . " |
|
| 3942 | - WHERE c_id = ".$course_id." AND id = " . $lp_id; |
|
| 3941 | + $sql_u2 = "UPDATE $lp_table SET display_order = ".($order + 1)." |
|
| 3942 | + WHERE c_id = ".$course_id." AND id = ".$lp_id; |
|
| 3943 | 3943 | Database::query($sql_u2); |
| 3944 | 3944 | } |
| 3945 | 3945 | } |
@@ -3959,15 +3959,15 @@ discard block |
||
| 3959 | 3959 | $this->autocomplete_parents($this->last); |
| 3960 | 3960 | $new_index = $this->get_next_index(); |
| 3961 | 3961 | if ($this->debug > 2) { |
| 3962 | - error_log('New LP - New index: ' . $new_index, 0); |
|
| 3962 | + error_log('New LP - New index: '.$new_index, 0); |
|
| 3963 | 3963 | } |
| 3964 | 3964 | $this->index = $new_index; |
| 3965 | 3965 | if ($this->debug > 2) { |
| 3966 | - error_log('New LP - Now having orderedlist[' . $new_index . '] = ' . $this->ordered_items[$new_index], 0); |
|
| 3966 | + error_log('New LP - Now having orderedlist['.$new_index.'] = '.$this->ordered_items[$new_index], 0); |
|
| 3967 | 3967 | } |
| 3968 | 3968 | $this->current = $this->ordered_items[$new_index]; |
| 3969 | 3969 | if ($this->debug > 2) { |
| 3970 | - error_log('New LP - new item id is ' . $this->current . '-' . $this->get_current_item_id(), 0); |
|
| 3970 | + error_log('New LP - new item id is '.$this->current.'-'.$this->get_current_item_id(), 0); |
|
| 3971 | 3971 | } |
| 3972 | 3972 | } |
| 3973 | 3973 | |
@@ -4031,7 +4031,7 @@ discard block |
||
| 4031 | 4031 | // Clean spaces. |
| 4032 | 4032 | $prereq_string = str_replace(' ', '', $prereq_string); |
| 4033 | 4033 | if ($debug > 0) { |
| 4034 | - error_log('Found prereq_string: ' . $prereq_string, 0); |
|
| 4034 | + error_log('Found prereq_string: '.$prereq_string, 0); |
|
| 4035 | 4035 | } |
| 4036 | 4036 | // Now send to the parse_prereq() function that will check this component's prerequisites. |
| 4037 | 4037 | $result = $currentItem->parse_prereq( |
@@ -4047,12 +4047,12 @@ discard block |
||
| 4047 | 4047 | } else { |
| 4048 | 4048 | $result = true; |
| 4049 | 4049 | if ($debug > 1) { |
| 4050 | - error_log('$this->items[' . $itemId . '] was not an object', 0); |
|
| 4050 | + error_log('$this->items['.$itemId.'] was not an object', 0); |
|
| 4051 | 4051 | } |
| 4052 | 4052 | } |
| 4053 | 4053 | |
| 4054 | 4054 | if ($debug > 1) { |
| 4055 | - error_log('End of prerequisites_match(). Error message is now ' . $this->error, 0); |
|
| 4055 | + error_log('End of prerequisites_match(). Error message is now '.$this->error, 0); |
|
| 4056 | 4056 | } |
| 4057 | 4057 | return $result; |
| 4058 | 4058 | } |
@@ -4118,11 +4118,11 @@ discard block |
||
| 4118 | 4118 | $row = Database :: fetch_array($result); |
| 4119 | 4119 | $name = domesticate($row['name']); |
| 4120 | 4120 | if ($set_visibility == 'i') { |
| 4121 | - $s = $name . " " . get_lang('LearnpathNotPublished'); |
|
| 4121 | + $s = $name." ".get_lang('LearnpathNotPublished'); |
|
| 4122 | 4122 | $v = 0; |
| 4123 | 4123 | } |
| 4124 | 4124 | if ($set_visibility == 'v') { |
| 4125 | - $s = $name . " " . get_lang('LearnpathPublished'); |
|
| 4125 | + $s = $name." ".get_lang('LearnpathPublished'); |
|
| 4126 | 4126 | $v = 1; |
| 4127 | 4127 | } |
| 4128 | 4128 | } else { |
@@ -4204,9 +4204,9 @@ discard block |
||
| 4204 | 4204 | $course_id = api_get_course_int_id(); |
| 4205 | 4205 | $lp_view_table = Database :: get_course_table(TABLE_LP_VIEW); |
| 4206 | 4206 | $sql = "INSERT INTO $lp_view_table (c_id, lp_id, user_id, view_count, session_id) |
| 4207 | - VALUES ($course_id, " . $this->lp_id . "," . $this->get_user_id() . "," . ($this->attempt + 1) . ", $session_id)"; |
|
| 4207 | + VALUES ($course_id, ".$this->lp_id.",".$this->get_user_id().",".($this->attempt + 1).", $session_id)"; |
|
| 4208 | 4208 | if ($this->debug > 2) { |
| 4209 | - error_log('New LP - Inserting new lp_view for restart: ' . $sql, 0); |
|
| 4209 | + error_log('New LP - Inserting new lp_view for restart: '.$sql, 0); |
|
| 4210 | 4210 | } |
| 4211 | 4211 | Database::query($sql); |
| 4212 | 4212 | $view_id = Database::insert_id(); |
@@ -4242,10 +4242,10 @@ discard block |
||
| 4242 | 4242 | // TODO: Do a better check on the index pointing to the right item (it is supposed to be working |
| 4243 | 4243 | // on $ordered_items[] but not sure it's always safe to use with $items[]). |
| 4244 | 4244 | if ($this->debug > 2) { |
| 4245 | - error_log('New LP - save_current() saving item ' . $this->current, 0); |
|
| 4245 | + error_log('New LP - save_current() saving item '.$this->current, 0); |
|
| 4246 | 4246 | } |
| 4247 | 4247 | if ($this->debug > 2) { |
| 4248 | - error_log('' . print_r($this->items, true), 0); |
|
| 4248 | + error_log(''.print_r($this->items, true), 0); |
|
| 4249 | 4249 | } |
| 4250 | 4250 | if (isset($this->items[$this->current]) && |
| 4251 | 4251 | is_object($this->items[$this->current]) |
@@ -4269,7 +4269,7 @@ discard block |
||
| 4269 | 4269 | { |
| 4270 | 4270 | $debug = $this->debug; |
| 4271 | 4271 | if ($debug) { |
| 4272 | - error_log('In learnpath::save_item(' . $item_id . ',' . intval($from_outside). ')', 0); |
|
| 4272 | + error_log('In learnpath::save_item('.$item_id.','.intval($from_outside).')', 0); |
|
| 4273 | 4273 | } |
| 4274 | 4274 | // TODO: Do a better check on the index pointing to the right item (it is supposed to be working |
| 4275 | 4275 | // on $ordered_items[] but not sure it's always safe to use with $items[]). |
@@ -4292,7 +4292,7 @@ discard block |
||
| 4292 | 4292 | |
| 4293 | 4293 | if ($debug) { |
| 4294 | 4294 | error_log('update_queue before:'); |
| 4295 | - error_log(print_r($this->update_queue,1)); |
|
| 4295 | + error_log(print_r($this->update_queue, 1)); |
|
| 4296 | 4296 | } |
| 4297 | 4297 | $this->autocomplete_parents($item_id); |
| 4298 | 4298 | |
@@ -4300,9 +4300,9 @@ discard block |
||
| 4300 | 4300 | $this->update_queue[$item_id] = $status; |
| 4301 | 4301 | |
| 4302 | 4302 | if ($debug) { |
| 4303 | - error_log('get_status(): ' . $status); |
|
| 4303 | + error_log('get_status(): '.$status); |
|
| 4304 | 4304 | error_log('update_queue after:'); |
| 4305 | - error_log(print_r($this->update_queue,1)); |
|
| 4305 | + error_log(print_r($this->update_queue, 1)); |
|
| 4306 | 4306 | } |
| 4307 | 4307 | return $res; |
| 4308 | 4308 | } |
@@ -4323,17 +4323,17 @@ discard block |
||
| 4323 | 4323 | |
| 4324 | 4324 | if (isset($this->current) && !api_is_invitee()) { |
| 4325 | 4325 | if ($this->debug > 2) { |
| 4326 | - error_log('New LP - Saving current item (' . $this->current . ') for later review', 0); |
|
| 4326 | + error_log('New LP - Saving current item ('.$this->current.') for later review', 0); |
|
| 4327 | 4327 | } |
| 4328 | 4328 | $sql = "UPDATE $table SET |
| 4329 | - last_item = " . intval($this->get_current_item_id()). " |
|
| 4329 | + last_item = ".intval($this->get_current_item_id())." |
|
| 4330 | 4330 | WHERE |
| 4331 | 4331 | c_id = $course_id AND |
| 4332 | - lp_id = " . $this->get_id() . " AND |
|
| 4332 | + lp_id = ".$this->get_id()." AND |
|
| 4333 | 4333 | user_id = " . $this->get_user_id()." ".$session_condition; |
| 4334 | 4334 | |
| 4335 | 4335 | if ($this->debug > 2) { |
| 4336 | - error_log('New LP - Saving last item seen : ' . $sql, 0); |
|
| 4336 | + error_log('New LP - Saving last item seen : '.$sql, 0); |
|
| 4337 | 4337 | } |
| 4338 | 4338 | Database::query($sql); |
| 4339 | 4339 | } |
@@ -4347,7 +4347,7 @@ discard block |
||
| 4347 | 4347 | progress = $progress |
| 4348 | 4348 | WHERE |
| 4349 | 4349 | c_id = ".$course_id." AND |
| 4350 | - lp_id = " . $this->get_id() . " AND |
|
| 4350 | + lp_id = " . $this->get_id()." AND |
|
| 4351 | 4351 | user_id = " . $this->get_user_id()." ".$session_condition; |
| 4352 | 4352 | // Ignore errors as some tables might not have the progress field just yet. |
| 4353 | 4353 | Database::query($sql); |
@@ -4363,7 +4363,7 @@ discard block |
||
| 4363 | 4363 | public function set_current_item($item_id = null) |
| 4364 | 4364 | { |
| 4365 | 4365 | if ($this->debug > 0) { |
| 4366 | - error_log('New LP - In learnpath::set_current_item(' . $item_id . ')', 0); |
|
| 4366 | + error_log('New LP - In learnpath::set_current_item('.$item_id.')', 0); |
|
| 4367 | 4367 | } |
| 4368 | 4368 | if (empty ($item_id)) { |
| 4369 | 4369 | if ($this->debug > 2) { |
@@ -4372,7 +4372,7 @@ discard block |
||
| 4372 | 4372 | // Do nothing. |
| 4373 | 4373 | } else { |
| 4374 | 4374 | if ($this->debug > 2) { |
| 4375 | - error_log('New LP - New current item given is ' . $item_id . '...', 0); |
|
| 4375 | + error_log('New LP - New current item given is '.$item_id.'...', 0); |
|
| 4376 | 4376 | } |
| 4377 | 4377 | if (is_numeric($item_id)) { |
| 4378 | 4378 | $item_id = intval($item_id); |
@@ -4387,10 +4387,10 @@ discard block |
||
| 4387 | 4387 | } |
| 4388 | 4388 | } |
| 4389 | 4389 | if ($this->debug > 2) { |
| 4390 | - error_log('New LP - set_current_item(' . $item_id . ') done. Index is now : ' . $this->index, 0); |
|
| 4390 | + error_log('New LP - set_current_item('.$item_id.') done. Index is now : '.$this->index, 0); |
|
| 4391 | 4391 | } |
| 4392 | 4392 | } else { |
| 4393 | - error_log('New LP - set_current_item(' . $item_id . ') failed. Not a numeric value: ', 0); |
|
| 4393 | + error_log('New LP - set_current_item('.$item_id.') failed. Not a numeric value: ', 0); |
|
| 4394 | 4394 | } |
| 4395 | 4395 | } |
| 4396 | 4396 | } |
@@ -4416,7 +4416,7 @@ discard block |
||
| 4416 | 4416 | if ($lp != 0) { |
| 4417 | 4417 | $tbl_lp = Database :: get_course_table(TABLE_LP_MAIN); |
| 4418 | 4418 | $sql = "UPDATE $tbl_lp SET default_encoding = '$enc' |
| 4419 | - WHERE c_id = ".$course_id." AND id = " . $lp; |
|
| 4419 | + WHERE c_id = ".$course_id." AND id = ".$lp; |
|
| 4420 | 4420 | $res = Database::query($sql); |
| 4421 | 4421 | return $res; |
| 4422 | 4422 | } |
@@ -4441,7 +4441,7 @@ discard block |
||
| 4441 | 4441 | if ($lp != 0) { |
| 4442 | 4442 | $tbl_lp = Database :: get_course_table(TABLE_LP_MAIN); |
| 4443 | 4443 | $sql = "UPDATE $tbl_lp SET js_lib = '$lib' |
| 4444 | - WHERE c_id = ".$course_id." AND id = " . $lp; |
|
| 4444 | + WHERE c_id = ".$course_id." AND id = ".$lp; |
|
| 4445 | 4445 | $res = Database::query($sql); |
| 4446 | 4446 | return $res; |
| 4447 | 4447 | } else { |
@@ -4466,10 +4466,10 @@ discard block |
||
| 4466 | 4466 | $course_id = api_get_course_int_id(); |
| 4467 | 4467 | $lp_id = $this->get_id(); |
| 4468 | 4468 | $sql = "UPDATE $lp_table SET |
| 4469 | - content_maker = '" . Database::escape_string($this->maker) . "' |
|
| 4469 | + content_maker = '".Database::escape_string($this->maker)."' |
|
| 4470 | 4470 | WHERE c_id = ".$course_id." AND id = '$lp_id'"; |
| 4471 | 4471 | if ($this->debug > 2) { |
| 4472 | - error_log('New LP - lp updated with new content_maker : ' . $this->maker, 0); |
|
| 4472 | + error_log('New LP - lp updated with new content_maker : '.$this->maker, 0); |
|
| 4473 | 4473 | } |
| 4474 | 4474 | Database::query($sql); |
| 4475 | 4475 | return true; |
@@ -4493,10 +4493,10 @@ discard block |
||
| 4493 | 4493 | $lp_id = $this->get_id(); |
| 4494 | 4494 | $course_id = $this->course_info['real_id']; |
| 4495 | 4495 | $sql = "UPDATE $lp_table SET |
| 4496 | - name = '" . Database::escape_string($this->name). "' |
|
| 4496 | + name = '".Database::escape_string($this->name)."' |
|
| 4497 | 4497 | WHERE c_id = ".$course_id." AND id = '$lp_id'"; |
| 4498 | 4498 | if ($this->debug > 2) { |
| 4499 | - error_log('New LP - lp updated with new name : ' . $this->name, 0); |
|
| 4499 | + error_log('New LP - lp updated with new name : '.$this->name, 0); |
|
| 4500 | 4500 | } |
| 4501 | 4501 | $result = Database::query($sql); |
| 4502 | 4502 | // If the lp is visible on the homepage, change his name there. |
@@ -4504,7 +4504,7 @@ discard block |
||
| 4504 | 4504 | $session_id = api_get_session_id(); |
| 4505 | 4505 | $session_condition = api_get_session_condition($session_id); |
| 4506 | 4506 | $tbl_tool = Database :: get_course_table(TABLE_TOOL_LIST); |
| 4507 | - $link = 'lp/lp_controller.php?action=view&lp_id=' . $lp_id.'&id_session='.$session_id; |
|
| 4507 | + $link = 'lp/lp_controller.php?action=view&lp_id='.$lp_id.'&id_session='.$session_id; |
|
| 4508 | 4508 | $sql = "UPDATE $tbl_tool SET name = '$this->name' |
| 4509 | 4509 | WHERE |
| 4510 | 4510 | c_id = $course_id AND |
@@ -4582,10 +4582,10 @@ discard block |
||
| 4582 | 4582 | |
| 4583 | 4583 | // Save it to search engine. |
| 4584 | 4584 | foreach ($missing_terms as $term) { |
| 4585 | - $doc->add_term($prefix . $term, 1); |
|
| 4585 | + $doc->add_term($prefix.$term, 1); |
|
| 4586 | 4586 | } |
| 4587 | 4587 | foreach ($deprecated_terms as $term) { |
| 4588 | - $doc->remove_term($prefix . $term); |
|
| 4588 | + $doc->remove_term($prefix.$term); |
|
| 4589 | 4589 | } |
| 4590 | 4590 | $di->getDb()->replace_document((int) $se_ref['search_did'], $doc); |
| 4591 | 4591 | $di->getDb()->flush(); |
@@ -4610,10 +4610,10 @@ discard block |
||
| 4610 | 4610 | $this->theme = $name; |
| 4611 | 4611 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
| 4612 | 4612 | $lp_id = $this->get_id(); |
| 4613 | - $sql = "UPDATE $lp_table SET theme = '" . Database::escape_string($this->theme). "' |
|
| 4613 | + $sql = "UPDATE $lp_table SET theme = '".Database::escape_string($this->theme)."' |
|
| 4614 | 4614 | WHERE c_id = ".$course_id." AND id = '$lp_id'"; |
| 4615 | 4615 | if ($this->debug > 2) { |
| 4616 | - error_log('New LP - lp updated with new theme : ' . $this->theme, 0); |
|
| 4616 | + error_log('New LP - lp updated with new theme : '.$this->theme, 0); |
|
| 4617 | 4617 | } |
| 4618 | 4618 | Database::query($sql); |
| 4619 | 4619 | |
@@ -4636,10 +4636,10 @@ discard block |
||
| 4636 | 4636 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
| 4637 | 4637 | $lp_id = $this->get_id(); |
| 4638 | 4638 | $sql = "UPDATE $lp_table SET |
| 4639 | - preview_image = '" . Database::escape_string($this->preview_image). "' |
|
| 4639 | + preview_image = '".Database::escape_string($this->preview_image)."' |
|
| 4640 | 4640 | WHERE c_id = ".$course_id." AND id = '$lp_id'"; |
| 4641 | 4641 | if ($this->debug > 2) { |
| 4642 | - error_log('New LP - lp updated with new preview image : ' . $this->preview_image, 0); |
|
| 4642 | + error_log('New LP - lp updated with new preview image : '.$this->preview_image, 0); |
|
| 4643 | 4643 | } |
| 4644 | 4644 | Database::query($sql); |
| 4645 | 4645 | return true; |
@@ -4659,10 +4659,10 @@ discard block |
||
| 4659 | 4659 | $this->author = $name; |
| 4660 | 4660 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
| 4661 | 4661 | $lp_id = $this->get_id(); |
| 4662 | - $sql = "UPDATE $lp_table SET author = '" . Database::escape_string($name). "' |
|
| 4662 | + $sql = "UPDATE $lp_table SET author = '".Database::escape_string($name)."' |
|
| 4663 | 4663 | WHERE c_id = ".$course_id." AND id = '$lp_id'"; |
| 4664 | 4664 | if ($this->debug > 2) { |
| 4665 | - error_log('New LP - lp updated with new preview author : ' . $this->author, 0); |
|
| 4665 | + error_log('New LP - lp updated with new preview author : '.$this->author, 0); |
|
| 4666 | 4666 | } |
| 4667 | 4667 | Database::query($sql); |
| 4668 | 4668 | |
@@ -4685,10 +4685,10 @@ discard block |
||
| 4685 | 4685 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
| 4686 | 4686 | $lp_id = $this->get_id(); |
| 4687 | 4687 | $sql = "UPDATE $lp_table SET |
| 4688 | - hide_toc_frame = '" . (int) $this->hide_toc_frame . "' |
|
| 4688 | + hide_toc_frame = '".(int) $this->hide_toc_frame."' |
|
| 4689 | 4689 | WHERE c_id = ".$course_id." AND id = '$lp_id'"; |
| 4690 | 4690 | if ($this->debug > 2) { |
| 4691 | - error_log('New LP - lp updated with new preview hide_toc_frame : ' . $this->author, 0); |
|
| 4691 | + error_log('New LP - lp updated with new preview hide_toc_frame : '.$this->author, 0); |
|
| 4692 | 4692 | } |
| 4693 | 4693 | Database::query($sql); |
| 4694 | 4694 | |
@@ -4715,7 +4715,7 @@ discard block |
||
| 4715 | 4715 | $sql = "UPDATE $lp_table SET prerequisite = '".$this->prerequisite."' |
| 4716 | 4716 | WHERE c_id = ".$course_id." AND id = '$lp_id'"; |
| 4717 | 4717 | if ($this->debug > 2) { |
| 4718 | - error_log('New LP - lp updated with new preview requisite : ' . $this->requisite, 0); |
|
| 4718 | + error_log('New LP - lp updated with new preview requisite : '.$this->requisite, 0); |
|
| 4719 | 4719 | } |
| 4720 | 4720 | Database::query($sql); |
| 4721 | 4721 | return true; |
@@ -4739,10 +4739,10 @@ discard block |
||
| 4739 | 4739 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
| 4740 | 4740 | $lp_id = $this->get_id(); |
| 4741 | 4741 | $sql = "UPDATE $lp_table SET |
| 4742 | - content_local = '" . Database::escape_string($name) . "' |
|
| 4742 | + content_local = '".Database::escape_string($name)."' |
|
| 4743 | 4743 | WHERE c_id = ".$course_id." AND id = '$lp_id'"; |
| 4744 | 4744 | if ($this->debug > 2) { |
| 4745 | - error_log('New LP - lp updated with new proximity : ' . $this->proximity, 0); |
|
| 4745 | + error_log('New LP - lp updated with new proximity : '.$this->proximity, 0); |
|
| 4746 | 4746 | } |
| 4747 | 4747 | Database::query($sql); |
| 4748 | 4748 | return true; |
@@ -4776,11 +4776,11 @@ discard block |
||
| 4776 | 4776 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
| 4777 | 4777 | $lp_id = $this->get_id(); |
| 4778 | 4778 | $sql = "UPDATE $lp_table SET |
| 4779 | - use_max_score = '" . $this->use_max_score . "' |
|
| 4779 | + use_max_score = '".$this->use_max_score."' |
|
| 4780 | 4780 | WHERE c_id = ".$course_id." AND id = '$lp_id'"; |
| 4781 | 4781 | |
| 4782 | 4782 | if ($this->debug > 2) { |
| 4783 | - error_log('New LP - lp updated with new use_max_score : ' . $this->use_max_score, 0); |
|
| 4783 | + error_log('New LP - lp updated with new use_max_score : '.$this->use_max_score, 0); |
|
| 4784 | 4784 | } |
| 4785 | 4785 | Database::query($sql); |
| 4786 | 4786 | |
@@ -4807,7 +4807,7 @@ discard block |
||
| 4807 | 4807 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
| 4808 | 4808 | $lp_id = $this->get_id(); |
| 4809 | 4809 | if ($this->debug > 2) { |
| 4810 | - error_log('New LP - lp updated with new expired_on : ' . $this->expired_on, 0); |
|
| 4810 | + error_log('New LP - lp updated with new expired_on : '.$this->expired_on, 0); |
|
| 4811 | 4811 | } |
| 4812 | 4812 | |
| 4813 | 4813 | $params = [ |
@@ -4837,10 +4837,10 @@ discard block |
||
| 4837 | 4837 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
| 4838 | 4838 | $lp_id = $this->get_id(); |
| 4839 | 4839 | $sql = "UPDATE $lp_table SET |
| 4840 | - publicated_on = '" . Database::escape_string($this->publicated_on) . "' |
|
| 4840 | + publicated_on = '".Database::escape_string($this->publicated_on)."' |
|
| 4841 | 4841 | WHERE c_id = ".$course_id." AND id = '$lp_id'"; |
| 4842 | 4842 | if ($this->debug > 2) { |
| 4843 | - error_log('New LP - lp updated with new publicated_on : ' . $this->publicated_on, 0); |
|
| 4843 | + error_log('New LP - lp updated with new publicated_on : '.$this->publicated_on, 0); |
|
| 4844 | 4844 | } |
| 4845 | 4845 | Database::query($sql); |
| 4846 | 4846 | |
@@ -4860,10 +4860,10 @@ discard block |
||
| 4860 | 4860 | $this->modified_on = api_get_utc_datetime(); |
| 4861 | 4861 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
| 4862 | 4862 | $lp_id = $this->get_id(); |
| 4863 | - $sql = "UPDATE $lp_table SET modified_on = '" . $this->modified_on . "' |
|
| 4863 | + $sql = "UPDATE $lp_table SET modified_on = '".$this->modified_on."' |
|
| 4864 | 4864 | WHERE c_id = ".$course_id." AND id = '$lp_id'"; |
| 4865 | 4865 | if ($this->debug > 2) { |
| 4866 | - error_log('New LP - lp updated with new expired_on : ' . $this->modified_on, 0); |
|
| 4866 | + error_log('New LP - lp updated with new expired_on : '.$this->modified_on, 0); |
|
| 4867 | 4867 | } |
| 4868 | 4868 | Database::query($sql); |
| 4869 | 4869 | |
@@ -4935,13 +4935,13 @@ discard block |
||
| 4935 | 4935 | |
| 4936 | 4936 | if ($this->last != 0 && $this->last != $this->current && is_object($this->items[$this->last])) { |
| 4937 | 4937 | if ($this->debug > 2) { |
| 4938 | - error_log('New LP - In learnpath::stop_previous_item() - ' . $this->last . ' is object', 0); |
|
| 4938 | + error_log('New LP - In learnpath::stop_previous_item() - '.$this->last.' is object', 0); |
|
| 4939 | 4939 | } |
| 4940 | 4940 | switch ($this->get_type()) { |
| 4941 | 4941 | case '3': |
| 4942 | 4942 | if ($this->items[$this->last]->get_type() != 'au') { |
| 4943 | 4943 | if ($this->debug > 2) { |
| 4944 | - error_log('New LP - In learnpath::stop_previous_item() - ' . $this->last . ' in lp_type 3 is <> au', 0); |
|
| 4944 | + error_log('New LP - In learnpath::stop_previous_item() - '.$this->last.' in lp_type 3 is <> au', 0); |
|
| 4945 | 4945 | } |
| 4946 | 4946 | $this->items[$this->last]->close(); |
| 4947 | 4947 | //$this->autocomplete_parents($this->last); |
@@ -4954,7 +4954,7 @@ discard block |
||
| 4954 | 4954 | case '2': |
| 4955 | 4955 | if ($this->items[$this->last]->get_type() != 'sco') { |
| 4956 | 4956 | if ($this->debug > 2) { |
| 4957 | - error_log('New LP - In learnpath::stop_previous_item() - ' . $this->last . ' in lp_type 2 is <> sco', 0); |
|
| 4957 | + error_log('New LP - In learnpath::stop_previous_item() - '.$this->last.' in lp_type 2 is <> sco', 0); |
|
| 4958 | 4958 | } |
| 4959 | 4959 | $this->items[$this->last]->close(); |
| 4960 | 4960 | //$this->autocomplete_parents($this->last); |
@@ -4968,7 +4968,7 @@ discard block |
||
| 4968 | 4968 | case '1': |
| 4969 | 4969 | default: |
| 4970 | 4970 | if ($this->debug > 2) { |
| 4971 | - error_log('New LP - In learnpath::stop_previous_item() - ' . $this->last . ' in lp_type 1 is asset', 0); |
|
| 4971 | + error_log('New LP - In learnpath::stop_previous_item() - '.$this->last.' in lp_type 1 is asset', 0); |
|
| 4972 | 4972 | } |
| 4973 | 4973 | $this->items[$this->last]->close(); |
| 4974 | 4974 | break; |
@@ -4994,7 +4994,7 @@ discard block |
||
| 4994 | 4994 | } |
| 4995 | 4995 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
| 4996 | 4996 | $sql = "SELECT * FROM $lp_table |
| 4997 | - WHERE c_id = ".$course_id." AND id = " . $this->get_id(); |
|
| 4997 | + WHERE c_id = ".$course_id." AND id = ".$this->get_id(); |
|
| 4998 | 4998 | $res = Database::query($sql); |
| 4999 | 4999 | if (Database :: num_rows($res) > 0) { |
| 5000 | 5000 | $row = Database :: fetch_array($res); |
@@ -5015,14 +5015,14 @@ discard block |
||
| 5015 | 5015 | break; |
| 5016 | 5016 | } |
| 5017 | 5017 | $sql = "UPDATE $lp_table SET default_view_mod = '$view_mode' |
| 5018 | - WHERE c_id = ".$course_id." AND id = " . $this->get_id(); |
|
| 5018 | + WHERE c_id = ".$course_id." AND id = ".$this->get_id(); |
|
| 5019 | 5019 | Database::query($sql); |
| 5020 | 5020 | $this->mode = $view_mode; |
| 5021 | 5021 | |
| 5022 | 5022 | return $view_mode; |
| 5023 | 5023 | } else { |
| 5024 | 5024 | if ($this->debug > 2) { |
| 5025 | - error_log('New LP - Problem in update_default_view() - could not find LP ' . $this->get_id() . ' in DB', 0); |
|
| 5025 | + error_log('New LP - Problem in update_default_view() - could not find LP '.$this->get_id().' in DB', 0); |
|
| 5026 | 5026 | } |
| 5027 | 5027 | } |
| 5028 | 5028 | return -1; |
@@ -5040,7 +5040,7 @@ discard block |
||
| 5040 | 5040 | } |
| 5041 | 5041 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
| 5042 | 5042 | $sql = "SELECT * FROM $lp_table |
| 5043 | - WHERE c_id = ".$course_id." AND id = " . $this->get_id(); |
|
| 5043 | + WHERE c_id = ".$course_id." AND id = ".$this->get_id(); |
|
| 5044 | 5044 | $res = Database::query($sql); |
| 5045 | 5045 | if (Database :: num_rows($res) > 0) { |
| 5046 | 5046 | $row = Database :: fetch_array($res); |
@@ -5053,14 +5053,14 @@ discard block |
||
| 5053 | 5053 | $force_return = true; |
| 5054 | 5054 | } |
| 5055 | 5055 | $sql = "UPDATE $lp_table SET force_commit = $force |
| 5056 | - WHERE c_id = ".$course_id." AND id = " . $this->get_id(); |
|
| 5056 | + WHERE c_id = ".$course_id." AND id = ".$this->get_id(); |
|
| 5057 | 5057 | Database::query($sql); |
| 5058 | 5058 | $this->force_commit = $force_return; |
| 5059 | 5059 | |
| 5060 | 5060 | return $force_return; |
| 5061 | 5061 | } else { |
| 5062 | 5062 | if ($this->debug > 2) { |
| 5063 | - error_log('New LP - Problem in update_default_scorm_commit() - could not find LP ' . $this->get_id() . ' in DB', 0); |
|
| 5063 | + error_log('New LP - Problem in update_default_scorm_commit() - could not find LP '.$this->get_id().' in DB', 0); |
|
| 5064 | 5064 | } |
| 5065 | 5065 | } |
| 5066 | 5066 | return -1; |
@@ -5089,7 +5089,7 @@ discard block |
||
| 5089 | 5089 | if ($row['display_order'] != $i) { |
| 5090 | 5090 | // If we find a gap in the order, we need to fix it. |
| 5091 | 5091 | $sql = "UPDATE $lp_table SET display_order = $i |
| 5092 | - WHERE c_id = ".$course_id." AND id = " . $row['id']; |
|
| 5092 | + WHERE c_id = ".$course_id." AND id = ".$row['id']; |
|
| 5093 | 5093 | Database::query($sql); |
| 5094 | 5094 | } |
| 5095 | 5095 | $i++; |
@@ -5110,7 +5110,7 @@ discard block |
||
| 5110 | 5110 | } |
| 5111 | 5111 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
| 5112 | 5112 | $sql = "SELECT * FROM $lp_table |
| 5113 | - WHERE c_id = ".$course_id." AND id = " . $this->get_id(); |
|
| 5113 | + WHERE c_id = ".$course_id." AND id = ".$this->get_id(); |
|
| 5114 | 5114 | $res = Database::query($sql); |
| 5115 | 5115 | if (Database :: num_rows($res) > 0) { |
| 5116 | 5116 | $row = Database :: fetch_array($res); |
@@ -5121,13 +5121,13 @@ discard block |
||
| 5121 | 5121 | $force = 1; |
| 5122 | 5122 | } |
| 5123 | 5123 | $sql = "UPDATE $lp_table SET prevent_reinit = $force |
| 5124 | - WHERE c_id = ".$course_id." AND id = " . $this->get_id(); |
|
| 5124 | + WHERE c_id = ".$course_id." AND id = ".$this->get_id(); |
|
| 5125 | 5125 | Database::query($sql); |
| 5126 | 5126 | $this->prevent_reinit = $force; |
| 5127 | 5127 | return $force; |
| 5128 | 5128 | } else { |
| 5129 | 5129 | if ($this->debug > 2) { |
| 5130 | - error_log('New LP - Problem in update_reinit() - could not find LP ' . $this->get_id() . ' in DB', 0); |
|
| 5130 | + error_log('New LP - Problem in update_reinit() - could not find LP '.$this->get_id().' in DB', 0); |
|
| 5131 | 5131 | } |
| 5132 | 5132 | } |
| 5133 | 5133 | return -1; |
@@ -5143,11 +5143,11 @@ discard block |
||
| 5143 | 5143 | { |
| 5144 | 5144 | //Set default value for seriousgame_mode |
| 5145 | 5145 | if (!isset($this->seriousgame_mode)) { |
| 5146 | - $this->seriousgame_mode=0; |
|
| 5146 | + $this->seriousgame_mode = 0; |
|
| 5147 | 5147 | } |
| 5148 | 5148 | // Set default value for prevent_reinit |
| 5149 | 5149 | if (!isset($this->prevent_reinit)) { |
| 5150 | - $this->prevent_reinit =1; |
|
| 5150 | + $this->prevent_reinit = 1; |
|
| 5151 | 5151 | } |
| 5152 | 5152 | if ($this->seriousgame_mode == 1 && $this->prevent_reinit == 1) { |
| 5153 | 5153 | return 'seriousgame'; |
@@ -5195,7 +5195,7 @@ discard block |
||
| 5195 | 5195 | $sql = "UPDATE $lp_table SET |
| 5196 | 5196 | prevent_reinit = $prevent_reinit , |
| 5197 | 5197 | seriousgame_mode = $sg_mode |
| 5198 | - WHERE c_id = ".$course_id." AND id = " . $this->get_id(); |
|
| 5198 | + WHERE c_id = ".$course_id." AND id = ".$this->get_id(); |
|
| 5199 | 5199 | $res = Database::query($sql); |
| 5200 | 5200 | if ($res) { |
| 5201 | 5201 | return true; |
@@ -5247,7 +5247,7 @@ discard block |
||
| 5247 | 5247 | error_log('New LP - In learnpath::set_seriousgame_mode()', 0); |
| 5248 | 5248 | } |
| 5249 | 5249 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
| 5250 | - $sql = "SELECT * FROM $lp_table WHERE c_id = ".$course_id." AND id = " . $this->get_id(); |
|
| 5250 | + $sql = "SELECT * FROM $lp_table WHERE c_id = ".$course_id." AND id = ".$this->get_id(); |
|
| 5251 | 5251 | $res = Database::query($sql); |
| 5252 | 5252 | if (Database :: num_rows($res) > 0) { |
| 5253 | 5253 | $row = Database :: fetch_array($res); |
@@ -5258,13 +5258,13 @@ discard block |
||
| 5258 | 5258 | $force = 1; |
| 5259 | 5259 | } |
| 5260 | 5260 | $sql = "UPDATE $lp_table SET seriousgame_mode = $force |
| 5261 | - WHERE c_id = ".$course_id." AND id = " . $this->get_id(); |
|
| 5261 | + WHERE c_id = ".$course_id." AND id = ".$this->get_id(); |
|
| 5262 | 5262 | Database::query($sql); |
| 5263 | 5263 | $this->seriousgame_mode = $force; |
| 5264 | 5264 | return $force; |
| 5265 | 5265 | } else { |
| 5266 | 5266 | if ($this->debug > 2) { |
| 5267 | - error_log('New LP - Problem in set_seriousgame_mode() - could not find LP ' . $this->get_id() . ' in DB', 0); |
|
| 5267 | + error_log('New LP - Problem in set_seriousgame_mode() - could not find LP '.$this->get_id().' in DB', 0); |
|
| 5268 | 5268 | } |
| 5269 | 5269 | } |
| 5270 | 5270 | return -1; |
@@ -5282,7 +5282,7 @@ discard block |
||
| 5282 | 5282 | } |
| 5283 | 5283 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
| 5284 | 5284 | $sql = "SELECT * FROM $lp_table |
| 5285 | - WHERE c_id = ".$course_id." AND id = " . $this->get_id(); |
|
| 5285 | + WHERE c_id = ".$course_id." AND id = ".$this->get_id(); |
|
| 5286 | 5286 | $res = Database::query($sql); |
| 5287 | 5287 | if (Database :: num_rows($res) > 0) { |
| 5288 | 5288 | $row = Database :: fetch_array($res); |
@@ -5293,13 +5293,13 @@ discard block |
||
| 5293 | 5293 | $force = 1; |
| 5294 | 5294 | } |
| 5295 | 5295 | $sql = "UPDATE $lp_table SET debug = $force |
| 5296 | - WHERE c_id = ".$course_id." AND id = " . $this->get_id(); |
|
| 5296 | + WHERE c_id = ".$course_id." AND id = ".$this->get_id(); |
|
| 5297 | 5297 | Database::query($sql); |
| 5298 | 5298 | $this->scorm_debug = $force; |
| 5299 | 5299 | return $force; |
| 5300 | 5300 | } else { |
| 5301 | 5301 | if ($this->debug > 2) { |
| 5302 | - error_log('New LP - Problem in update_scorm_debug() - could not find LP ' . $this->get_id() . ' in DB', 0); |
|
| 5302 | + error_log('New LP - Problem in update_scorm_debug() - could not find LP '.$this->get_id().' in DB', 0); |
|
| 5303 | 5303 | } |
| 5304 | 5304 | } |
| 5305 | 5305 | return -1; |
@@ -5328,7 +5328,7 @@ discard block |
||
| 5328 | 5328 | * @param int $depth |
| 5329 | 5329 | * @param array $tmp |
| 5330 | 5330 | */ |
| 5331 | - public function create_tree_array($array, $parent = 0, $depth = -1, $tmp = array ()) |
|
| 5331 | + public function create_tree_array($array, $parent = 0, $depth = -1, $tmp = array()) |
|
| 5332 | 5332 | { |
| 5333 | 5333 | if ($this->debug > 1) { |
| 5334 | 5334 | error_log('New LP - In learnpath::create_tree_array())', 0); |
@@ -5414,7 +5414,7 @@ discard block |
||
| 5414 | 5414 | |
| 5415 | 5415 | // we need to start a form when we want to update all the mp3 files |
| 5416 | 5416 | if ($update_audio == 'true') { |
| 5417 | - $return .= '<form action="' . api_get_self() . '?'.api_get_cidreq().'&updateaudio=' . Security :: remove_XSS($_GET['updateaudio']) .'&action=' . Security :: remove_XSS($_GET['action']) . '&lp_id=' . $_SESSION['oLP']->lp_id . '" method="post" enctype="multipart/form-data" name="updatemp3" id="updatemp3">'; |
|
| 5417 | + $return .= '<form action="'.api_get_self().'?'.api_get_cidreq().'&updateaudio='.Security :: remove_XSS($_GET['updateaudio']).'&action='.Security :: remove_XSS($_GET['action']).'&lp_id='.$_SESSION['oLP']->lp_id.'" method="post" enctype="multipart/form-data" name="updatemp3" id="updatemp3">'; |
|
| 5418 | 5418 | } |
| 5419 | 5419 | $return .= '<div id="message"></div>'; |
| 5420 | 5420 | if (count($this->items) == 0) { |
@@ -5422,14 +5422,14 @@ discard block |
||
| 5422 | 5422 | } else { |
| 5423 | 5423 | $return_audio = '<table class="data_table">'; |
| 5424 | 5424 | $return_audio .= '<tr>'; |
| 5425 | - $return_audio .= '<th width="40%">' . get_lang('Title') . '</th>'; |
|
| 5426 | - $return_audio .= '<th>' . get_lang('Audio') . '</th>'; |
|
| 5425 | + $return_audio .= '<th width="40%">'.get_lang('Title').'</th>'; |
|
| 5426 | + $return_audio .= '<th>'.get_lang('Audio').'</th>'; |
|
| 5427 | 5427 | $return_audio .= '</tr>'; |
| 5428 | 5428 | |
| 5429 | 5429 | if ($update_audio != 'true') { |
| 5430 | 5430 | $return .= '<div class="col-md-12">'; |
| 5431 | 5431 | $return .= self::return_new_tree($update_audio); |
| 5432 | - $return .='</div>'; |
|
| 5432 | + $return .= '</div>'; |
|
| 5433 | 5433 | $return .= Display::div( |
| 5434 | 5434 | Display::url(get_lang('Save'), '#', array('id' => 'listSubmit', 'class' => 'btn btn-primary')), |
| 5435 | 5435 | array('style' => 'float:left; margin-top:15px;width:100%') |
@@ -5467,7 +5467,7 @@ discard block |
||
| 5467 | 5467 | public function return_new_tree($update_audio = 'false', $drop_element_here = false) |
| 5468 | 5468 | { |
| 5469 | 5469 | $return = ''; |
| 5470 | - $is_allowed_to_edit = api_is_allowed_to_edit(null,true); |
|
| 5470 | + $is_allowed_to_edit = api_is_allowed_to_edit(null, true); |
|
| 5471 | 5471 | |
| 5472 | 5472 | $course_id = api_get_course_int_id(); |
| 5473 | 5473 | $tbl_lp_item = Database :: get_course_table(TABLE_LP_ITEM); |
@@ -5515,7 +5515,7 @@ discard block |
||
| 5515 | 5515 | |
| 5516 | 5516 | // Link for the documents |
| 5517 | 5517 | if ($arrLP[$i]['item_type'] == 'document') { |
| 5518 | - $url = api_get_self() . '?'.api_get_cidreq().'&action=view_item&mode=preview_document&id=' . $arrLP[$i]['id'] . '&lp_id=' . $this->lp_id; |
|
| 5518 | + $url = api_get_self().'?'.api_get_cidreq().'&action=view_item&mode=preview_document&id='.$arrLP[$i]['id'].'&lp_id='.$this->lp_id; |
|
| 5519 | 5519 | $title_cut = Display::url( |
| 5520 | 5520 | $title_cut, |
| 5521 | 5521 | $url, |
@@ -5536,15 +5536,15 @@ discard block |
||
| 5536 | 5536 | } else { |
| 5537 | 5537 | $oddClass = 'row_even'; |
| 5538 | 5538 | } |
| 5539 | - $return_audio .= '<tr id ="lp_item_'.$arrLP[$i]['id'] .'" class="' . $oddClass . '">'; |
|
| 5539 | + $return_audio .= '<tr id ="lp_item_'.$arrLP[$i]['id'].'" class="'.$oddClass.'">'; |
|
| 5540 | 5540 | |
| 5541 | 5541 | $icon_name = str_replace(' ', '', $arrLP[$i]['item_type']); |
| 5542 | 5542 | |
| 5543 | - if (file_exists('../img/lp_' . $icon_name . '.png')) { |
|
| 5544 | - $icon = Display::return_icon('lp_' . $icon_name . '.png'); |
|
| 5543 | + if (file_exists('../img/lp_'.$icon_name.'.png')) { |
|
| 5544 | + $icon = Display::return_icon('lp_'.$icon_name.'.png'); |
|
| 5545 | 5545 | } else { |
| 5546 | - if (file_exists('../img/lp_' . $icon_name . '.gif')) { |
|
| 5547 | - $icon = Display::return_icon('lp_' . $icon_name . '.gif'); |
|
| 5546 | + if (file_exists('../img/lp_'.$icon_name.'.gif')) { |
|
| 5547 | + $icon = Display::return_icon('lp_'.$icon_name.'.gif'); |
|
| 5548 | 5548 | } else { |
| 5549 | 5549 | if ($arrLP[$i]['item_type'] === TOOL_LP_FINAL_ITEM) { |
| 5550 | 5550 | $icon = Display::return_icon('certificate.png'); |
@@ -5555,7 +5555,7 @@ discard block |
||
| 5555 | 5555 | } |
| 5556 | 5556 | |
| 5557 | 5557 | // The audio column. |
| 5558 | - $return_audio .= '<td align="left" style="padding-left:10px;">'; |
|
| 5558 | + $return_audio .= '<td align="left" style="padding-left:10px;">'; |
|
| 5559 | 5559 | $audio = ''; |
| 5560 | 5560 | if (!$update_audio || $update_audio <> 'true') { |
| 5561 | 5561 | if (!empty($arrLP[$i]['audio'])) { |
@@ -5565,10 +5565,10 @@ discard block |
||
| 5565 | 5565 | } else { |
| 5566 | 5566 | $types = self::getChapterTypes(); |
| 5567 | 5567 | if (!in_array($arrLP[$i]['item_type'], $types)) { |
| 5568 | - $audio .= '<input type="file" name="mp3file' . $arrLP[$i]['id'] . '" id="mp3file" />'; |
|
| 5568 | + $audio .= '<input type="file" name="mp3file'.$arrLP[$i]['id'].'" id="mp3file" />'; |
|
| 5569 | 5569 | if (!empty ($arrLP[$i]['audio'])) { |
| 5570 | 5570 | $audio .= '<br />'.Security::remove_XSS($arrLP[$i]['audio']).'<br /> |
| 5571 | - <input type="checkbox" name="removemp3' . $arrLP[$i]['id'] . '" id="checkbox' . $arrLP[$i]['id'] . '" />' . get_lang('RemoveAudio'); |
|
| 5571 | + <input type="checkbox" name="removemp3' . $arrLP[$i]['id'].'" id="checkbox'.$arrLP[$i]['id'].'" />'.get_lang('RemoveAudio'); |
|
| 5572 | 5572 | } |
| 5573 | 5573 | } |
| 5574 | 5574 | } |
@@ -5596,7 +5596,7 @@ discard block |
||
| 5596 | 5596 | // No edit for this item types |
| 5597 | 5597 | if (!in_array($arrLP[$i]['item_type'], array('sco', 'asset', 'final_item'))) { |
| 5598 | 5598 | if ($arrLP[$i]['item_type'] != 'dir') { |
| 5599 | - $edit_icon .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=edit_item&view=build&id=' . $arrLP[$i]['id'] . '&lp_id=' . $this->lp_id . '&path_item=' . $arrLP[$i]['path'] . '" class="btn btn-default">'; |
|
| 5599 | + $edit_icon .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=edit_item&view=build&id='.$arrLP[$i]['id'].'&lp_id='.$this->lp_id.'&path_item='.$arrLP[$i]['path'].'" class="btn btn-default">'; |
|
| 5600 | 5600 | $edit_icon .= Display::return_icon('edit.png', get_lang('LearnpathEditModule'), array(), ICON_SIZE_TINY); |
| 5601 | 5601 | $edit_icon .= '</a>'; |
| 5602 | 5602 | |
@@ -5607,7 +5607,7 @@ discard block |
||
| 5607 | 5607 | $this->lp_session_id |
| 5608 | 5608 | ) |
| 5609 | 5609 | ) { |
| 5610 | - $forumIconUrl = api_get_self() . '?' . api_get_cidreq() . '&' . http_build_query([ |
|
| 5610 | + $forumIconUrl = api_get_self().'?'.api_get_cidreq().'&'.http_build_query([ |
|
| 5611 | 5611 | 'action' => 'dissociate_forum', |
| 5612 | 5612 | 'id' => $arrLP[$i]['id'], |
| 5613 | 5613 | 'lp_id' => $this->lp_id |
@@ -5618,7 +5618,7 @@ discard block |
||
| 5618 | 5618 | ['class' => 'btn btn-default lp-btn-dissociate-forum'] |
| 5619 | 5619 | ); |
| 5620 | 5620 | } else { |
| 5621 | - $forumIconUrl = api_get_self() . '?' . api_get_cidreq() . '&' . http_build_query([ |
|
| 5621 | + $forumIconUrl = api_get_self().'?'.api_get_cidreq().'&'.http_build_query([ |
|
| 5622 | 5622 | 'action' => 'create_forum', |
| 5623 | 5623 | 'id' => $arrLP[$i]['id'], |
| 5624 | 5624 | 'lp_id' => $this->lp_id |
@@ -5631,17 +5631,17 @@ discard block |
||
| 5631 | 5631 | } |
| 5632 | 5632 | } |
| 5633 | 5633 | } else { |
| 5634 | - $edit_icon .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=edit_item&id=' . $arrLP[$i]['id'] . '&lp_id=' . $this->lp_id . '&path_item=' . $arrLP[$i]['path'] . '" class="btn btn-default">'; |
|
| 5634 | + $edit_icon .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=edit_item&id='.$arrLP[$i]['id'].'&lp_id='.$this->lp_id.'&path_item='.$arrLP[$i]['path'].'" class="btn btn-default">'; |
|
| 5635 | 5635 | $edit_icon .= Display::return_icon('edit.png', get_lang('LearnpathEditModule'), array(), ICON_SIZE_TINY); |
| 5636 | 5636 | $edit_icon .= '</a>'; |
| 5637 | 5637 | } |
| 5638 | 5638 | } |
| 5639 | 5639 | |
| 5640 | - $delete_icon .= ' <a href="'.api_get_self().'?'.api_get_cidreq().'&action=delete_item&id=' . $arrLP[$i]['id'] . '&lp_id=' . $this->lp_id . '" onclick="return confirmation(\'' . addslashes($title) . '\');" class="btn btn-default">'; |
|
| 5640 | + $delete_icon .= ' <a href="'.api_get_self().'?'.api_get_cidreq().'&action=delete_item&id='.$arrLP[$i]['id'].'&lp_id='.$this->lp_id.'" onclick="return confirmation(\''.addslashes($title).'\');" class="btn btn-default">'; |
|
| 5641 | 5641 | $delete_icon .= Display::return_icon('delete.png', get_lang('LearnpathDeleteModule'), array(), ICON_SIZE_TINY); |
| 5642 | 5642 | $delete_icon .= '</a>'; |
| 5643 | 5643 | |
| 5644 | - $url = api_get_self() . '?'.api_get_cidreq().'&view=build&id='.$arrLP[$i]['id'] .'&lp_id='.$this->lp_id; |
|
| 5644 | + $url = api_get_self().'?'.api_get_cidreq().'&view=build&id='.$arrLP[$i]['id'].'&lp_id='.$this->lp_id; |
|
| 5645 | 5645 | |
| 5646 | 5646 | if ($arrLP[$i]['item_type'] == 'document') { |
| 5647 | 5647 | $urlPreviewLink = api_get_self().'?'.api_get_cidreq().'&action=view_item&mode=preview_document&id='.$arrLP[$i]['id'].'&lp_id='.$this->lp_id; |
@@ -5678,8 +5678,8 @@ discard block |
||
| 5678 | 5678 | } |
| 5679 | 5679 | } |
| 5680 | 5680 | if ($update_audio != 'true') { |
| 5681 | - $row = $move_icon . ' ' . $icon . |
|
| 5682 | - Display::span($title_cut) . |
|
| 5681 | + $row = $move_icon.' '.$icon. |
|
| 5682 | + Display::span($title_cut). |
|
| 5683 | 5683 | Display::tag( |
| 5684 | 5684 | 'div', |
| 5685 | 5685 | "<div class=\"btn-group btn-group-xs\">$previewIcon $audio $edit_icon $forumIcon $prerequisities_icon $move_item_icon $audio_icon $delete_icon</div>", |
@@ -5700,8 +5700,8 @@ discard block |
||
| 5700 | 5700 | $parent_arrays = array(); |
| 5701 | 5701 | if ($arrLP[$i]['depth'] > 1) { |
| 5702 | 5702 | //Getting list of parents |
| 5703 | - for($j = 0; $j < $arrLP[$i]['depth']; $j++) { |
|
| 5704 | - foreach($arrLP as $item) { |
|
| 5703 | + for ($j = 0; $j < $arrLP[$i]['depth']; $j++) { |
|
| 5704 | + foreach ($arrLP as $item) { |
|
| 5705 | 5705 | if ($item['id'] == $parent_id) { |
| 5706 | 5706 | if ($item['parent_item_id'] == 0) { |
| 5707 | 5707 | $parent_id = $item['id']; |
@@ -5723,8 +5723,8 @@ discard block |
||
| 5723 | 5723 | $parent_arrays = array_reverse($parent_arrays); |
| 5724 | 5724 | $val = '$elements'; |
| 5725 | 5725 | $x = 0; |
| 5726 | - foreach($parent_arrays as $item) { |
|
| 5727 | - if ($x != count($parent_arrays) -1) { |
|
| 5726 | + foreach ($parent_arrays as $item) { |
|
| 5727 | + if ($x != count($parent_arrays) - 1) { |
|
| 5728 | 5728 | $val .= '["'.$item.'"]["children"]'; |
| 5729 | 5729 | } else { |
| 5730 | 5730 | $val .= '["'.$item.'"]["children"]'; |
@@ -5793,7 +5793,7 @@ discard block |
||
| 5793 | 5793 | if (isset($_REQUEST['id']) && $key == $_REQUEST['id']) { |
| 5794 | 5794 | $active = 'active'; |
| 5795 | 5795 | } |
| 5796 | - $return .= Display::tag( |
|
| 5796 | + $return .= Display::tag( |
|
| 5797 | 5797 | 'li', |
| 5798 | 5798 | Display::div($item['data'], array('class'=>"item_data $active")).$sub_list, |
| 5799 | 5799 | array('id'=>$key, 'class'=>'record li_container') |
@@ -5831,7 +5831,7 @@ discard block |
||
| 5831 | 5831 | |
| 5832 | 5832 | $actionsLeft .= Display::url( |
| 5833 | 5833 | Display:: return_icon('preview_view.png', get_lang('Display'), '', ICON_SIZE_MEDIUM), |
| 5834 | - 'lp_controller.php?'.api_get_cidreq().'&' . http_build_query([ |
|
| 5834 | + 'lp_controller.php?'.api_get_cidreq().'&'.http_build_query([ |
|
| 5835 | 5835 | 'gradebook' => $gradebook, |
| 5836 | 5836 | 'action' => 'view', |
| 5837 | 5837 | 'lp_id' => $_SESSION['oLP']->lp_id, |
@@ -5840,7 +5840,7 @@ discard block |
||
| 5840 | 5840 | ); |
| 5841 | 5841 | $actionsLeft .= Display::url( |
| 5842 | 5842 | Display:: return_icon('upload_audio.png', get_lang('UpdateAllAudioFragments'), '', ICON_SIZE_MEDIUM), |
| 5843 | - 'lp_controller.php?' . api_get_cidreq() . '&' . http_build_query([ |
|
| 5843 | + 'lp_controller.php?'.api_get_cidreq().'&'.http_build_query([ |
|
| 5844 | 5844 | 'action' => 'admin_view', |
| 5845 | 5845 | 'lp_id' => $_SESSION['oLP']->lp_id, |
| 5846 | 5846 | 'updateaudio' => 'true' |
@@ -5849,8 +5849,8 @@ discard block |
||
| 5849 | 5849 | |
| 5850 | 5850 | if (!$isConfigPage) { |
| 5851 | 5851 | $actionsLeft .= Display::url( |
| 5852 | - Display :: return_icon('settings.png', get_lang('CourseSettings'),'',ICON_SIZE_MEDIUM), |
|
| 5853 | - 'lp_controller.php?' . api_get_cidreq() . '&' . http_build_query([ |
|
| 5852 | + Display :: return_icon('settings.png', get_lang('CourseSettings'), '', ICON_SIZE_MEDIUM), |
|
| 5853 | + 'lp_controller.php?'.api_get_cidreq().'&'.http_build_query([ |
|
| 5854 | 5854 | 'action' => 'edit', |
| 5855 | 5855 | 'lp_id' => $_SESSION['oLP']->lp_id |
| 5856 | 5856 | ]) |
@@ -5858,16 +5858,16 @@ discard block |
||
| 5858 | 5858 | } else { |
| 5859 | 5859 | $actionsLeft .= Display::url( |
| 5860 | 5860 | Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_MEDIUM), |
| 5861 | - 'lp_controller.php?' . http_build_query([ |
|
| 5861 | + 'lp_controller.php?'.http_build_query([ |
|
| 5862 | 5862 | 'action' => 'build', |
| 5863 | 5863 | 'lp_id' => $_SESSION['oLP']->lp_id |
| 5864 | - ]) . '&' . api_get_cidreq() |
|
| 5864 | + ]).'&'.api_get_cidreq() |
|
| 5865 | 5865 | ); |
| 5866 | 5866 | } |
| 5867 | 5867 | |
| 5868 | 5868 | if ($allowExpand) { |
| 5869 | 5869 | $actionsLeft .= Display::url( |
| 5870 | - Display::return_icon('expand.png', get_lang('Expand'), array('id' => 'expand'), ICON_SIZE_MEDIUM) . |
|
| 5870 | + Display::return_icon('expand.png', get_lang('Expand'), array('id' => 'expand'), ICON_SIZE_MEDIUM). |
|
| 5871 | 5871 | Display::return_icon('contract.png', get_lang('Collapse'), array('id' => 'contract', 'class' => 'hide'), ICON_SIZE_MEDIUM), |
| 5872 | 5872 | '#', |
| 5873 | 5873 | ['role' => 'button', 'id' => 'hide_bar_template'] |
@@ -5878,14 +5878,14 @@ discard block |
||
| 5878 | 5878 | $buttons = array( |
| 5879 | 5879 | array( |
| 5880 | 5880 | 'title' => get_lang('SetPrerequisiteForEachItem'), |
| 5881 | - 'href' => 'lp_controller.php?' . api_get_cidreq() . '&' . http_build_query([ |
|
| 5881 | + 'href' => 'lp_controller.php?'.api_get_cidreq().'&'.http_build_query([ |
|
| 5882 | 5882 | 'action' => 'set_previous_step_as_prerequisite', |
| 5883 | 5883 | 'lp_id' => $_SESSION['oLP']->lp_id |
| 5884 | 5884 | ]) |
| 5885 | 5885 | ), |
| 5886 | 5886 | array( |
| 5887 | 5887 | 'title' => get_lang('ClearAllPrerequisites'), |
| 5888 | - 'href' => 'lp_controller.php?' . api_get_cidreq() . '&' . http_build_query([ |
|
| 5888 | + 'href' => 'lp_controller.php?'.api_get_cidreq().'&'.http_build_query([ |
|
| 5889 | 5889 | 'action' => 'clear_prerequisites', |
| 5890 | 5890 | 'lp_id' => $_SESSION['oLP']->lp_id |
| 5891 | 5891 | ]) |
@@ -5915,7 +5915,7 @@ discard block |
||
| 5915 | 5915 | { |
| 5916 | 5916 | // Creating learning_path folder |
| 5917 | 5917 | $dir = '/learning_path'; |
| 5918 | - $filepath = api_get_path(SYS_COURSE_PATH).$course['path'] . '/document'; |
|
| 5918 | + $filepath = api_get_path(SYS_COURSE_PATH).$course['path'].'/document'; |
|
| 5919 | 5919 | $creatorId = empty($creatorId) ? api_get_user_id() : $creatorId; |
| 5920 | 5920 | |
| 5921 | 5921 | $folder = false; |
@@ -5961,14 +5961,14 @@ discard block |
||
| 5961 | 5961 | $folder = self::generate_learning_path_folder($course, $creatorId); |
| 5962 | 5962 | |
| 5963 | 5963 | // Limits title size |
| 5964 | - $title = api_substr(api_replace_dangerous_char($lp_name), 0 , 80); |
|
| 5964 | + $title = api_substr(api_replace_dangerous_char($lp_name), 0, 80); |
|
| 5965 | 5965 | $dir = $dir.$title; |
| 5966 | 5966 | |
| 5967 | 5967 | // Creating LP folder |
| 5968 | 5968 | $documentId = null; |
| 5969 | 5969 | |
| 5970 | 5970 | if ($folder) { |
| 5971 | - $filepath = api_get_path(SYS_COURSE_PATH) . $course['path'] . '/document'; |
|
| 5971 | + $filepath = api_get_path(SYS_COURSE_PATH).$course['path'].'/document'; |
|
| 5972 | 5972 | if (!is_dir($filepath.'/'.$dir)) { |
| 5973 | 5973 | $folderData = create_unexisting_directory( |
| 5974 | 5974 | $course, |
@@ -5990,7 +5990,7 @@ discard block |
||
| 5990 | 5990 | } |
| 5991 | 5991 | $dir = $dir.'/'; |
| 5992 | 5992 | if ($folder) { |
| 5993 | - $filepath = api_get_path(SYS_COURSE_PATH) . $course['path'] . '/document'.$dir; |
|
| 5993 | + $filepath = api_get_path(SYS_COURSE_PATH).$course['path'].'/document'.$dir; |
|
| 5994 | 5994 | } |
| 5995 | 5995 | } |
| 5996 | 5996 | |
@@ -6058,11 +6058,11 @@ discard block |
||
| 6058 | 6058 | } |
| 6059 | 6059 | } |
| 6060 | 6060 | |
| 6061 | - $filepath = api_get_path(SYS_COURSE_PATH) . $courseInfo['path'] . '/document'.$dir; |
|
| 6061 | + $filepath = api_get_path(SYS_COURSE_PATH).$courseInfo['path'].'/document'.$dir; |
|
| 6062 | 6062 | |
| 6063 | 6063 | if (!is_dir($filepath)) { |
| 6064 | 6064 | $dir = '/'; |
| 6065 | - $filepath = api_get_path(SYS_COURSE_PATH) . $courseInfo['path'] . '/document'.$dir; |
|
| 6065 | + $filepath = api_get_path(SYS_COURSE_PATH).$courseInfo['path'].'/document'.$dir; |
|
| 6066 | 6066 | } |
| 6067 | 6067 | |
| 6068 | 6068 | // stripslashes() before calling api_replace_dangerous_char() because $_POST['title'] |
@@ -6081,11 +6081,11 @@ discard block |
||
| 6081 | 6081 | $tmp_filename = $filename; |
| 6082 | 6082 | |
| 6083 | 6083 | $i = 0; |
| 6084 | - while (file_exists($filepath . $tmp_filename . '.'.$extension)){ |
|
| 6085 | - $tmp_filename = $filename . '_' . ++ $i; |
|
| 6084 | + while (file_exists($filepath.$tmp_filename.'.'.$extension)) { |
|
| 6085 | + $tmp_filename = $filename.'_'.++ $i; |
|
| 6086 | 6086 | } |
| 6087 | 6087 | |
| 6088 | - $filename = $tmp_filename . '.'.$extension; |
|
| 6088 | + $filename = $tmp_filename.'.'.$extension; |
|
| 6089 | 6089 | if ($extension == 'html') { |
| 6090 | 6090 | $content = stripslashes($content); |
| 6091 | 6091 | $content = str_replace( |
@@ -6120,12 +6120,12 @@ discard block |
||
| 6120 | 6120 | ); |
| 6121 | 6121 | } |
| 6122 | 6122 | |
| 6123 | - if (!file_exists($filepath . $filename)) { |
|
| 6124 | - if ($fp = @ fopen($filepath . $filename, 'w')) { |
|
| 6123 | + if (!file_exists($filepath.$filename)) { |
|
| 6124 | + if ($fp = @ fopen($filepath.$filename, 'w')) { |
|
| 6125 | 6125 | fputs($fp, $content); |
| 6126 | 6126 | fclose($fp); |
| 6127 | 6127 | |
| 6128 | - $file_size = filesize($filepath . $filename); |
|
| 6128 | + $file_size = filesize($filepath.$filename); |
|
| 6129 | 6129 | $save_file_path = $dir.$filename; |
| 6130 | 6130 | |
| 6131 | 6131 | $document_id = add_document( |
@@ -6163,12 +6163,12 @@ discard block |
||
| 6163 | 6163 | $tbl_doc = Database :: get_course_table(TABLE_DOCUMENT); |
| 6164 | 6164 | $ct = ''; |
| 6165 | 6165 | if ($new_comment) |
| 6166 | - $ct .= ", comment='" . Database::escape_string($new_comment). "'"; |
|
| 6166 | + $ct .= ", comment='".Database::escape_string($new_comment)."'"; |
|
| 6167 | 6167 | if ($new_title) |
| 6168 | - $ct .= ", title='" . Database::escape_string($new_title)."' "; |
|
| 6168 | + $ct .= ", title='".Database::escape_string($new_title)."' "; |
|
| 6169 | 6169 | |
| 6170 | - $sql = "UPDATE " . $tbl_doc ." SET " . substr($ct, 1)." |
|
| 6171 | - WHERE c_id = ".$course_id." AND id = " . $document_id; |
|
| 6170 | + $sql = "UPDATE ".$tbl_doc." SET ".substr($ct, 1)." |
|
| 6171 | + WHERE c_id = ".$course_id." AND id = ".$document_id; |
|
| 6172 | 6172 | Database::query($sql); |
| 6173 | 6173 | } |
| 6174 | 6174 | } |
@@ -6196,41 +6196,41 @@ discard block |
||
| 6196 | 6196 | $dir = substr($dir, 1); |
| 6197 | 6197 | |
| 6198 | 6198 | if ($dir[0] != '/') |
| 6199 | - $dir = '/' . $dir; |
|
| 6199 | + $dir = '/'.$dir; |
|
| 6200 | 6200 | |
| 6201 | 6201 | if ($dir[strlen($dir) - 1] != '/') |
| 6202 | 6202 | $dir .= '/'; |
| 6203 | 6203 | |
| 6204 | - $filepath = api_get_path(SYS_COURSE_PATH) . $_course['path'] . '/document' . $dir; |
|
| 6204 | + $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'.$dir; |
|
| 6205 | 6205 | |
| 6206 | 6206 | if (!is_dir($filepath)) { |
| 6207 | - $filepath = api_get_path(SYS_COURSE_PATH) . $_course['path'] . '/document/'; |
|
| 6207 | + $filepath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document/'; |
|
| 6208 | 6208 | } |
| 6209 | 6209 | |
| 6210 | 6210 | $table_doc = Database :: get_course_table(TABLE_DOCUMENT); |
| 6211 | 6211 | if (isset($_POST['path']) && !empty($_POST['path'])) { |
| 6212 | 6212 | $document_id = intval($_POST['path']); |
| 6213 | - $sql = "SELECT path FROM " . $table_doc . " |
|
| 6214 | - WHERE c_id = $course_id AND id = " . $document_id; |
|
| 6213 | + $sql = "SELECT path FROM ".$table_doc." |
|
| 6214 | + WHERE c_id = $course_id AND id = ".$document_id; |
|
| 6215 | 6215 | $res = Database::query($sql); |
| 6216 | 6216 | $row = Database :: fetch_array($res); |
| 6217 | 6217 | $content = stripslashes($_POST['content_lp']); |
| 6218 | - $file = $filepath . $row['path']; |
|
| 6218 | + $file = $filepath.$row['path']; |
|
| 6219 | 6219 | |
| 6220 | 6220 | if ($fp = @ fopen($file, 'w')) { |
| 6221 | 6221 | $content = str_replace(api_get_path(WEB_COURSE_PATH), $_configuration['url_append'].api_get_path(REL_COURSE_PATH), $content); |
| 6222 | 6222 | |
| 6223 | 6223 | // Change the path of mp3 to absolute. |
| 6224 | 6224 | // The first regexp deals with :// urls. |
| 6225 | - $content = preg_replace("|(flashvars=\"file=)([^:/]+)/|", "$1" . api_get_path(REL_COURSE_PATH) . $_course['path'] . '/document/', $content); |
|
| 6225 | + $content = preg_replace("|(flashvars=\"file=)([^:/]+)/|", "$1".api_get_path(REL_COURSE_PATH).$_course['path'].'/document/', $content); |
|
| 6226 | 6226 | // The second regexp deals with audio/ urls. |
| 6227 | - $content = preg_replace("|(flashvars=\"file=)([^:/]+)/|", "$1" . api_get_path(REL_COURSE_PATH) . $_course['path'] . '/document/$2/', $content); |
|
| 6227 | + $content = preg_replace("|(flashvars=\"file=)([^:/]+)/|", "$1".api_get_path(REL_COURSE_PATH).$_course['path'].'/document/$2/', $content); |
|
| 6228 | 6228 | fputs($fp, $content); |
| 6229 | 6229 | fclose($fp); |
| 6230 | 6230 | |
| 6231 | - $sql = "UPDATE " . $table_doc ." SET |
|
| 6231 | + $sql = "UPDATE ".$table_doc." SET |
|
| 6232 | 6232 | title='".Database::escape_string($_POST['title'])."' |
| 6233 | - WHERE c_id = ".$course_id." AND id = " . $document_id; |
|
| 6233 | + WHERE c_id = ".$course_id." AND id = ".$document_id; |
|
| 6234 | 6234 | Database::query($sql); |
| 6235 | 6235 | } |
| 6236 | 6236 | } |
@@ -6248,10 +6248,10 @@ discard block |
||
| 6248 | 6248 | $return = ''; |
| 6249 | 6249 | if (is_numeric($item_id)) { |
| 6250 | 6250 | $tbl_lp_item = Database :: get_course_table(TABLE_LP_ITEM); |
| 6251 | - $sql = "SELECT lp.* FROM " . $tbl_lp_item . " as lp |
|
| 6252 | - WHERE c_id = ".$course_id." AND lp.id = " . intval($item_id); |
|
| 6251 | + $sql = "SELECT lp.* FROM ".$tbl_lp_item." as lp |
|
| 6252 | + WHERE c_id = ".$course_id." AND lp.id = ".intval($item_id); |
|
| 6253 | 6253 | $result = Database::query($sql); |
| 6254 | - while ($row = Database :: fetch_array($result,'ASSOC')) { |
|
| 6254 | + while ($row = Database :: fetch_array($result, 'ASSOC')) { |
|
| 6255 | 6255 | $_SESSION['parent_item_id'] = $row['item_type'] == 'dir' ? $item_id : 0; |
| 6256 | 6256 | |
| 6257 | 6257 | // Prevents wrong parent selection for document, see Bug#1251. |
@@ -6276,15 +6276,15 @@ discard block |
||
| 6276 | 6276 | $return .= $exercise->description.'<br />'; |
| 6277 | 6277 | $return .= Display::url( |
| 6278 | 6278 | get_lang('GoToExercise'), |
| 6279 | - api_get_path(WEB_CODE_PATH) . 'exercise/overview.php?' . api_get_cidreq() . '&exerciseId=' . $exercise->id, |
|
| 6279 | + api_get_path(WEB_CODE_PATH).'exercise/overview.php?'.api_get_cidreq().'&exerciseId='.$exercise->id, |
|
| 6280 | 6280 | ['class' => 'btn btn-primary'] |
| 6281 | 6281 | ); |
| 6282 | 6282 | } |
| 6283 | 6283 | break; |
| 6284 | 6284 | case TOOL_DOCUMENT: |
| 6285 | 6285 | $tbl_doc = Database :: get_course_table(TABLE_DOCUMENT); |
| 6286 | - $sql_doc = "SELECT path FROM " . $tbl_doc . " |
|
| 6287 | - WHERE c_id = ".$course_id." AND id = " . intval($row['path']); |
|
| 6286 | + $sql_doc = "SELECT path FROM ".$tbl_doc." |
|
| 6287 | + WHERE c_id = ".$course_id." AND id = ".intval($row['path']); |
|
| 6288 | 6288 | $result = Database::query($sql_doc); |
| 6289 | 6289 | $path_file = Database::result($result, 0, 0); |
| 6290 | 6290 | $path_parts = pathinfo($path_file); |
@@ -6330,7 +6330,7 @@ discard block |
||
| 6330 | 6330 | if (is_numeric($item_id)) { |
| 6331 | 6331 | $tbl_lp_item = Database :: get_course_table(TABLE_LP_ITEM); |
| 6332 | 6332 | $sql = "SELECT * FROM $tbl_lp_item |
| 6333 | - WHERE c_id = ".$course_id." AND id = " . intval($item_id); |
|
| 6333 | + WHERE c_id = ".$course_id." AND id = ".intval($item_id); |
|
| 6334 | 6334 | $res = Database::query($sql); |
| 6335 | 6335 | $row = Database::fetch_array($res); |
| 6336 | 6336 | switch ($row['item_type']) { |
@@ -6339,21 +6339,21 @@ discard block |
||
| 6339 | 6339 | case 'sco': |
| 6340 | 6340 | if (isset($_GET['view']) && $_GET['view'] == 'build') { |
| 6341 | 6341 | $return .= $this->display_manipulate($item_id, $row['item_type']); |
| 6342 | - $return .= $this->display_item_form($row['item_type'], get_lang('EditCurrentChapter') . ' :', 'edit', $item_id, $row); |
|
| 6342 | + $return .= $this->display_item_form($row['item_type'], get_lang('EditCurrentChapter').' :', 'edit', $item_id, $row); |
|
| 6343 | 6343 | } else { |
| 6344 | - $return .= $this->display_item_small_form($row['item_type'], get_lang('EditCurrentChapter') . ' :', $row); |
|
| 6344 | + $return .= $this->display_item_small_form($row['item_type'], get_lang('EditCurrentChapter').' :', $row); |
|
| 6345 | 6345 | } |
| 6346 | 6346 | break; |
| 6347 | 6347 | case TOOL_DOCUMENT: |
| 6348 | 6348 | $tbl_doc = Database :: get_course_table(TABLE_DOCUMENT); |
| 6349 | 6349 | $sql = "SELECT lp.*, doc.path as dir |
| 6350 | - FROM " . $tbl_lp_item . " as lp |
|
| 6351 | - LEFT JOIN " . $tbl_doc . " as doc |
|
| 6350 | + FROM " . $tbl_lp_item." as lp |
|
| 6351 | + LEFT JOIN " . $tbl_doc." as doc |
|
| 6352 | 6352 | ON doc.id = lp.path |
| 6353 | 6353 | WHERE |
| 6354 | 6354 | lp.c_id = $course_id AND |
| 6355 | 6355 | doc.c_id = $course_id AND |
| 6356 | - lp.id = " . intval($item_id); |
|
| 6356 | + lp.id = ".intval($item_id); |
|
| 6357 | 6357 | $res_step = Database::query($sql); |
| 6358 | 6358 | $row_step = Database :: fetch_array($res_step, 'ASSOC'); |
| 6359 | 6359 | $return .= $this->display_manipulate($item_id, $row['item_type']); |
@@ -6363,8 +6363,8 @@ discard block |
||
| 6363 | 6363 | $link_id = (string) $row['path']; |
| 6364 | 6364 | if (ctype_digit($link_id)) { |
| 6365 | 6365 | $tbl_link = Database :: get_course_table(TABLE_LINK); |
| 6366 | - $sql_select = 'SELECT url FROM ' . $tbl_link . ' |
|
| 6367 | - WHERE c_id = '.$course_id.' AND id = ' . intval($link_id); |
|
| 6366 | + $sql_select = 'SELECT url FROM '.$tbl_link.' |
|
| 6367 | + WHERE c_id = '.$course_id.' AND id = '.intval($link_id); |
|
| 6368 | 6368 | $res_link = Database::query($sql_select); |
| 6369 | 6369 | $row_link = Database :: fetch_array($res_link); |
| 6370 | 6370 | if (is_array($row_link)) { |
@@ -6378,13 +6378,13 @@ discard block |
||
| 6378 | 6378 | $_SESSION['finalItem'] = true; |
| 6379 | 6379 | $tbl_doc = Database :: get_course_table(TABLE_DOCUMENT); |
| 6380 | 6380 | $sql = "SELECT lp.*, doc.path as dir |
| 6381 | - FROM " . $tbl_lp_item . " as lp |
|
| 6382 | - LEFT JOIN " . $tbl_doc . " as doc |
|
| 6381 | + FROM " . $tbl_lp_item." as lp |
|
| 6382 | + LEFT JOIN " . $tbl_doc." as doc |
|
| 6383 | 6383 | ON doc.id = lp.path |
| 6384 | 6384 | WHERE |
| 6385 | 6385 | lp.c_id = $course_id AND |
| 6386 | 6386 | doc.c_id = $course_id AND |
| 6387 | - lp.id = " . intval($item_id); |
|
| 6387 | + lp.id = ".intval($item_id); |
|
| 6388 | 6388 | $res_step = Database::query($sql); |
| 6389 | 6389 | $row_step = Database :: fetch_array($res_step, 'ASSOC'); |
| 6390 | 6390 | $return .= $this->display_manipulate($item_id, $row['item_type']); |
@@ -6445,7 +6445,7 @@ discard block |
||
| 6445 | 6445 | |
| 6446 | 6446 | $headers = array( |
| 6447 | 6447 | Display::return_icon('folder_document.png', get_lang('Documents'), array(), ICON_SIZE_BIG), |
| 6448 | - Display::return_icon('quiz.png', get_lang('Quiz'), array(), ICON_SIZE_BIG), |
|
| 6448 | + Display::return_icon('quiz.png', get_lang('Quiz'), array(), ICON_SIZE_BIG), |
|
| 6449 | 6449 | Display::return_icon('links.png', get_lang('Links'), array(), ICON_SIZE_BIG), |
| 6450 | 6450 | Display::return_icon('works.png', get_lang('Works'), array(), ICON_SIZE_BIG), |
| 6451 | 6451 | Display::return_icon('forum.png', get_lang('Forums'), array(), ICON_SIZE_BIG), |
@@ -6495,16 +6495,16 @@ discard block |
||
| 6495 | 6495 | $course_id = api_get_course_int_id(); |
| 6496 | 6496 | $return = ''; |
| 6497 | 6497 | $tbl_doc = Database :: get_course_table(TABLE_DOCUMENT); |
| 6498 | - $sql_doc = "SELECT * FROM " . $tbl_doc . " |
|
| 6499 | - WHERE c_id = ".$course_id." AND id = " . $id; |
|
| 6498 | + $sql_doc = "SELECT * FROM ".$tbl_doc." |
|
| 6499 | + WHERE c_id = ".$course_id." AND id = ".$id; |
|
| 6500 | 6500 | $res_doc = Database::query($sql_doc); |
| 6501 | 6501 | $row_doc = Database :: fetch_array($res_doc); |
| 6502 | 6502 | |
| 6503 | 6503 | // TODO: Add a path filter. |
| 6504 | 6504 | if ($iframe) { |
| 6505 | - $return .= '<iframe id="learnpath_preview_frame" frameborder="0" height="400" width="100%" scrolling="auto" src="' . api_get_path(WEB_COURSE_PATH) . $_course['path'] . '/document' . str_replace('%2F', '/', urlencode($row_doc['path'])) . '?' . api_get_cidreq() . '"></iframe>'; |
|
| 6505 | + $return .= '<iframe id="learnpath_preview_frame" frameborder="0" height="400" width="100%" scrolling="auto" src="'.api_get_path(WEB_COURSE_PATH).$_course['path'].'/document'.str_replace('%2F', '/', urlencode($row_doc['path'])).'?'.api_get_cidreq().'"></iframe>'; |
|
| 6506 | 6506 | } else { |
| 6507 | - $return .= file_get_contents(api_get_path(SYS_COURSE_PATH) . $_course['path'] . '/document' . $row_doc['path']); |
|
| 6507 | + $return .= file_get_contents(api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'.$row_doc['path']); |
|
| 6508 | 6508 | } |
| 6509 | 6509 | |
| 6510 | 6510 | return $return; |
@@ -6528,8 +6528,8 @@ discard block |
||
| 6528 | 6528 | $item_description = $extra_info['description']; |
| 6529 | 6529 | } elseif (is_numeric($extra_info)) { |
| 6530 | 6530 | $sql = "SELECT title, description |
| 6531 | - FROM " . $tbl_quiz . " |
|
| 6532 | - WHERE c_id = ".$course_id." AND id = " . $extra_info; |
|
| 6531 | + FROM " . $tbl_quiz." |
|
| 6532 | + WHERE c_id = ".$course_id." AND id = ".$extra_info; |
|
| 6533 | 6533 | |
| 6534 | 6534 | $result = Database::query($sql); |
| 6535 | 6535 | $row = Database::fetch_array($result); |
@@ -6539,21 +6539,21 @@ discard block |
||
| 6539 | 6539 | $item_title = ''; |
| 6540 | 6540 | $item_description = ''; |
| 6541 | 6541 | } |
| 6542 | - $item_title = Security::remove_XSS($item_title); |
|
| 6543 | - $item_description = Security::remove_XSS($item_description); |
|
| 6542 | + $item_title = Security::remove_XSS($item_title); |
|
| 6543 | + $item_description = Security::remove_XSS($item_description); |
|
| 6544 | 6544 | |
| 6545 | 6545 | if ($id != 0 && is_array($extra_info)) |
| 6546 | 6546 | $parent = $extra_info['parent_item_id']; |
| 6547 | 6547 | else |
| 6548 | 6548 | $parent = 0; |
| 6549 | 6549 | |
| 6550 | - $sql = "SELECT * FROM " . $tbl_lp_item . " |
|
| 6551 | - WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id; |
|
| 6550 | + $sql = "SELECT * FROM ".$tbl_lp_item." |
|
| 6551 | + WHERE c_id = ".$course_id." AND lp_id = ".$this->lp_id; |
|
| 6552 | 6552 | |
| 6553 | 6553 | $result = Database::query($sql); |
| 6554 | - $arrLP = array (); |
|
| 6554 | + $arrLP = array(); |
|
| 6555 | 6555 | while ($row = Database :: fetch_array($result)) { |
| 6556 | - $arrLP[] = array ( |
|
| 6556 | + $arrLP[] = array( |
|
| 6557 | 6557 | 'id' => $row['id'], |
| 6558 | 6558 | 'item_type' => $row['item_type'], |
| 6559 | 6559 | 'title' => $row['title'], |
@@ -6575,7 +6575,7 @@ discard block |
||
| 6575 | 6575 | $arrLP = isset($this->arrMenu) ? $this->arrMenu : null; |
| 6576 | 6576 | unset ($this->arrMenu); |
| 6577 | 6577 | |
| 6578 | - $form = new FormValidator('quiz_form', 'POST', api_get_self() . '?' .$_SERVER['QUERY_STRING']); |
|
| 6578 | + $form = new FormValidator('quiz_form', 'POST', api_get_self().'?'.$_SERVER['QUERY_STRING']); |
|
| 6579 | 6579 | $defaults = []; |
| 6580 | 6580 | |
| 6581 | 6581 | if ($action == 'add') { |
@@ -6587,7 +6587,7 @@ discard block |
||
| 6587 | 6587 | } |
| 6588 | 6588 | |
| 6589 | 6589 | if (isset ($_GET['edit']) && $_GET['edit'] == 'true') { |
| 6590 | - $legend .= Display :: return_message(get_lang('Warning') . ' ! ' . get_lang('WarningEditingDocument')); |
|
| 6590 | + $legend .= Display :: return_message(get_lang('Warning').' ! '.get_lang('WarningEditingDocument')); |
|
| 6591 | 6591 | } |
| 6592 | 6592 | |
| 6593 | 6593 | $form->addHeader($legend); |
@@ -6606,7 +6606,7 @@ discard block |
||
| 6606 | 6606 | ); |
| 6607 | 6607 | $selectParent->addOption($this->name, 0); |
| 6608 | 6608 | |
| 6609 | - $arrHide = array ( |
|
| 6609 | + $arrHide = array( |
|
| 6610 | 6610 | $id |
| 6611 | 6611 | ); |
| 6612 | 6612 | for ($i = 0; $i < count($arrLP); $i++) { |
@@ -6619,7 +6619,7 @@ discard block |
||
| 6619 | 6619 | $selectParent->addOption( |
| 6620 | 6620 | $arrLP[$i]['title'], |
| 6621 | 6621 | $arrLP[$i]['id'], |
| 6622 | - ['style' => 'padding-left: ' . (20 + $arrLP[$i]['depth'] * 20) . 'px'] |
|
| 6622 | + ['style' => 'padding-left: '.(20 + $arrLP[$i]['depth'] * 20).'px'] |
|
| 6623 | 6623 | ); |
| 6624 | 6624 | |
| 6625 | 6625 | if ($parent == $arrLP[$i]['id']) { |
@@ -6632,7 +6632,7 @@ discard block |
||
| 6632 | 6632 | if ($arrLP[$i]['item_type'] == 'dir') { |
| 6633 | 6633 | $selectParent->addOption( |
| 6634 | 6634 | $arrLP[$i]['title'], |
| 6635 | - $arrLP[$i]['id'], ['style' => 'padding-left: ' . (20 + $arrLP[$i]['depth'] * 20) . 'px'] |
|
| 6635 | + $arrLP[$i]['id'], ['style' => 'padding-left: '.(20 + $arrLP[$i]['depth'] * 20).'px'] |
|
| 6636 | 6636 | ); |
| 6637 | 6637 | |
| 6638 | 6638 | if ($parent == $arrLP[$i]['id']) { |
@@ -6650,7 +6650,7 @@ discard block |
||
| 6650 | 6650 | |
| 6651 | 6651 | for ($i = 0; $i < count($arrLP); $i++) { |
| 6652 | 6652 | if ($arrLP[$i]['parent_item_id'] == $parent && $arrLP[$i]['id'] != $id) { |
| 6653 | - $selectPrevious->addOption(get_lang('After') . ' "' . $arrLP[$i]['title'] . '"', $arrLP[$i]['id']); |
|
| 6653 | + $selectPrevious->addOption(get_lang('After').' "'.$arrLP[$i]['title'].'"', $arrLP[$i]['id']); |
|
| 6654 | 6654 | |
| 6655 | 6655 | if (is_array($extra_info)) { |
| 6656 | 6656 | if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) { |
@@ -6672,7 +6672,7 @@ discard block |
||
| 6672 | 6672 | } |
| 6673 | 6673 | } |
| 6674 | 6674 | } |
| 6675 | - $arrHide = array (); |
|
| 6675 | + $arrHide = array(); |
|
| 6676 | 6676 | for ($i = 0; $i < count($arrLP); $i++) { |
| 6677 | 6677 | if ($arrLP[$i]['id'] != $id && $arrLP[$i]['item_type'] != 'dir') { |
| 6678 | 6678 | if (is_array($extra_info)) { |
@@ -6737,7 +6737,7 @@ discard block |
||
| 6737 | 6737 | |
| 6738 | 6738 | $form->setDefaults($defaults); |
| 6739 | 6739 | |
| 6740 | - return '<div class="sectioncomment">' . $form->returnForm() . '</div>'; |
|
| 6740 | + return '<div class="sectioncomment">'.$form->returnForm().'</div>'; |
|
| 6741 | 6741 | } |
| 6742 | 6742 | |
| 6743 | 6743 | /** |
@@ -6759,11 +6759,11 @@ discard block |
||
| 6759 | 6759 | } elseif (is_numeric($extra_info)) { |
| 6760 | 6760 | $TBL_DOCUMENT = Database :: get_course_table(TABLE_DOCUMENT); |
| 6761 | 6761 | |
| 6762 | - $sql = "SELECT * FROM " . $TBL_DOCUMENT . " |
|
| 6762 | + $sql = "SELECT * FROM ".$TBL_DOCUMENT." |
|
| 6763 | 6763 | WHERE |
| 6764 | 6764 | c_id = ".$course_id." AND |
| 6765 | - path LIKE '" . $uploadPath . "/%/%htm%' AND |
|
| 6766 | - id = " . (int) $extra_info . " |
|
| 6765 | + path LIKE '" . $uploadPath."/%/%htm%' AND |
|
| 6766 | + id = " . (int) $extra_info." |
|
| 6767 | 6767 | ORDER BY id ASC"; |
| 6768 | 6768 | |
| 6769 | 6769 | $res_hot = Database::query($sql); |
@@ -6787,11 +6787,11 @@ discard block |
||
| 6787 | 6787 | } |
| 6788 | 6788 | |
| 6789 | 6789 | $sql = "SELECT * FROM $tbl_lp_item |
| 6790 | - WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id; |
|
| 6790 | + WHERE c_id = ".$course_id." AND lp_id = ".$this->lp_id; |
|
| 6791 | 6791 | $result = Database::query($sql); |
| 6792 | - $arrLP = array (); |
|
| 6792 | + $arrLP = array(); |
|
| 6793 | 6793 | while ($row = Database :: fetch_array($result)) { |
| 6794 | - $arrLP[] = array ( |
|
| 6794 | + $arrLP[] = array( |
|
| 6795 | 6795 | 'id' => $row['id'], |
| 6796 | 6796 | 'item_type' => $row['item_type'], |
| 6797 | 6797 | 'title' => $row['title'], |
@@ -6828,10 +6828,10 @@ discard block |
||
| 6828 | 6828 | $return .= $legend; |
| 6829 | 6829 | $return .= '<table cellpadding="0" cellspacing="0" class="lp_form">'; |
| 6830 | 6830 | $return .= '<tr>'; |
| 6831 | - $return .= '<td class="label"><label for="idParent">' . get_lang('Parent') . ' :</label></td>'; |
|
| 6831 | + $return .= '<td class="label"><label for="idParent">'.get_lang('Parent').' :</label></td>'; |
|
| 6832 | 6832 | $return .= '<td class="input">'; |
| 6833 | 6833 | $return .= '<select id="idParent" name="parent" onChange="javascript: load_cbo(this.value);" size="1">'; |
| 6834 | - $return .= '<option class="top" value="0">' . $this->name . '</option>'; |
|
| 6834 | + $return .= '<option class="top" value="0">'.$this->name.'</option>'; |
|
| 6835 | 6835 | $arrHide = array( |
| 6836 | 6836 | $id |
| 6837 | 6837 | ); |
@@ -6840,13 +6840,13 @@ discard block |
||
| 6840 | 6840 | for ($i = 0; $i < count($arrLP); $i++) { |
| 6841 | 6841 | if ($action != 'add') { |
| 6842 | 6842 | if ($arrLP[$i]['item_type'] == 'dir' && !in_array($arrLP[$i]['id'], $arrHide) && !in_array($arrLP[$i]['parent_item_id'], $arrHide)) { |
| 6843 | - $return .= '<option ' . (($parent == $arrLP[$i]['id']) ? 'selected="selected" ' : '') . 'style="padding-left:' . ($arrLP[$i]['depth'] * 10) . 'px;" value="' . $arrLP[$i]['id'] . '">' . $arrLP[$i]['title'] . '</option>'; |
|
| 6843 | + $return .= '<option '.(($parent == $arrLP[$i]['id']) ? 'selected="selected" ' : '').'style="padding-left:'.($arrLP[$i]['depth'] * 10).'px;" value="'.$arrLP[$i]['id'].'">'.$arrLP[$i]['title'].'</option>'; |
|
| 6844 | 6844 | } else { |
| 6845 | 6845 | $arrHide[] = $arrLP[$i]['id']; |
| 6846 | 6846 | } |
| 6847 | 6847 | } else { |
| 6848 | 6848 | if ($arrLP[$i]['item_type'] == 'dir') |
| 6849 | - $return .= '<option ' . (($parent == $arrLP[$i]['id']) ? 'selected="selected" ' : '') . 'style="padding-left:' . ($arrLP[$i]['depth'] * 10) . 'px;" value="' . $arrLP[$i]['id'] . '">' . $arrLP[$i]['title'] . '</option>'; |
|
| 6849 | + $return .= '<option '.(($parent == $arrLP[$i]['id']) ? 'selected="selected" ' : '').'style="padding-left:'.($arrLP[$i]['depth'] * 10).'px;" value="'.$arrLP[$i]['id'].'">'.$arrLP[$i]['title'].'</option>'; |
|
| 6850 | 6850 | } |
| 6851 | 6851 | } |
| 6852 | 6852 | reset($arrLP); |
@@ -6856,10 +6856,10 @@ discard block |
||
| 6856 | 6856 | $return .= '</td>'; |
| 6857 | 6857 | $return .= '</tr>'; |
| 6858 | 6858 | $return .= '<tr>'; |
| 6859 | - $return .= '<td class="label"><label for="previous">' . get_lang('Position') . ' :</label></td>'; |
|
| 6859 | + $return .= '<td class="label"><label for="previous">'.get_lang('Position').' :</label></td>'; |
|
| 6860 | 6860 | $return .= '<td class="input">'; |
| 6861 | 6861 | $return .= '<select id="previous" name="previous" size="1">'; |
| 6862 | - $return .= '<option class="top" value="0">' . get_lang('FirstPosition') . '</option>'; |
|
| 6862 | + $return .= '<option class="top" value="0">'.get_lang('FirstPosition').'</option>'; |
|
| 6863 | 6863 | |
| 6864 | 6864 | for ($i = 0; $i < count($arrLP); $i++) { |
| 6865 | 6865 | if ($arrLP[$i]['parent_item_id'] == $parent && $arrLP[$i]['id'] != $id) { |
@@ -6869,7 +6869,7 @@ discard block |
||
| 6869 | 6869 | else |
| 6870 | 6870 | $selected = ''; |
| 6871 | 6871 | |
| 6872 | - $return .= '<option ' . $selected . 'value="' . $arrLP[$i]['id'] . '">' . get_lang('After') . ' "' . $arrLP[$i]['title'] . '"</option>'; |
|
| 6872 | + $return .= '<option '.$selected.'value="'.$arrLP[$i]['id'].'">'.get_lang('After').' "'.$arrLP[$i]['title'].'"</option>'; |
|
| 6873 | 6873 | } |
| 6874 | 6874 | } |
| 6875 | 6875 | |
@@ -6879,8 +6879,8 @@ discard block |
||
| 6879 | 6879 | |
| 6880 | 6880 | if ($action != 'move') { |
| 6881 | 6881 | $return .= '<tr>'; |
| 6882 | - $return .= '<td class="label"><label for="idTitle">' . get_lang('Title') . ' :</label></td>'; |
|
| 6883 | - $return .= '<td class="input"><input id="idTitle" name="title" type="text" value="' . $item_title . '" /></td>'; |
|
| 6882 | + $return .= '<td class="label"><label for="idTitle">'.get_lang('Title').' :</label></td>'; |
|
| 6883 | + $return .= '<td class="input"><input id="idTitle" name="title" type="text" value="'.$item_title.'" /></td>'; |
|
| 6884 | 6884 | $return .= '</tr>'; |
| 6885 | 6885 | $id_prerequisite = 0; |
| 6886 | 6886 | if (is_array($arrLP) && count($arrLP) > 0) { |
@@ -6891,7 +6891,7 @@ discard block |
||
| 6891 | 6891 | } |
| 6892 | 6892 | } |
| 6893 | 6893 | |
| 6894 | - $arrHide = array (); |
|
| 6894 | + $arrHide = array(); |
|
| 6895 | 6895 | for ($i = 0; $i < count($arrLP); $i++) { |
| 6896 | 6896 | if ($arrLP[$i]['id'] != $id && $arrLP[$i]['item_type'] != 'dir') { |
| 6897 | 6897 | if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) |
@@ -6904,22 +6904,22 @@ discard block |
||
| 6904 | 6904 | } |
| 6905 | 6905 | |
| 6906 | 6906 | $return .= '<tr>'; |
| 6907 | - $return .= '<td> </td><td><button class="save" name="submit_button" action="edit" type="submit">' . get_lang('SaveHotpotatoes') . '</button></td>'; |
|
| 6907 | + $return .= '<td> </td><td><button class="save" name="submit_button" action="edit" type="submit">'.get_lang('SaveHotpotatoes').'</button></td>'; |
|
| 6908 | 6908 | $return .= '</tr>'; |
| 6909 | 6909 | $return .= '</table>'; |
| 6910 | 6910 | |
| 6911 | 6911 | if ($action == 'move') { |
| 6912 | - $return .= '<input name="title" type="hidden" value="' . $item_title . '" />'; |
|
| 6913 | - $return .= '<input name="description" type="hidden" value="' . $item_description . '" />'; |
|
| 6912 | + $return .= '<input name="title" type="hidden" value="'.$item_title.'" />'; |
|
| 6913 | + $return .= '<input name="description" type="hidden" value="'.$item_description.'" />'; |
|
| 6914 | 6914 | } |
| 6915 | 6915 | |
| 6916 | 6916 | if (is_numeric($extra_info)) { |
| 6917 | - $return .= '<input name="path" type="hidden" value="' . $extra_info . '" />'; |
|
| 6917 | + $return .= '<input name="path" type="hidden" value="'.$extra_info.'" />'; |
|
| 6918 | 6918 | } elseif (is_array($extra_info)) { |
| 6919 | - $return .= '<input name="path" type="hidden" value="' . $extra_info['path'] . '" />'; |
|
| 6919 | + $return .= '<input name="path" type="hidden" value="'.$extra_info['path'].'" />'; |
|
| 6920 | 6920 | } |
| 6921 | - $return .= '<input name="type" type="hidden" value="' . TOOL_HOTPOTATOES . '" />'; |
|
| 6922 | - $return .= '<input name="post_time" type="hidden" value="' . time() . '" />'; |
|
| 6921 | + $return .= '<input name="type" type="hidden" value="'.TOOL_HOTPOTATOES.'" />'; |
|
| 6922 | + $return .= '<input name="post_time" type="hidden" value="'.time().'" />'; |
|
| 6923 | 6923 | $return .= '</form>'; |
| 6924 | 6924 | |
| 6925 | 6925 | return $return; |
@@ -6942,8 +6942,8 @@ discard block |
||
| 6942 | 6942 | $item_title = stripslashes($extra_info['title']); |
| 6943 | 6943 | } elseif (is_numeric($extra_info)) { |
| 6944 | 6944 | $sql = "SELECT forum_title as title, forum_comment as comment |
| 6945 | - FROM " . $tbl_forum . " |
|
| 6946 | - WHERE c_id = ".$course_id." AND forum_id = " . $extra_info; |
|
| 6945 | + FROM " . $tbl_forum." |
|
| 6946 | + WHERE c_id = ".$course_id." AND forum_id = ".$extra_info; |
|
| 6947 | 6947 | |
| 6948 | 6948 | $result = Database::query($sql); |
| 6949 | 6949 | $row = Database :: fetch_array($result); |
@@ -6961,7 +6961,7 @@ discard block |
||
| 6961 | 6961 | $parent = 0; |
| 6962 | 6962 | } |
| 6963 | 6963 | |
| 6964 | - $sql = "SELECT * FROM " . $tbl_lp_item . " |
|
| 6964 | + $sql = "SELECT * FROM ".$tbl_lp_item." |
|
| 6965 | 6965 | WHERE |
| 6966 | 6966 | c_id = ".$course_id." AND |
| 6967 | 6967 | lp_id = " . $this->lp_id; |
@@ -6969,7 +6969,7 @@ discard block |
||
| 6969 | 6969 | $arrLP = array(); |
| 6970 | 6970 | |
| 6971 | 6971 | while ($row = Database :: fetch_array($result)) { |
| 6972 | - $arrLP[] = array ( |
|
| 6972 | + $arrLP[] = array( |
|
| 6973 | 6973 | 'id' => $row['id'], |
| 6974 | 6974 | 'item_type' => $row['item_type'], |
| 6975 | 6975 | 'title' => $row['title'], |
@@ -6998,7 +6998,7 @@ discard block |
||
| 6998 | 6998 | $legend = get_lang('EditCurrentForum'); |
| 6999 | 6999 | } |
| 7000 | 7000 | |
| 7001 | - $form = new FormValidator('forum_form', 'POST', api_get_self() . '?' .$_SERVER['QUERY_STRING']); |
|
| 7001 | + $form = new FormValidator('forum_form', 'POST', api_get_self().'?'.$_SERVER['QUERY_STRING']); |
|
| 7002 | 7002 | $defaults = []; |
| 7003 | 7003 | |
| 7004 | 7004 | $form->addHeader($legend); |
@@ -7027,7 +7027,7 @@ discard block |
||
| 7027 | 7027 | $selectParent->addOption( |
| 7028 | 7028 | $arrLP[$i]['title'], |
| 7029 | 7029 | $arrLP[$i]['id'], |
| 7030 | - ['style' => 'padding-left: ' . (20 + $arrLP[$i]['depth'] * 20) . 'px'] |
|
| 7030 | + ['style' => 'padding-left: '.(20 + $arrLP[$i]['depth'] * 20).'px'] |
|
| 7031 | 7031 | ); |
| 7032 | 7032 | |
| 7033 | 7033 | if ($parent == $arrLP[$i]['id']) { |
@@ -7041,7 +7041,7 @@ discard block |
||
| 7041 | 7041 | $selectParent->addOption( |
| 7042 | 7042 | $arrLP[$i]['title'], |
| 7043 | 7043 | $arrLP[$i]['id'], |
| 7044 | - ['style' => 'padding-left: ' . (20 + $arrLP[$i]['depth'] * 20) . 'px'] |
|
| 7044 | + ['style' => 'padding-left: '.(20 + $arrLP[$i]['depth'] * 20).'px'] |
|
| 7045 | 7045 | ); |
| 7046 | 7046 | |
| 7047 | 7047 | if ($parent == $arrLP[$i]['id']) { |
@@ -7065,7 +7065,7 @@ discard block |
||
| 7065 | 7065 | |
| 7066 | 7066 | for ($i = 0; $i < count($arrLP); $i++) { |
| 7067 | 7067 | if ($arrLP[$i]['parent_item_id'] == $parent && $arrLP[$i]['id'] != $id) { |
| 7068 | - $selectPrevious->addOption(get_lang('After') . ' "' . $arrLP[$i]['title'] . '"', $arrLP[$i]['id']); |
|
| 7068 | + $selectPrevious->addOption(get_lang('After').' "'.$arrLP[$i]['title'].'"', $arrLP[$i]['id']); |
|
| 7069 | 7069 | |
| 7070 | 7070 | if (isset($extra_info['previous_item_id']) && $extra_info['previous_item_id'] == $arrLP[$i]['id']) { |
| 7071 | 7071 | $selectPrevious->setSelected($arrLP[$i]['id']); |
@@ -7117,7 +7117,7 @@ discard block |
||
| 7117 | 7117 | $form->addHidden('post_time', time()); |
| 7118 | 7118 | $form->setDefaults($defaults); |
| 7119 | 7119 | |
| 7120 | - return '<div class="sectioncomment">' . $form->returnForm() . '</div>'; |
|
| 7120 | + return '<div class="sectioncomment">'.$form->returnForm().'</div>'; |
|
| 7121 | 7121 | } |
| 7122 | 7122 | |
| 7123 | 7123 | /** |
@@ -7140,7 +7140,7 @@ discard block |
||
| 7140 | 7140 | $item_title = stripslashes($extra_info['title']); |
| 7141 | 7141 | } elseif (is_numeric($extra_info)) { |
| 7142 | 7142 | $sql = "SELECT thread_title as title FROM $tbl_forum |
| 7143 | - WHERE c_id = $course_id AND thread_id = " . $extra_info; |
|
| 7143 | + WHERE c_id = $course_id AND thread_id = ".$extra_info; |
|
| 7144 | 7144 | |
| 7145 | 7145 | $result = Database::query($sql); |
| 7146 | 7146 | $row = Database :: fetch_array($result); |
@@ -7158,15 +7158,15 @@ discard block |
||
| 7158 | 7158 | $parent = 0; |
| 7159 | 7159 | } |
| 7160 | 7160 | |
| 7161 | - $sql = "SELECT * FROM " . $tbl_lp_item . " |
|
| 7162 | - WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id; |
|
| 7161 | + $sql = "SELECT * FROM ".$tbl_lp_item." |
|
| 7162 | + WHERE c_id = ".$course_id." AND lp_id = ".$this->lp_id; |
|
| 7163 | 7163 | |
| 7164 | 7164 | $result = Database::query($sql); |
| 7165 | 7165 | |
| 7166 | - $arrLP = array (); |
|
| 7166 | + $arrLP = array(); |
|
| 7167 | 7167 | |
| 7168 | 7168 | while ($row = Database :: fetch_array($result)) { |
| 7169 | - $arrLP[] = array ( |
|
| 7169 | + $arrLP[] = array( |
|
| 7170 | 7170 | 'id' => $row['id'], |
| 7171 | 7171 | 'item_type' => $row['item_type'], |
| 7172 | 7172 | 'title' => $row['title'], |
@@ -7187,7 +7187,7 @@ discard block |
||
| 7187 | 7187 | $arrLP = isset($this->arrMenu) ? $this->arrMenu : null; |
| 7188 | 7188 | unset ($this->arrMenu); |
| 7189 | 7189 | |
| 7190 | - $form = new FormValidator('thread_form', 'POST', api_get_self() . '?' .$_SERVER['QUERY_STRING']); |
|
| 7190 | + $form = new FormValidator('thread_form', 'POST', api_get_self().'?'.$_SERVER['QUERY_STRING']); |
|
| 7191 | 7191 | $defaults = []; |
| 7192 | 7192 | |
| 7193 | 7193 | if ($action == 'add') { |
@@ -7207,7 +7207,7 @@ discard block |
||
| 7207 | 7207 | ); |
| 7208 | 7208 | $selectParent->addOption($this->name, 0); |
| 7209 | 7209 | |
| 7210 | - $arrHide = array ( |
|
| 7210 | + $arrHide = array( |
|
| 7211 | 7211 | $id |
| 7212 | 7212 | ); |
| 7213 | 7213 | |
@@ -7221,7 +7221,7 @@ discard block |
||
| 7221 | 7221 | $selectParent->addOption( |
| 7222 | 7222 | $arrLP[$i]['title'], |
| 7223 | 7223 | $arrLP[$i]['id'], |
| 7224 | - ['style' => 'padding-left: ' . (20 + $arrLP[$i]['depth'] * 20) . 'px'] |
|
| 7224 | + ['style' => 'padding-left: '.(20 + $arrLP[$i]['depth'] * 20).'px'] |
|
| 7225 | 7225 | ); |
| 7226 | 7226 | |
| 7227 | 7227 | if ($parent == $arrLP[$i]['id']) { |
@@ -7235,7 +7235,7 @@ discard block |
||
| 7235 | 7235 | $selectParent->addOption( |
| 7236 | 7236 | $arrLP[$i]['title'], |
| 7237 | 7237 | $arrLP[$i]['id'], |
| 7238 | - ['style' => 'padding-left: ' . (20 + $arrLP[$i]['depth'] * 20) . 'px'] |
|
| 7238 | + ['style' => 'padding-left: '.(20 + $arrLP[$i]['depth'] * 20).'px'] |
|
| 7239 | 7239 | ); |
| 7240 | 7240 | |
| 7241 | 7241 | if ($parent == $arrLP[$i]['id']) { |
@@ -7255,7 +7255,7 @@ discard block |
||
| 7255 | 7255 | for ($i = 0; $i < count($arrLP); $i++) { |
| 7256 | 7256 | if ($arrLP[$i]['parent_item_id'] == $parent && $arrLP[$i]['id'] != $id) { |
| 7257 | 7257 | $selectPrevious->addOption( |
| 7258 | - get_lang('After') . ' "' . $arrLP[$i]['title'] . '"', |
|
| 7258 | + get_lang('After').' "'.$arrLP[$i]['title'].'"', |
|
| 7259 | 7259 | $arrLP[$i]['id'] |
| 7260 | 7260 | ); |
| 7261 | 7261 | |
@@ -7355,8 +7355,8 @@ discard block |
||
| 7355 | 7355 | if ($id != 0 && is_array($extra_info)) { |
| 7356 | 7356 | $item_title = $extra_info['title']; |
| 7357 | 7357 | $item_description = $extra_info['description']; |
| 7358 | - $item_path = api_get_path(WEB_COURSE_PATH) . $_course['path'] . '/scorm/' . $this->path . '/' . stripslashes($extra_info['path']); |
|
| 7359 | - $item_path_fck = '/scorm/' . $this->path . '/' . stripslashes($extra_info['path']); |
|
| 7358 | + $item_path = api_get_path(WEB_COURSE_PATH).$_course['path'].'/scorm/'.$this->path.'/'.stripslashes($extra_info['path']); |
|
| 7359 | + $item_path_fck = '/scorm/'.$this->path.'/'.stripslashes($extra_info['path']); |
|
| 7360 | 7360 | } else { |
| 7361 | 7361 | $item_title = ''; |
| 7362 | 7362 | $item_description = ''; |
@@ -7370,17 +7370,17 @@ discard block |
||
| 7370 | 7370 | } |
| 7371 | 7371 | |
| 7372 | 7372 | $id = intval($id); |
| 7373 | - $sql = "SELECT * FROM " . $tbl_lp_item . " |
|
| 7373 | + $sql = "SELECT * FROM ".$tbl_lp_item." |
|
| 7374 | 7374 | WHERE |
| 7375 | 7375 | c_id = ".$course_id." AND |
| 7376 | - lp_id = " . $this->lp_id . " AND |
|
| 7376 | + lp_id = " . $this->lp_id." AND |
|
| 7377 | 7377 | id != $id"; |
| 7378 | 7378 | |
| 7379 | 7379 | if ($item_type == 'dir') |
| 7380 | 7380 | $sql .= " AND parent_item_id = 0"; |
| 7381 | 7381 | |
| 7382 | 7382 | $result = Database::query($sql); |
| 7383 | - $arrLP = array (); |
|
| 7383 | + $arrLP = array(); |
|
| 7384 | 7384 | |
| 7385 | 7385 | while ($row = Database :: fetch_array($result)) { |
| 7386 | 7386 | $arrLP[] = array( |
@@ -7405,9 +7405,9 @@ discard block |
||
| 7405 | 7405 | unset($this->arrMenu); |
| 7406 | 7406 | |
| 7407 | 7407 | $gradebook = isset($_GET['gradebook']) ? Security :: remove_XSS($_GET['gradebook']) : null; |
| 7408 | - $url = api_get_self() . '?' .api_get_cidreq().'&gradeboook='.$gradebook.'&action='.$action.'&type='.$item_type.'&lp_id='.$this->lp_id; |
|
| 7408 | + $url = api_get_self().'?'.api_get_cidreq().'&gradeboook='.$gradebook.'&action='.$action.'&type='.$item_type.'&lp_id='.$this->lp_id; |
|
| 7409 | 7409 | |
| 7410 | - $form = new FormValidator('form', 'POST', $url); |
|
| 7410 | + $form = new FormValidator('form', 'POST', $url); |
|
| 7411 | 7411 | |
| 7412 | 7412 | $defaults['title'] = api_html_entity_decode($item_title, ENT_QUOTES, $charset); |
| 7413 | 7413 | $defaults['description'] = $item_description; |
@@ -7450,7 +7450,7 @@ discard block |
||
| 7450 | 7450 | $parent_select = $form->addElement('select', 'parent', get_lang('Parent'), '', array('id' => 'idParent', 'onchange' => "javascript: load_cbo(this.value);")); |
| 7451 | 7451 | |
| 7452 | 7452 | foreach ($arrHide as $key => $value) { |
| 7453 | - $parent_select->addOption($value['value'], $key, 'style="padding-left:' . $value['padding'] . 'px;"'); |
|
| 7453 | + $parent_select->addOption($value['value'], $key, 'style="padding-left:'.$value['padding'].'px;"'); |
|
| 7454 | 7454 | } |
| 7455 | 7455 | if (!empty($s_selected_parent)) { |
| 7456 | 7456 | $parent_select->setSelected($s_selected_parent); |
@@ -7472,16 +7472,16 @@ discard block |
||
| 7472 | 7472 | $s_selected_position = $arrLP[$i]['id']; |
| 7473 | 7473 | } |
| 7474 | 7474 | |
| 7475 | - $arrHide[$arrLP[$i]['id']]['value'] = get_lang('After') . ' "' . $arrLP[$i]['title'] . '"'; |
|
| 7475 | + $arrHide[$arrLP[$i]['id']]['value'] = get_lang('After').' "'.$arrLP[$i]['title'].'"'; |
|
| 7476 | 7476 | } |
| 7477 | 7477 | } |
| 7478 | 7478 | |
| 7479 | 7479 | $position = $form->addElement('select', 'previous', get_lang('Position'), '', array('id' => 'previous')); |
| 7480 | 7480 | $padding = isset($value['padding']) ? $value['padding'] : 0; |
| 7481 | - $position->addOption(get_lang('FirstPosition'), 0, 'style="padding-left:' . $padding . 'px;"'); |
|
| 7481 | + $position->addOption(get_lang('FirstPosition'), 0, 'style="padding-left:'.$padding.'px;"'); |
|
| 7482 | 7482 | |
| 7483 | 7483 | foreach ($arrHide as $key => $value) { |
| 7484 | - $position->addOption($value['value'] . '"', $key, 'style="padding-left:' . $padding . 'px;"'); |
|
| 7484 | + $position->addOption($value['value'].'"', $key, 'style="padding-left:'.$padding.'px;"'); |
|
| 7485 | 7485 | } |
| 7486 | 7486 | |
| 7487 | 7487 | if (!empty ($s_selected_position)) { |
@@ -7508,7 +7508,7 @@ discard block |
||
| 7508 | 7508 | //$item_type == 'asset' || |
| 7509 | 7509 | if (($item_type == 'sco') && ($extension == 'html' || $extension == 'htm')) { |
| 7510 | 7510 | if ($item_type == 'sco') { |
| 7511 | - $form->addElement('html', '<script>alert("' . get_lang('WarningWhenEditingScorm') . '")</script>'); |
|
| 7511 | + $form->addElement('html', '<script>alert("'.get_lang('WarningWhenEditingScorm').'")</script>'); |
|
| 7512 | 7512 | } |
| 7513 | 7513 | $renderer = $form->defaultRenderer(); |
| 7514 | 7514 | $renderer->setElementTemplate('<br /> {label}<br />{element}', 'content_lp'); |
@@ -7568,8 +7568,8 @@ discard block |
||
| 7568 | 7568 | // We don't display the document form if it's not an editable document (html or txt file). |
| 7569 | 7569 | if ($action == "add") { |
| 7570 | 7570 | if (is_numeric($extra_info)) { |
| 7571 | - $sql_doc = "SELECT path FROM " . $tbl_doc . " |
|
| 7572 | - WHERE c_id = ".$course_id." AND id = " . intval($extra_info); |
|
| 7571 | + $sql_doc = "SELECT path FROM ".$tbl_doc." |
|
| 7572 | + WHERE c_id = ".$course_id." AND id = ".intval($extra_info); |
|
| 7573 | 7573 | $result = Database::query($sql_doc); |
| 7574 | 7574 | $path_file = Database :: result($result, 0, 0); |
| 7575 | 7575 | $path_parts = pathinfo($path_file); |
@@ -7587,13 +7587,13 @@ discard block |
||
| 7587 | 7587 | $item_title = stripslashes($path_parts['filename']); |
| 7588 | 7588 | } |
| 7589 | 7589 | } elseif (is_numeric($extra_info)) { |
| 7590 | - $sql_doc = "SELECT path, title FROM " . $tbl_doc . " |
|
| 7590 | + $sql_doc = "SELECT path, title FROM ".$tbl_doc." |
|
| 7591 | 7591 | WHERE |
| 7592 | 7592 | c_id = ".$course_id." AND |
| 7593 | 7593 | id = " . intval($extra_info); |
| 7594 | 7594 | |
| 7595 | 7595 | $result = Database::query($sql_doc); |
| 7596 | - $row = Database::fetch_array($result); |
|
| 7596 | + $row = Database::fetch_array($result); |
|
| 7597 | 7597 | $item_title = $row['title']; |
| 7598 | 7598 | $item_title = str_replace('_', ' ', $item_title); |
| 7599 | 7599 | if (empty ($item_title)) { |
@@ -7616,7 +7616,7 @@ discard block |
||
| 7616 | 7616 | WHERE c_id = $course_id AND lp_id = ".$this->lp_id; |
| 7617 | 7617 | |
| 7618 | 7618 | $result = Database::query($sql); |
| 7619 | - $arrLP = array (); |
|
| 7619 | + $arrLP = array(); |
|
| 7620 | 7620 | while ($row = Database :: fetch_array($result)) { |
| 7621 | 7621 | $arrLP[] = array( |
| 7622 | 7622 | 'id' => $row['id'], |
@@ -7650,9 +7650,9 @@ discard block |
||
| 7650 | 7650 | $return .= '</legend>'; |
| 7651 | 7651 | |
| 7652 | 7652 | if (isset ($_GET['edit']) && $_GET['edit'] == 'true') { |
| 7653 | - $return .= Display :: return_message('<strong>' . get_lang('Warning') . ' !</strong><br />' . get_lang('WarningEditingDocument'), false); |
|
| 7653 | + $return .= Display :: return_message('<strong>'.get_lang('Warning').' !</strong><br />'.get_lang('WarningEditingDocument'), false); |
|
| 7654 | 7654 | } |
| 7655 | - $form = new FormValidator('form', 'POST', api_get_self() . '?' .$_SERVER['QUERY_STRING'], '', array('enctype'=> "multipart/form-data")); |
|
| 7655 | + $form = new FormValidator('form', 'POST', api_get_self().'?'.$_SERVER['QUERY_STRING'], '', array('enctype'=> "multipart/form-data")); |
|
| 7656 | 7656 | $defaults['title'] = Security :: remove_XSS($item_title); |
| 7657 | 7657 | if (empty($item_title)) { |
| 7658 | 7658 | $defaults['title'] = Security::remove_XSS($item_title); |
@@ -7709,15 +7709,15 @@ discard block |
||
| 7709 | 7709 | } |
| 7710 | 7710 | |
| 7711 | 7711 | $parent_select = $form->addSelect('parent', get_lang('Parent'), [], ['id' => 'idParent', 'onchange' => 'javascript: load_cbo(this.value);']); |
| 7712 | - $my_count=0; |
|
| 7712 | + $my_count = 0; |
|
| 7713 | 7713 | foreach ($arrHide as $key => $value) { |
| 7714 | - if ($my_count!=0) { |
|
| 7714 | + if ($my_count != 0) { |
|
| 7715 | 7715 | // The LP name is also the first section and is not in the same charset like the other sections. |
| 7716 | 7716 | $value['value'] = Security :: remove_XSS($value['value']); |
| 7717 | - $parent_select->addOption($value['value'], $key, 'style="padding-left:' . $value['padding'] . 'px;"'); |
|
| 7717 | + $parent_select->addOption($value['value'], $key, 'style="padding-left:'.$value['padding'].'px;"'); |
|
| 7718 | 7718 | } else { |
| 7719 | 7719 | $value['value'] = Security :: remove_XSS($value['value']); |
| 7720 | - $parent_select->addOption($value['value'], $key, 'style="padding-left:' . $value['padding'] . 'px;"'); |
|
| 7720 | + $parent_select->addOption($value['value'], $key, 'style="padding-left:'.$value['padding'].'px;"'); |
|
| 7721 | 7721 | } |
| 7722 | 7722 | $my_count++; |
| 7723 | 7723 | } |
@@ -7725,7 +7725,7 @@ discard block |
||
| 7725 | 7725 | if (!empty($id)) { |
| 7726 | 7726 | $parent_select->setSelected($parent); |
| 7727 | 7727 | } else { |
| 7728 | - $parent_item_id = isset($_SESSION['parent_item_id']) ? $_SESSION['parent_item_id'] : 0 ; |
|
| 7728 | + $parent_item_id = isset($_SESSION['parent_item_id']) ? $_SESSION['parent_item_id'] : 0; |
|
| 7729 | 7729 | $parent_select->setSelected($parent_item_id); |
| 7730 | 7730 | } |
| 7731 | 7731 | |
@@ -7742,7 +7742,7 @@ discard block |
||
| 7742 | 7742 | if (isset($extra_info['previous_item_id']) && $extra_info['previous_item_id'] == $arrLP[$i]['id'] || $action == 'add') { |
| 7743 | 7743 | $s_selected_position = $arrLP[$i]['id']; |
| 7744 | 7744 | } |
| 7745 | - $arrHide[$arrLP[$i]['id']]['value'] = get_lang('After') . ' "' . $arrLP[$i]['title'] . '"'; |
|
| 7745 | + $arrHide[$arrLP[$i]['id']]['value'] = get_lang('After').' "'.$arrLP[$i]['title'].'"'; |
|
| 7746 | 7746 | } |
| 7747 | 7747 | } |
| 7748 | 7748 | |
@@ -7750,8 +7750,8 @@ discard block |
||
| 7750 | 7750 | $position->addOption(get_lang('FirstPosition'), 0); |
| 7751 | 7751 | |
| 7752 | 7752 | foreach ($arrHide as $key => $value) { |
| 7753 | - $padding = isset($value['padding']) ? $value['padding']: 20; |
|
| 7754 | - $position->addOption($value['value'], $key, 'style="padding-left:' . $padding . 'px;"'); |
|
| 7753 | + $padding = isset($value['padding']) ? $value['padding'] : 20; |
|
| 7754 | + $position->addOption($value['value'], $key, 'style="padding-left:'.$padding.'px;"'); |
|
| 7755 | 7755 | } |
| 7756 | 7756 | |
| 7757 | 7757 | $position->setSelected($s_selected_position); |
@@ -7821,7 +7821,7 @@ discard block |
||
| 7821 | 7821 | $relative_path = array_slice($relative_path, 1, $cnt); |
| 7822 | 7822 | $relative_path = implode('/', $relative_path); |
| 7823 | 7823 | if (strlen($relative_path) > 0) { |
| 7824 | - $relative_path = $relative_path . '/'; |
|
| 7824 | + $relative_path = $relative_path.'/'; |
|
| 7825 | 7825 | } |
| 7826 | 7826 | } else { |
| 7827 | 7827 | $result = $this->generate_lp_folder($_course); |
@@ -7903,8 +7903,8 @@ discard block |
||
| 7903 | 7903 | $item_url = stripslashes($extra_info['url']); |
| 7904 | 7904 | } elseif (is_numeric($extra_info)) { |
| 7905 | 7905 | $extra_info = intval($extra_info); |
| 7906 | - $sql = "SELECT title, description, url FROM " . $tbl_link . " |
|
| 7907 | - WHERE c_id = ".$course_id." AND id = " . $extra_info; |
|
| 7906 | + $sql = "SELECT title, description, url FROM ".$tbl_link." |
|
| 7907 | + WHERE c_id = ".$course_id." AND id = ".$extra_info; |
|
| 7908 | 7908 | $result = Database::query($sql); |
| 7909 | 7909 | $row = Database :: fetch_array($result); |
| 7910 | 7910 | $item_title = $row['title']; |
@@ -7916,7 +7916,7 @@ discard block |
||
| 7916 | 7916 | $item_url = ''; |
| 7917 | 7917 | } |
| 7918 | 7918 | |
| 7919 | - $form = new FormValidator('edit_link', 'POST', api_get_self() . '?' .$_SERVER['QUERY_STRING']); |
|
| 7919 | + $form = new FormValidator('edit_link', 'POST', api_get_self().'?'.$_SERVER['QUERY_STRING']); |
|
| 7920 | 7920 | $defaults = []; |
| 7921 | 7921 | |
| 7922 | 7922 | if ($id != 0 && is_array($extra_info)) { |
@@ -7925,8 +7925,8 @@ discard block |
||
| 7925 | 7925 | $parent = 0; |
| 7926 | 7926 | } |
| 7927 | 7927 | |
| 7928 | - $sql = "SELECT * FROM " . $tbl_lp_item . " |
|
| 7929 | - WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id; |
|
| 7928 | + $sql = "SELECT * FROM ".$tbl_lp_item." |
|
| 7929 | + WHERE c_id = ".$course_id." AND lp_id = ".$this->lp_id; |
|
| 7930 | 7930 | $result = Database::query($sql); |
| 7931 | 7931 | $arrLP = array(); |
| 7932 | 7932 | |
@@ -7990,7 +7990,7 @@ discard block |
||
| 7990 | 7990 | $selectParent->addOption( |
| 7991 | 7991 | $arrLP[$i]['title'], |
| 7992 | 7992 | $arrLP[$i]['id'], |
| 7993 | - ['style' => 'padding-left: ' . (20 + $arrLP[$i]['depth'] * 20) . 'px;'] |
|
| 7993 | + ['style' => 'padding-left: '.(20 + $arrLP[$i]['depth'] * 20).'px;'] |
|
| 7994 | 7994 | ); |
| 7995 | 7995 | |
| 7996 | 7996 | if ($parent == $arrLP[$i]['id']) { |
@@ -8004,7 +8004,7 @@ discard block |
||
| 8004 | 8004 | $selectParent->addOption( |
| 8005 | 8005 | $arrLP[$i]['title'], |
| 8006 | 8006 | $arrLP[$i]['id'], |
| 8007 | - ['style' => 'padding-left: ' . (20 + $arrLP[$i]['depth'] * 20) . 'px'] |
|
| 8007 | + ['style' => 'padding-left: '.(20 + $arrLP[$i]['depth'] * 20).'px'] |
|
| 8008 | 8008 | ); |
| 8009 | 8009 | |
| 8010 | 8010 | if ($parent_item_id == $arrLP[$i]['id']) { |
@@ -8091,7 +8091,7 @@ discard block |
||
| 8091 | 8091 | |
| 8092 | 8092 | $form->setDefaults($defaults); |
| 8093 | 8093 | |
| 8094 | - return '<div class="sectioncomment">' . $form->returnForm() . '</div>'; |
|
| 8094 | + return '<div class="sectioncomment">'.$form->returnForm().'</div>'; |
|
| 8095 | 8095 | } |
| 8096 | 8096 | |
| 8097 | 8097 | /** |
@@ -8113,8 +8113,8 @@ discard block |
||
| 8113 | 8113 | } elseif (is_numeric($extra_info)) { |
| 8114 | 8114 | $extra_info = intval($extra_info); |
| 8115 | 8115 | $sql = "SELECT title, description |
| 8116 | - FROM " . $tbl_publication . " |
|
| 8117 | - WHERE c_id = ".$course_id." AND id = " . $extra_info; |
|
| 8116 | + FROM " . $tbl_publication." |
|
| 8117 | + WHERE c_id = ".$course_id." AND id = ".$extra_info; |
|
| 8118 | 8118 | |
| 8119 | 8119 | $result = Database::query($sql); |
| 8120 | 8120 | $row = Database :: fetch_array($result); |
@@ -8130,8 +8130,8 @@ discard block |
||
| 8130 | 8130 | $parent = 0; |
| 8131 | 8131 | } |
| 8132 | 8132 | |
| 8133 | - $sql = "SELECT * FROM " . $tbl_lp_item . " |
|
| 8134 | - WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id; |
|
| 8133 | + $sql = "SELECT * FROM ".$tbl_lp_item." |
|
| 8134 | + WHERE c_id = ".$course_id." AND lp_id = ".$this->lp_id; |
|
| 8135 | 8135 | |
| 8136 | 8136 | $result = Database::query($sql); |
| 8137 | 8137 | $arrLP = array(); |
@@ -8196,7 +8196,7 @@ discard block |
||
| 8196 | 8196 | $parentSelect->addOption( |
| 8197 | 8197 | $arrLP[$i]['title'], |
| 8198 | 8198 | $arrLP[$i]['id'], |
| 8199 | - ['style' => 'padding-left: ' . (($arrLP[$i]['depth'] * 10) + 20) . 'px;'] |
|
| 8199 | + ['style' => 'padding-left: '.(($arrLP[$i]['depth'] * 10) + 20).'px;'] |
|
| 8200 | 8200 | ); |
| 8201 | 8201 | |
| 8202 | 8202 | if ($parent == $arrLP[$i]['id']) { |
@@ -8210,7 +8210,7 @@ discard block |
||
| 8210 | 8210 | $parentSelect->addOption( |
| 8211 | 8211 | $arrLP[$i]['title'], |
| 8212 | 8212 | $arrLP[$i]['id'], |
| 8213 | - ['style' => 'padding-left: ' . (($arrLP[$i]['depth'] * 10) + 20) . 'px;'] |
|
| 8213 | + ['style' => 'padding-left: '.(($arrLP[$i]['depth'] * 10) + 20).'px;'] |
|
| 8214 | 8214 | ); |
| 8215 | 8215 | |
| 8216 | 8216 | if ($parent == $arrLP[$i]['id']) { |
@@ -8234,7 +8234,7 @@ discard block |
||
| 8234 | 8234 | for ($i = 0; $i < count($arrLP); $i++) { |
| 8235 | 8235 | if ($arrLP[$i]['parent_item_id'] == $parent && $arrLP[$i]['id'] != $id) { |
| 8236 | 8236 | $previousSelect->addOption( |
| 8237 | - get_lang('After') . ' "' . $arrLP[$i]['title'] . '"', |
|
| 8237 | + get_lang('After').' "'.$arrLP[$i]['title'].'"', |
|
| 8238 | 8238 | $arrLP[$i]['id'] |
| 8239 | 8239 | ); |
| 8240 | 8240 | |
@@ -8256,7 +8256,7 @@ discard block |
||
| 8256 | 8256 | } |
| 8257 | 8257 | } |
| 8258 | 8258 | } |
| 8259 | - $arrHide = array (); |
|
| 8259 | + $arrHide = array(); |
|
| 8260 | 8260 | for ($i = 0; $i < count($arrLP); $i++) { |
| 8261 | 8261 | if ($arrLP[$i]['id'] != $id && $arrLP[$i]['item_type'] != 'dir') { |
| 8262 | 8262 | if ($extra_info['previous_item_id'] == $arrLP[$i]['id']) |
@@ -8336,8 +8336,8 @@ discard block |
||
| 8336 | 8336 | |
| 8337 | 8337 | $tbl_lp_item = Database :: get_course_table(TABLE_LP_ITEM); |
| 8338 | 8338 | $item_id = intval($item_id); |
| 8339 | - $sql = "SELECT * FROM " . $tbl_lp_item . " as lp |
|
| 8340 | - WHERE lp.c_id = ".$course_id." AND lp.id = " . $item_id; |
|
| 8339 | + $sql = "SELECT * FROM ".$tbl_lp_item." as lp |
|
| 8340 | + WHERE lp.c_id = ".$course_id." AND lp.id = ".$item_id; |
|
| 8341 | 8341 | $result = Database::query($sql); |
| 8342 | 8342 | $row = Database::fetch_assoc($result); |
| 8343 | 8343 | |
@@ -8351,16 +8351,16 @@ discard block |
||
| 8351 | 8351 | $audio_player .= '<script> |
| 8352 | 8352 | var s1 = new SWFObject("'.api_get_path(WEB_LIBRARY_JS_PATH).'mediaplayer/player.swf","ply","250","20","9","#FFFFFF"); |
| 8353 | 8353 | s1.addParam("allowscriptaccess","always"); |
| 8354 | - s1.addParam("flashvars","file=../..'.api_get_path(REL_COURSE_PATH).$_course['path'] . '/document/audio/' . $row['audio'] . '&autostart=true"); |
|
| 8354 | + s1.addParam("flashvars","file=../..'.api_get_path(REL_COURSE_PATH).$_course['path'].'/document/audio/'.$row['audio'].'&autostart=true"); |
|
| 8355 | 8355 | s1.write("container"); |
| 8356 | 8356 | </script>'; |
| 8357 | 8357 | } |
| 8358 | 8358 | |
| 8359 | - $url = api_get_self().'?cidReq='.api_get_cidreq().'&view=build&id='.$item_id .'&lp_id='.$this->lp_id; |
|
| 8359 | + $url = api_get_self().'?cidReq='.api_get_cidreq().'&view=build&id='.$item_id.'&lp_id='.$this->lp_id; |
|
| 8360 | 8360 | |
| 8361 | 8361 | $return .= Display::url( |
| 8362 | 8362 | Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL), |
| 8363 | - $url.'&action=edit_item&path_item=' . $row['path'] |
|
| 8363 | + $url.'&action=edit_item&path_item='.$row['path'] |
|
| 8364 | 8364 | ); |
| 8365 | 8365 | |
| 8366 | 8366 | $return .= Display::url( |
@@ -8380,7 +8380,7 @@ discard block |
||
| 8380 | 8380 | $url.'&action=delete_item' |
| 8381 | 8381 | ); |
| 8382 | 8382 | |
| 8383 | - if ($item_type == TOOL_HOTPOTATOES ) { |
|
| 8383 | + if ($item_type == TOOL_HOTPOTATOES) { |
|
| 8384 | 8384 | $document_data = DocumentManager::get_document_data_by_id($row['path'], $course_code); |
| 8385 | 8385 | $return .= get_lang('File').': '.$document_data['absolute_path_from_document']; |
| 8386 | 8386 | } |
@@ -8406,13 +8406,13 @@ discard block |
||
| 8406 | 8406 | public function get_js_dropdown_array() |
| 8407 | 8407 | { |
| 8408 | 8408 | $course_id = api_get_course_int_id(); |
| 8409 | - $return = 'var child_name = new Array();' . "\n"; |
|
| 8410 | - $return .= 'var child_value = new Array();' . "\n\n"; |
|
| 8411 | - $return .= 'child_name[0] = new Array();' . "\n"; |
|
| 8412 | - $return .= 'child_value[0] = new Array();' . "\n\n"; |
|
| 8409 | + $return = 'var child_name = new Array();'."\n"; |
|
| 8410 | + $return .= 'var child_value = new Array();'."\n\n"; |
|
| 8411 | + $return .= 'child_name[0] = new Array();'."\n"; |
|
| 8412 | + $return .= 'child_value[0] = new Array();'."\n\n"; |
|
| 8413 | 8413 | $tbl_lp_item = Database :: get_course_table(TABLE_LP_ITEM); |
| 8414 | - $sql_zero = "SELECT * FROM " . $tbl_lp_item . " |
|
| 8415 | - WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id . " AND parent_item_id = 0 |
|
| 8414 | + $sql_zero = "SELECT * FROM ".$tbl_lp_item." |
|
| 8415 | + WHERE c_id = ".$course_id." AND lp_id = ".$this->lp_id." AND parent_item_id = 0 |
|
| 8416 | 8416 | ORDER BY display_order ASC"; |
| 8417 | 8417 | $res_zero = Database::query($sql_zero); |
| 8418 | 8418 | $i = 0; |
@@ -8423,29 +8423,29 @@ discard block |
||
| 8423 | 8423 | $row_zero['title'] = Exercise::get_formated_title_variable($row_zero['title']); |
| 8424 | 8424 | } |
| 8425 | 8425 | $js_var = json_encode(get_lang('After').' '.$row_zero['title']); |
| 8426 | - $return .= 'child_name[0][' . $i . '] = '.$js_var.' ;' . "\n"; |
|
| 8427 | - $return .= 'child_value[0][' . $i++ . '] = "' . $row_zero['id'] . '";' . "\n"; |
|
| 8426 | + $return .= 'child_name[0]['.$i.'] = '.$js_var.' ;'."\n"; |
|
| 8427 | + $return .= 'child_value[0]['.$i++.'] = "'.$row_zero['id'].'";'."\n"; |
|
| 8428 | 8428 | } |
| 8429 | 8429 | } |
| 8430 | 8430 | $return .= "\n"; |
| 8431 | - $sql = "SELECT * FROM " . $tbl_lp_item . " |
|
| 8432 | - WHERE c_id = ".$course_id." AND lp_id = " . $this->lp_id; |
|
| 8431 | + $sql = "SELECT * FROM ".$tbl_lp_item." |
|
| 8432 | + WHERE c_id = ".$course_id." AND lp_id = ".$this->lp_id; |
|
| 8433 | 8433 | $res = Database::query($sql); |
| 8434 | 8434 | while ($row = Database :: fetch_array($res)) { |
| 8435 | - $sql_parent = "SELECT * FROM " . $tbl_lp_item . " |
|
| 8435 | + $sql_parent = "SELECT * FROM ".$tbl_lp_item." |
|
| 8436 | 8436 | WHERE |
| 8437 | 8437 | c_id = ".$course_id." AND |
| 8438 | - parent_item_id = " . $row['id'] . " |
|
| 8438 | + parent_item_id = " . $row['id']." |
|
| 8439 | 8439 | ORDER BY display_order ASC"; |
| 8440 | 8440 | $res_parent = Database::query($sql_parent); |
| 8441 | 8441 | $i = 0; |
| 8442 | - $return .= 'child_name[' . $row['id'] . '] = new Array();' . "\n"; |
|
| 8443 | - $return .= 'child_value[' . $row['id'] . '] = new Array();' . "\n\n"; |
|
| 8442 | + $return .= 'child_name['.$row['id'].'] = new Array();'."\n"; |
|
| 8443 | + $return .= 'child_value['.$row['id'].'] = new Array();'."\n\n"; |
|
| 8444 | 8444 | |
| 8445 | 8445 | while ($row_parent = Database :: fetch_array($res_parent)) { |
| 8446 | 8446 | $js_var = json_encode(get_lang('After').' '.$row_parent['title']); |
| 8447 | - $return .= 'child_name[' . $row['id'] . '][' . $i . '] = '.$js_var.' ;' . "\n"; |
|
| 8448 | - $return .= 'child_value[' . $row['id'] . '][' . $i++ . '] = "' . $row_parent['id'] . '";' . "\n"; |
|
| 8447 | + $return .= 'child_name['.$row['id'].']['.$i.'] = '.$js_var.' ;'."\n"; |
|
| 8448 | + $return .= 'child_value['.$row['id'].']['.$i++.'] = "'.$row_parent['id'].'";'."\n"; |
|
| 8449 | 8449 | } |
| 8450 | 8450 | $return .= "\n"; |
| 8451 | 8451 | } |
@@ -8466,8 +8466,8 @@ discard block |
||
| 8466 | 8466 | if (is_numeric($item_id)) { |
| 8467 | 8467 | $tbl_lp_item = Database :: get_course_table(TABLE_LP_ITEM); |
| 8468 | 8468 | |
| 8469 | - $sql = "SELECT * FROM " . $tbl_lp_item . " |
|
| 8470 | - WHERE c_id = ".$course_id." AND id = " . $item_id; |
|
| 8469 | + $sql = "SELECT * FROM ".$tbl_lp_item." |
|
| 8470 | + WHERE c_id = ".$course_id." AND id = ".$item_id; |
|
| 8471 | 8471 | |
| 8472 | 8472 | $res = Database::query($sql); |
| 8473 | 8473 | $row = Database :: fetch_array($res); |
@@ -8521,7 +8521,7 @@ discard block |
||
| 8521 | 8521 | */ |
| 8522 | 8522 | public function display_item_small_form($item_type, $title = '', $data = array()) |
| 8523 | 8523 | { |
| 8524 | - $url = api_get_self() . '?' .api_get_cidreq().'&action=edit_item&lp_id='.$this->lp_id; |
|
| 8524 | + $url = api_get_self().'?'.api_get_cidreq().'&action=edit_item&lp_id='.$this->lp_id; |
|
| 8525 | 8525 | $form = new FormValidator('small_form', 'post', $url); |
| 8526 | 8526 | $form->addElement('header', $title); |
| 8527 | 8527 | $form->addElement('text', 'title', get_lang('Title')); |
@@ -8547,7 +8547,7 @@ discard block |
||
| 8547 | 8547 | $item_id = intval($item_id); |
| 8548 | 8548 | /* Current prerequisite */ |
| 8549 | 8549 | $sql = "SELECT * FROM $tbl_lp_item |
| 8550 | - WHERE c_id = $course_id AND id = " . $item_id; |
|
| 8550 | + WHERE c_id = $course_id AND id = ".$item_id; |
|
| 8551 | 8551 | $result = Database::query($sql); |
| 8552 | 8552 | $row = Database::fetch_array($result); |
| 8553 | 8553 | $prerequisiteId = $row['prerequisite']; |
@@ -8557,20 +8557,20 @@ discard block |
||
| 8557 | 8557 | $return .= '<form method="POST">'; |
| 8558 | 8558 | $return .= '<table class="data_table">'; |
| 8559 | 8559 | $return .= '<tr>'; |
| 8560 | - $return .= '<th height="24">' . get_lang('LearnpathPrerequisites') . '</th>'; |
|
| 8561 | - $return .= '<th width="70" >' . get_lang('Minimum') . '</th>'; |
|
| 8562 | - $return .= '<th width="70">' . get_lang('Maximum') . '</th>'; |
|
| 8560 | + $return .= '<th height="24">'.get_lang('LearnpathPrerequisites').'</th>'; |
|
| 8561 | + $return .= '<th width="70" >'.get_lang('Minimum').'</th>'; |
|
| 8562 | + $return .= '<th width="70">'.get_lang('Maximum').'</th>'; |
|
| 8563 | 8563 | $return .= '</tr>'; |
| 8564 | 8564 | |
| 8565 | 8565 | // Adding the none option to the prerequisites see http://www.chamilo.org/es/node/146 |
| 8566 | 8566 | $return .= '<tr >'; |
| 8567 | 8567 | $return .= '<td colspan="3" class="radio">'; |
| 8568 | 8568 | $return .= '<input checked="checked" id="idNone" name="prerequisites" style="margin-left:0px; margin-right:10px;" type="radio" />'; |
| 8569 | - $return .= '<label for="idNone">' . get_lang('None') . '</label>'; |
|
| 8569 | + $return .= '<label for="idNone">'.get_lang('None').'</label>'; |
|
| 8570 | 8570 | $return .= '</tr>'; |
| 8571 | 8571 | |
| 8572 | 8572 | $sql = "SELECT * FROM $tbl_lp_item |
| 8573 | - WHERE c_id = $course_id AND lp_id = " . $this->lp_id; |
|
| 8573 | + WHERE c_id = $course_id AND lp_id = ".$this->lp_id; |
|
| 8574 | 8574 | $result = Database::query($sql); |
| 8575 | 8575 | $arrLP = array(); |
| 8576 | 8576 | |
@@ -8613,25 +8613,25 @@ discard block |
||
| 8613 | 8613 | } |
| 8614 | 8614 | |
| 8615 | 8615 | $selectedMaxScoreValue = isset($selectedMaxScore[$item['id']]) ? $selectedMaxScore[$item['id']] : $item['max_score']; |
| 8616 | - $selectedMinScoreValue = isset($selectedMinScore[$item['id']]) ? $selectedMinScore[$item['id']]: 0; |
|
| 8616 | + $selectedMinScoreValue = isset($selectedMinScore[$item['id']]) ? $selectedMinScore[$item['id']] : 0; |
|
| 8617 | 8617 | |
| 8618 | 8618 | $return .= '<tr>'; |
| 8619 | - $return .= '<td class="radio"' . (($item['item_type'] != TOOL_QUIZ && $item['item_type'] != TOOL_HOTPOTATOES) ? ' colspan="3"' : '') . '>'; |
|
| 8620 | - $return .= '<label for="id' . $item['id'] . '">'; |
|
| 8621 | - $return .= '<input' . (in_array($prerequisiteId, array($item['id'], $item['ref'])) ? ' checked="checked" ' : '') . ($item['item_type'] == 'dir' ? ' disabled="disabled" ' : ' ') . 'id="id' . $item['id'] . '" name="prerequisites" style="margin-left:' . $item['depth'] * 10 . 'px; margin-right:10px;" type="radio" value="' . $item['id'] . '" />'; |
|
| 8619 | + $return .= '<td class="radio"'.(($item['item_type'] != TOOL_QUIZ && $item['item_type'] != TOOL_HOTPOTATOES) ? ' colspan="3"' : '').'>'; |
|
| 8620 | + $return .= '<label for="id'.$item['id'].'">'; |
|
| 8621 | + $return .= '<input'.(in_array($prerequisiteId, array($item['id'], $item['ref'])) ? ' checked="checked" ' : '').($item['item_type'] == 'dir' ? ' disabled="disabled" ' : ' ').'id="id'.$item['id'].'" name="prerequisites" style="margin-left:'.$item['depth'] * 10.'px; margin-right:10px;" type="radio" value="'.$item['id'].'" />'; |
|
| 8622 | 8622 | $icon_name = str_replace(' ', '', $item['item_type']); |
| 8623 | 8623 | |
| 8624 | - if (file_exists('../img/lp_' . $icon_name . '.png')) { |
|
| 8625 | - $return .= Display::return_icon('lp_' . $icon_name . '.png'); |
|
| 8624 | + if (file_exists('../img/lp_'.$icon_name.'.png')) { |
|
| 8625 | + $return .= Display::return_icon('lp_'.$icon_name.'.png'); |
|
| 8626 | 8626 | } else { |
| 8627 | - if (file_exists('../img/lp_' . $icon_name . '.gif')) { |
|
| 8628 | - $return .= Display::return_icon('lp_' . $icon_name . '.gif'); |
|
| 8627 | + if (file_exists('../img/lp_'.$icon_name.'.gif')) { |
|
| 8628 | + $return .= Display::return_icon('lp_'.$icon_name.'.gif'); |
|
| 8629 | 8629 | } else { |
| 8630 | - $return .= Display::return_icon('folder_document.png','',array('style'=>'margin-right:5px;')); |
|
| 8630 | + $return .= Display::return_icon('folder_document.png', '', array('style'=>'margin-right:5px;')); |
|
| 8631 | 8631 | } |
| 8632 | 8632 | } |
| 8633 | 8633 | |
| 8634 | - $return .= $item['title'] . '</label>'; |
|
| 8634 | + $return .= $item['title'].'</label>'; |
|
| 8635 | 8635 | $return .= '</td>'; |
| 8636 | 8636 | |
| 8637 | 8637 | if ($item['item_type'] == TOOL_QUIZ) { |
@@ -8645,19 +8645,19 @@ discard block |
||
| 8645 | 8645 | $item['max_score'] = $tmp_obj_lp_item->max_score; |
| 8646 | 8646 | |
| 8647 | 8647 | $return .= '<td class="exercise">'; |
| 8648 | - $return .= '<input size="4" maxlength="3" name="min_' . $item['id'] . '" type="number" min="0" step="any" max="'.$item['max_score'].'" value="' . $selectedMinScoreValue. '" />'; |
|
| 8648 | + $return .= '<input size="4" maxlength="3" name="min_'.$item['id'].'" type="number" min="0" step="any" max="'.$item['max_score'].'" value="'.$selectedMinScoreValue.'" />'; |
|
| 8649 | 8649 | $return .= '</td>'; |
| 8650 | 8650 | $return .= '<td class="exercise">'; |
| 8651 | - $return .= '<input size="4" maxlength="3" name="max_' . $item['id'] . '" type="number" min="0" step="any" max="'.$item['max_score'].'" value="' . $selectedMaxScoreValue . '" />'; |
|
| 8651 | + $return .= '<input size="4" maxlength="3" name="max_'.$item['id'].'" type="number" min="0" step="any" max="'.$item['max_score'].'" value="'.$selectedMaxScoreValue.'" />'; |
|
| 8652 | 8652 | $return .= '</td>'; |
| 8653 | 8653 | } |
| 8654 | 8654 | |
| 8655 | 8655 | if ($item['item_type'] == TOOL_HOTPOTATOES) { |
| 8656 | 8656 | $return .= '<td class="exercise">'; |
| 8657 | - $return .= '<center><input size="4" maxlength="3" name="min_' . $item['id'] . '" type="number" min="0" step="any" max="'.$item['max_score'].'" value="' . $selectedMinScoreValue . '" /></center>'; |
|
| 8657 | + $return .= '<center><input size="4" maxlength="3" name="min_'.$item['id'].'" type="number" min="0" step="any" max="'.$item['max_score'].'" value="'.$selectedMinScoreValue.'" /></center>'; |
|
| 8658 | 8658 | $return .= '</td>'; |
| 8659 | 8659 | $return .= '<td class="exercise"">'; |
| 8660 | - $return .= '<center><input size="4" maxlength="3" name="max_' . $item['id'] . '" type="number" min="0" step="any" max="'.$item['max_score'].'" value="'.$selectedMaxScoreValue . '" /></center>'; |
|
| 8660 | + $return .= '<center><input size="4" maxlength="3" name="max_'.$item['id'].'" type="number" min="0" step="any" max="'.$item['max_score'].'" value="'.$selectedMaxScoreValue.'" /></center>'; |
|
| 8661 | 8661 | $return .= '</td>'; |
| 8662 | 8662 | } |
| 8663 | 8663 | $return .= '</tr>'; |
@@ -8666,7 +8666,7 @@ discard block |
||
| 8666 | 8666 | $return .= '</tr>'; |
| 8667 | 8667 | $return .= '</table>'; |
| 8668 | 8668 | $return .= '<div style="padding-top:3px;">'; |
| 8669 | - $return .= '<button class="btn btn-primary" name="submit_button" type="submit">' . get_lang('ModifyPrerequisites') . '</button>'; |
|
| 8669 | + $return .= '<button class="btn btn-primary" name="submit_button" type="submit">'.get_lang('ModifyPrerequisites').'</button>'; |
|
| 8670 | 8670 | $return .= '</form>'; |
| 8671 | 8671 | |
| 8672 | 8672 | return $return; |
@@ -8702,7 +8702,7 @@ discard block |
||
| 8702 | 8702 | if ($row['id'] == $lp_id) { |
| 8703 | 8703 | continue; |
| 8704 | 8704 | } |
| 8705 | - $return .= '<option value="'.$row['id'].'" '.(($row['id']==$prerequisiteId)?' selected ' : '').'>'.$row['name'].'</option>'; |
|
| 8705 | + $return .= '<option value="'.$row['id'].'" '.(($row['id'] == $prerequisiteId) ? ' selected ' : '').'>'.$row['name'].'</option>'; |
|
| 8706 | 8706 | } |
| 8707 | 8707 | } |
| 8708 | 8708 | $return .= '</select>'; |
@@ -8810,8 +8810,8 @@ discard block |
||
| 8810 | 8810 | WHERE c_id = $course_id AND $activeCondition $condition_session |
| 8811 | 8811 | ORDER BY title ASC"; |
| 8812 | 8812 | |
| 8813 | - $sql_hot = "SELECT * FROM $tbl_doc |
|
| 8814 | - WHERE c_id = $course_id AND path LIKE '" . $uploadPath . "/%/%htm%' $condition_session |
|
| 8813 | + $sql_hot = "SELECT * FROM $tbl_doc |
|
| 8814 | + WHERE c_id = $course_id AND path LIKE '".$uploadPath."/%/%htm%' $condition_session |
|
| 8815 | 8815 | ORDER BY id ASC"; |
| 8816 | 8816 | |
| 8817 | 8817 | $res_quiz = Database::query($sql_quiz); |
@@ -8821,8 +8821,8 @@ discard block |
||
| 8821 | 8821 | |
| 8822 | 8822 | $return .= '<li class="lp_resource_element">'; |
| 8823 | 8823 | $return .= Display::return_icon('new_exercice.png'); |
| 8824 | - $return .= '<a href="' . api_get_path(WEB_CODE_PATH) . 'exercise/exercise_admin.php?'.api_get_cidreq().'&lp_id=' . $this->lp_id . '">' . |
|
| 8825 | - get_lang('NewExercise') . '</a>'; |
|
| 8824 | + $return .= '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/exercise_admin.php?'.api_get_cidreq().'&lp_id='.$this->lp_id.'">'. |
|
| 8825 | + get_lang('NewExercise').'</a>'; |
|
| 8826 | 8826 | $return .= '</li>'; |
| 8827 | 8827 | |
| 8828 | 8828 | // Display hotpotatoes |
@@ -8832,8 +8832,8 @@ discard block |
||
| 8832 | 8832 | $return .= Display::return_icon('move_everywhere.png', get_lang('Move'), array(), ICON_SIZE_TINY); |
| 8833 | 8833 | $return .= '</a> '; |
| 8834 | 8834 | $return .= Display::return_icon('hotpotatoes_s.png'); |
| 8835 | - $return .= '<a href="' . api_get_self() . '?' . api_get_cidreq().'&action=add_item&type=' . TOOL_HOTPOTATOES . '&file=' . $row_hot['id'] . '&lp_id=' . $this->lp_id . '">'. |
|
| 8836 | - ((!empty ($row_hot['comment'])) ? $row_hot['comment'] : Security :: remove_XSS($row_hot['title'])) . '</a>'; |
|
| 8835 | + $return .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=add_item&type='.TOOL_HOTPOTATOES.'&file='.$row_hot['id'].'&lp_id='.$this->lp_id.'">'. |
|
| 8836 | + ((!empty ($row_hot['comment'])) ? $row_hot['comment'] : Security :: remove_XSS($row_hot['title'])).'</a>'; |
|
| 8837 | 8837 | $return .= '</li>'; |
| 8838 | 8838 | } |
| 8839 | 8839 | |
@@ -8843,7 +8843,7 @@ discard block |
||
| 8843 | 8843 | $return .= Display::return_icon('move_everywhere.png', get_lang('Move'), array(), ICON_SIZE_TINY); |
| 8844 | 8844 | $return .= '</a> '; |
| 8845 | 8845 | $return .= Display::return_icon('quizz_small.gif', '', array(), ICON_SIZE_TINY); |
| 8846 | - $return .= '<a href="' . api_get_self() . '?'.api_get_cidreq().'&action=add_item&type=' . TOOL_QUIZ . '&file=' . $row_quiz['id'] . '&lp_id=' . $this->lp_id . '">' . |
|
| 8846 | + $return .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=add_item&type='.TOOL_QUIZ.'&file='.$row_quiz['id'].'&lp_id='.$this->lp_id.'">'. |
|
| 8847 | 8847 | Security :: remove_XSS(cut($row_quiz['title'], 80)). |
| 8848 | 8848 | '</a>'; |
| 8849 | 8849 | |
@@ -8924,7 +8924,7 @@ discard block |
||
| 8924 | 8924 | ['target' => '_blank'] |
| 8925 | 8925 | ); |
| 8926 | 8926 | |
| 8927 | - if (api_get_item_visibility($course, TOOL_LINK, $key, $session_id) != 2) { |
|
| 8927 | + if (api_get_item_visibility($course, TOOL_LINK, $key, $session_id) != 2) { |
|
| 8928 | 8928 | $linkNodes .= |
| 8929 | 8929 | '<li class="lp_resource_element" data_id="'.$key.'" data_type="'.TOOL_LINK.'" title="'.$title.'" > |
| 8930 | 8930 | <a class="moved" href="#">'. |
@@ -8962,8 +8962,8 @@ discard block |
||
| 8962 | 8962 | $return = '<ul class="lp_resource">'; |
| 8963 | 8963 | $return .= '<li class="lp_resource_element">'; |
| 8964 | 8964 | $return .= Display::return_icon('works_new.gif'); |
| 8965 | - $return .= ' <a href="' . api_get_self() . '?' . api_get_cidreq() . '&action=add_item&type=' . TOOL_STUDENTPUBLICATION . '&lp_id=' . $this->lp_id . '">' . |
|
| 8966 | - get_lang('AddAssignmentPage') . '</a>'; |
|
| 8965 | + $return .= ' <a href="'.api_get_self().'?'.api_get_cidreq().'&action=add_item&type='.TOOL_STUDENTPUBLICATION.'&lp_id='.$this->lp_id.'">'. |
|
| 8966 | + get_lang('AddAssignmentPage').'</a>'; |
|
| 8967 | 8967 | $return .= '</li>'; |
| 8968 | 8968 | $sessionId = api_get_session_id(); |
| 8969 | 8969 | |
@@ -8985,7 +8985,7 @@ discard block |
||
| 8985 | 8985 | $return .= '</a> '; |
| 8986 | 8986 | |
| 8987 | 8987 | $return .= Display::return_icon('works.gif'); |
| 8988 | - $return .= ' <a class="moved" href="' . api_get_self() . '?'.api_get_cidreq().'&action=add_item&type=' . TOOL_STUDENTPUBLICATION . '&file=' . $work['iid'] . '&lp_id=' . $this->lp_id . '">' . |
|
| 8988 | + $return .= ' <a class="moved" href="'.api_get_self().'?'.api_get_cidreq().'&action=add_item&type='.TOOL_STUDENTPUBLICATION.'&file='.$work['iid'].'&lp_id='.$this->lp_id.'">'. |
|
| 8989 | 8989 | Security :: remove_XSS(cut(strip_tags($work['title']), 80)).' '.$link.' |
| 8990 | 8990 | </a>'; |
| 8991 | 8991 | |
@@ -9045,7 +9045,7 @@ discard block |
||
| 9045 | 9045 | $return .= Display::return_icon('new_forum.png'); |
| 9046 | 9046 | $return .= Display::url( |
| 9047 | 9047 | get_lang('CreateANewForum'), |
| 9048 | - api_get_path(WEB_CODE_PATH) . 'forum/index.php?' . api_get_cidreq() . '&' . http_build_query([ |
|
| 9048 | + api_get_path(WEB_CODE_PATH).'forum/index.php?'.api_get_cidreq().'&'.http_build_query([ |
|
| 9049 | 9049 | 'action' => 'add', |
| 9050 | 9050 | 'content' => 'forum', |
| 9051 | 9051 | 'lp_id' => $this->lp_id |
@@ -9079,15 +9079,15 @@ discard block |
||
| 9079 | 9079 | $return .= Display::return_icon('move_everywhere.png', get_lang('Move'), array(), ICON_SIZE_TINY); |
| 9080 | 9080 | $return .= ' </a>'; |
| 9081 | 9081 | $return .= Display::return_icon('lp_forum.png', '', array(), ICON_SIZE_TINY); |
| 9082 | - $return .= '<a style="cursor:hand" onclick="javascript: toggle_forum(' . $forum['forum_id'] . ')" style="vertical-align:middle"> |
|
| 9083 | - <img src="' . Display::returnIconPath('add.gif').'" id="forum_' . $forum['forum_id'] . '_opener" align="absbottom" /> |
|
| 9082 | + $return .= '<a style="cursor:hand" onclick="javascript: toggle_forum('.$forum['forum_id'].')" style="vertical-align:middle"> |
|
| 9083 | + <img src="' . Display::returnIconPath('add.gif').'" id="forum_'.$forum['forum_id'].'_opener" align="absbottom" /> |
|
| 9084 | 9084 | </a> |
| 9085 | - <a href="' . api_get_self() . '?'.api_get_cidreq().'&action=add_item&type=' . TOOL_FORUM . '&forum_id=' . $forum['forum_id'] . '&lp_id=' . $this->lp_id . '" style="vertical-align:middle">' . |
|
| 9086 | - Security :: remove_XSS($forum['forum_title']) . '</a>'; |
|
| 9085 | + <a href="' . api_get_self().'?'.api_get_cidreq().'&action=add_item&type='.TOOL_FORUM.'&forum_id='.$forum['forum_id'].'&lp_id='.$this->lp_id.'" style="vertical-align:middle">'. |
|
| 9086 | + Security :: remove_XSS($forum['forum_title']).'</a>'; |
|
| 9087 | 9087 | |
| 9088 | 9088 | $return .= '</li>'; |
| 9089 | 9089 | |
| 9090 | - $return .= '<div style="display:none" id="forum_' . $forum['forum_id'] . '_content">'; |
|
| 9090 | + $return .= '<div style="display:none" id="forum_'.$forum['forum_id'].'_content">'; |
|
| 9091 | 9091 | $a_threads = get_threads($forum['forum_id']); |
| 9092 | 9092 | if (is_array($a_threads)) { |
| 9093 | 9093 | foreach ($a_threads as $thread) { |
@@ -9102,8 +9102,8 @@ discard block |
||
| 9102 | 9102 | $return .= Display::return_icon('move_everywhere.png', get_lang('Move'), array(), ICON_SIZE_TINY); |
| 9103 | 9103 | $return .= ' </a>'; |
| 9104 | 9104 | $return .= Display::return_icon('forumthread.png', get_lang('Thread'), array(), ICON_SIZE_TINY); |
| 9105 | - $return .= '<a class="moved" href="'.api_get_self().'?'.api_get_cidreq().'&action=add_item&type=' . TOOL_THREAD . '&thread_id=' . $thread['thread_id'] . '&lp_id=' . $this->lp_id . '">' . |
|
| 9106 | - Security :: remove_XSS($thread['thread_title']) . ' '.$link.'</a>'; |
|
| 9105 | + $return .= '<a class="moved" href="'.api_get_self().'?'.api_get_cidreq().'&action=add_item&type='.TOOL_THREAD.'&thread_id='.$thread['thread_id'].'&lp_id='.$this->lp_id.'">'. |
|
| 9106 | + Security :: remove_XSS($thread['thread_title']).' '.$link.'</a>'; |
|
| 9107 | 9107 | $return .= '</li>'; |
| 9108 | 9108 | } |
| 9109 | 9109 | } |
@@ -9176,7 +9176,7 @@ discard block |
||
| 9176 | 9176 | ) { |
| 9177 | 9177 | // Remove the possible . at the end of the path. |
| 9178 | 9178 | $dest_path_to_lp = substr($this->path, -1) == '.' ? substr($this->path, 0, -1) : $this->path; |
| 9179 | - $dest_path_to_scorm_folder = str_replace('//','/',$temp_zip_dir.'/scorm/'.$dest_path_to_lp); |
|
| 9179 | + $dest_path_to_scorm_folder = str_replace('//', '/', $temp_zip_dir.'/scorm/'.$dest_path_to_lp); |
|
| 9180 | 9180 | mkdir($dest_path_to_scorm_folder, api_get_permissions_for_new_directories(), true); |
| 9181 | 9181 | copyr( |
| 9182 | 9182 | $current_course_path.'/scorm/'.$this->path, |
@@ -9251,7 +9251,7 @@ discard block |
||
| 9251 | 9251 | if ($item->type === 'sco') { |
| 9252 | 9252 | $inc_docs = $item->get_resources_from_source( |
| 9253 | 9253 | null, |
| 9254 | - api_get_path(SYS_COURSE_PATH) . api_get_course_path() . '/' . 'scorm/' . $this->path . '/' . $item->get_path() |
|
| 9254 | + api_get_path(SYS_COURSE_PATH).api_get_course_path().'/'.'scorm/'.$this->path.'/'.$item->get_path() |
|
| 9255 | 9255 | ); |
| 9256 | 9256 | } else { |
| 9257 | 9257 | $inc_docs = $item->get_resources_from_source(); |
@@ -9472,7 +9472,7 @@ discard block |
||
| 9472 | 9472 | $file_path = substr($file_path, strlen($current_dir)); // We get the relative path. |
| 9473 | 9473 | $zip_files[] = $my_sub_dir.'/'.$file_path; |
| 9474 | 9474 | $link_updates[$my_file_path][] = array('orig' => $doc_info[0], 'dest' => $file_path); |
| 9475 | - $my_dep_file->setAttribute('href','document/'.$file_path); |
|
| 9475 | + $my_dep_file->setAttribute('href', 'document/'.$file_path); |
|
| 9476 | 9476 | $my_dep->setAttribute('xml:base', ''); |
| 9477 | 9477 | } |
| 9478 | 9478 | } |
@@ -9602,7 +9602,7 @@ discard block |
||
| 9602 | 9602 | //$my_item->appendChild($my_max_score); |
| 9603 | 9603 | // Give a child element <adlcp:prerequisites> to the <item> element. |
| 9604 | 9604 | $my_prereqs = $xmldoc->createElement('adlcp:prerequisites', $item->get_prereq_string()); |
| 9605 | - $my_prereqs->setAttribute('type','aicc_script'); |
|
| 9605 | + $my_prereqs->setAttribute('type', 'aicc_script'); |
|
| 9606 | 9606 | $my_item->appendChild($my_prereqs); |
| 9607 | 9607 | // Give a child element <adlcp:masteryscore> to the <item> element. |
| 9608 | 9608 | $my_masteryscore = $xmldoc->createElement('adlcp:masteryscore', $item->get_mastery_score()); |
@@ -9667,7 +9667,7 @@ discard block |
||
| 9667 | 9667 | $my_resource->appendChild($my_file); |
| 9668 | 9668 | |
| 9669 | 9669 | // Get included docs. |
| 9670 | - $inc_docs = $item->get_resources_from_source(null,$tmp_file_path); |
|
| 9670 | + $inc_docs = $item->get_resources_from_source(null, $tmp_file_path); |
|
| 9671 | 9671 | // Dependency to other files - not yet supported. |
| 9672 | 9672 | $i = 1; |
| 9673 | 9673 | foreach ($inc_docs as $doc_info) { |
@@ -9726,7 +9726,7 @@ discard block |
||
| 9726 | 9726 | $my_dep_file->setAttribute('href', $file_path); |
| 9727 | 9727 | $my_dep->setAttribute('xml:base', ''); |
| 9728 | 9728 | |
| 9729 | - if (strstr($file_path,$main_path) !== false) { |
|
| 9729 | + if (strstr($file_path, $main_path) !== false) { |
|
| 9730 | 9730 | // The calculated real path is really inside the chamilo root path. |
| 9731 | 9731 | // Reduce file path to what's under the DocumentRoot. |
| 9732 | 9732 | $file_path = substr($file_path, strlen($root_path)); |
@@ -9744,7 +9744,7 @@ discard block |
||
| 9744 | 9744 | $file_path = $_SERVER['DOCUMENT_ROOT'].$doc_info[0]; |
| 9745 | 9745 | $file_path = str_replace('//', '/', $file_path); |
| 9746 | 9746 | if (file_exists($file_path)) { |
| 9747 | - $file_path = substr($file_path,strlen($current_dir)); // We get the relative path. |
|
| 9747 | + $file_path = substr($file_path, strlen($current_dir)); // We get the relative path. |
|
| 9748 | 9748 | $zip_files[] = $my_sub_dir.'/'.$file_path; |
| 9749 | 9749 | $link_updates[$my_file_path][] = array('orig' => $doc_info[0], 'dest' => $file_path); |
| 9750 | 9750 | $my_dep_file->setAttribute('href', 'document/'.$file_path); |
@@ -9995,7 +9995,7 @@ discard block |
||
| 9995 | 9995 | file_put_contents($archive_path.$temp_dir_short.'/document/non_exportable.html', $file_content); |
| 9996 | 9996 | |
| 9997 | 9997 | // Add the extra files that go along with a SCORM package. |
| 9998 | - $main_code_path = api_get_path(SYS_CODE_PATH) . 'lp/packaging/'; |
|
| 9998 | + $main_code_path = api_get_path(SYS_CODE_PATH).'lp/packaging/'; |
|
| 9999 | 9999 | |
| 10000 | 10000 | $fs = new Filesystem(); |
| 10001 | 10001 | $fs->mirror($main_code_path, $archive_path.$temp_dir_short); |
@@ -10050,7 +10050,7 @@ discard block |
||
| 10050 | 10050 | } |
| 10051 | 10051 | $file_path = api_get_path(SYS_COURSE_PATH).$course_data['path'].'/document'.$file_data['path']; |
| 10052 | 10052 | if (file_exists($file_path)) { |
| 10053 | - $files_to_export[] = array('title'=>$item->get_title(),'path'=>$file_path); |
|
| 10053 | + $files_to_export[] = array('title'=>$item->get_title(), 'path'=>$file_path); |
|
| 10054 | 10054 | } |
| 10055 | 10055 | break; |
| 10056 | 10056 | case 'asset': //commes from a scorm package generated by chamilo |
@@ -10088,12 +10088,12 @@ discard block |
||
| 10088 | 10088 | |
| 10089 | 10089 | foreach ($path_bits as $bit) { |
| 10090 | 10090 | if (!empty ($bit)) { |
| 10091 | - $new_path = $path_built . $bit; |
|
| 10091 | + $new_path = $path_built.$bit; |
|
| 10092 | 10092 | if (is_dir($new_path)) { |
| 10093 | - $path_built = $new_path . '/'; |
|
| 10093 | + $path_built = $new_path.'/'; |
|
| 10094 | 10094 | } else { |
| 10095 | 10095 | mkdir($new_path, api_get_permissions_for_new_directories()); |
| 10096 | - $path_built = $new_path . '/'; |
|
| 10096 | + $path_built = $new_path.'/'; |
|
| 10097 | 10097 | } |
| 10098 | 10098 | } |
| 10099 | 10099 | } |
@@ -10134,9 +10134,9 @@ discard block |
||
| 10134 | 10134 | |
| 10135 | 10135 | if ($upload_ok) { |
| 10136 | 10136 | if ($has_attachment) { |
| 10137 | - $courseDir = api_get_course_path() . '/upload/learning_path/images'; |
|
| 10137 | + $courseDir = api_get_course_path().'/upload/learning_path/images'; |
|
| 10138 | 10138 | $sys_course_path = api_get_path(SYS_COURSE_PATH); |
| 10139 | - $updir = $sys_course_path . $courseDir; |
|
| 10139 | + $updir = $sys_course_path.$courseDir; |
|
| 10140 | 10140 | // Try to add an extension to the file if it hasn't one. |
| 10141 | 10141 | $new_file_name = add_ext_on_mime(stripslashes($image_array['name']), $image_array['type']); |
| 10142 | 10142 | |
@@ -10189,7 +10189,7 @@ discard block |
||
| 10189 | 10189 | //Setting my lp_id to autolaunch = 1 |
| 10190 | 10190 | $attributes['autolaunch'] = 1; |
| 10191 | 10191 | $where = array('id = ? AND session_id = ? AND c_id = ?'=> array($lp_id, api_get_session_id(), $course_id)); |
| 10192 | - Database::update($lp_table, $attributes, $where ); |
|
| 10192 | + Database::update($lp_table, $attributes, $where); |
|
| 10193 | 10193 | } |
| 10194 | 10194 | } |
| 10195 | 10195 | |
@@ -10208,13 +10208,13 @@ discard block |
||
| 10208 | 10208 | |
| 10209 | 10209 | // Get the max order of the items |
| 10210 | 10210 | $sql = "SELECT max(display_order) AS display_order FROM $table_lp_item |
| 10211 | - WHERE c_id = $course_id AND lp_id = '" . $this->lp_id . "'"; |
|
| 10211 | + WHERE c_id = $course_id AND lp_id = '".$this->lp_id."'"; |
|
| 10212 | 10212 | $rs_max_order = Database::query($sql); |
| 10213 | 10213 | $row_max_order = Database::fetch_object($rs_max_order); |
| 10214 | 10214 | $max_order = $row_max_order->display_order; |
| 10215 | 10215 | // Get the previous item ID |
| 10216 | 10216 | $sql = "SELECT id as previous FROM $table_lp_item |
| 10217 | - WHERE c_id = $course_id AND lp_id = '" . $this->lp_id . "' AND display_order = '".$max_order."' "; |
|
| 10217 | + WHERE c_id = $course_id AND lp_id = '".$this->lp_id."' AND display_order = '".$max_order."' "; |
|
| 10218 | 10218 | $rs_max = Database::query($sql); |
| 10219 | 10219 | $row_max = Database::fetch_object($rs_max); |
| 10220 | 10220 | |
@@ -10264,9 +10264,9 @@ discard block |
||
| 10264 | 10264 | $documents_total_space = DocumentManager::documents_total_space(); |
| 10265 | 10265 | $course_max_space = DocumentManager::get_course_quota(); |
| 10266 | 10266 | $total_size = filesize($s) + $documents_total_space; |
| 10267 | - if (filesize($s)>$post_max || filesize($s)>$upl_max || $total_size>$course_max_space ){ |
|
| 10267 | + if (filesize($s) > $post_max || filesize($s) > $upl_max || $total_size > $course_max_space) { |
|
| 10268 | 10268 | return true; |
| 10269 | - } else{ |
|
| 10269 | + } else { |
|
| 10270 | 10270 | return false; |
| 10271 | 10271 | } |
| 10272 | 10272 | } |
@@ -10614,7 +10614,7 @@ discard block |
||
| 10614 | 10614 | if ($this->debug > 0) { |
| 10615 | 10615 | error_log('New LP - In learnpath::set_subscribe_users()', 0); |
| 10616 | 10616 | } |
| 10617 | - $this->subscribeUsers = intval($value);; |
|
| 10617 | + $this->subscribeUsers = intval($value); ; |
|
| 10618 | 10618 | $lp_table = Database :: get_course_table(TABLE_LP_MAIN); |
| 10619 | 10619 | $lp_id = $this->get_id(); |
| 10620 | 10620 | $sql = "UPDATE $lp_table SET subscribe_users = ".$this->subscribeUsers." |
@@ -10957,7 +10957,7 @@ discard block |
||
| 10957 | 10957 | */ |
| 10958 | 10958 | public function createForum($forumCategoryId) |
| 10959 | 10959 | { |
| 10960 | - require_once api_get_path(SYS_CODE_PATH) . '/forum/forumfunction.inc.php'; |
|
| 10960 | + require_once api_get_path(SYS_CODE_PATH).'/forum/forumfunction.inc.php'; |
|
| 10961 | 10961 | |
| 10962 | 10962 | $forumId = store_forum( |
| 10963 | 10963 | [ |
@@ -11005,7 +11005,7 @@ discard block |
||
| 11005 | 11005 | */ |
| 11006 | 11006 | private function getFinalItemTemplate() |
| 11007 | 11007 | { |
| 11008 | - return file_get_contents(api_get_path(SYS_CODE_PATH) . 'lp/final_item_template/template.html'); |
|
| 11008 | + return file_get_contents(api_get_path(SYS_CODE_PATH).'lp/final_item_template/template.html'); |
|
| 11009 | 11009 | } |
| 11010 | 11010 | |
| 11011 | 11011 | /** |
@@ -11051,11 +11051,11 @@ discard block |
||
| 11051 | 11051 | 'Height' => '500', |
| 11052 | 11052 | 'FullPage' => true, |
| 11053 | 11053 | 'CreateDocumentDir' => $relative_prefix, |
| 11054 | - 'CreateDocumentWebDir' => api_get_path(WEB_COURSE_PATH) . api_get_course_path() . '/document/', |
|
| 11055 | - 'BaseHref' => api_get_path(WEB_COURSE_PATH) . api_get_course_path() . '/document/' . $relative_path |
|
| 11054 | + 'CreateDocumentWebDir' => api_get_path(WEB_COURSE_PATH).api_get_course_path().'/document/', |
|
| 11055 | + 'BaseHref' => api_get_path(WEB_COURSE_PATH).api_get_course_path().'/document/'.$relative_path |
|
| 11056 | 11056 | ]; |
| 11057 | 11057 | |
| 11058 | - $url = api_get_self() . '?' . api_get_cidreq() . '&' . http_build_query([ |
|
| 11058 | + $url = api_get_self().'?'.api_get_cidreq().'&'.http_build_query([ |
|
| 11059 | 11059 | 'type' => 'document', |
| 11060 | 11060 | 'lp_id' => $this->lp_id |
| 11061 | 11061 | ]); |
@@ -11223,8 +11223,8 @@ discard block |
||
| 11223 | 11223 | $sql = "SELECT * FROM $item_view_table |
| 11224 | 11224 | WHERE |
| 11225 | 11225 | c_id = $course_id AND |
| 11226 | - lp_item_id = " . $row_item['id'] . " AND |
|
| 11227 | - lp_view_id = " . $lpViewId . " |
|
| 11226 | + lp_item_id = ".$row_item['id']." AND |
|
| 11227 | + lp_view_id = " . $lpViewId." |
|
| 11228 | 11228 | ORDER BY view_count DESC"; |
| 11229 | 11229 | $learnpathItemViewResult = Database::query($sql); |
| 11230 | 11230 | $learnpathItemViewData = Database::fetch_array($learnpathItemViewResult, 'ASSOC'); |
@@ -11242,7 +11242,7 @@ discard block |
||
| 11242 | 11242 | |
| 11243 | 11243 | switch ($type) { |
| 11244 | 11244 | case 'dir': |
| 11245 | - $link .= $main_dir_path . 'lp/blank.php'; |
|
| 11245 | + $link .= $main_dir_path.'lp/blank.php'; |
|
| 11246 | 11246 | case TOOL_CALENDAR_EVENT: |
| 11247 | 11247 | $link .= $main_dir_path.'calendar/agenda.php?origin='.$origin.'&agenda_id='.$id; |
| 11248 | 11248 | break; |
@@ -11260,12 +11260,12 @@ discard block |
||
| 11260 | 11260 | if (!empty($id)) { |
| 11261 | 11261 | $TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST); |
| 11262 | 11262 | $sql = "SELECT * FROM $TBL_EXERCICES WHERE c_id = $course_id AND id=$id"; |
| 11263 | - $result= Database::query($sql); |
|
| 11263 | + $result = Database::query($sql); |
|
| 11264 | 11264 | $myrow = Database::fetch_array($result); |
| 11265 | 11265 | if ($row_item['title'] != '') { |
| 11266 | 11266 | $myrow['title'] = $row_item['title']; |
| 11267 | 11267 | } |
| 11268 | - $link .= $main_dir_path . 'exercise/overview.php?cidReq='.$course_code.'&session_id='.$session_id.'&lp_init=1&origin='.$origin.'&learnpath_item_view_id='.$learnpathItemViewId.'&learnpath_id='.$learningPathId.'&learnpath_item_id='.$id_in_path.'&exerciseId='.$id; |
|
| 11268 | + $link .= $main_dir_path.'exercise/overview.php?cidReq='.$course_code.'&session_id='.$session_id.'&lp_init=1&origin='.$origin.'&learnpath_item_view_id='.$learnpathItemViewId.'&learnpath_id='.$learningPathId.'&learnpath_item_id='.$id_in_path.'&exerciseId='.$id; |
|
| 11269 | 11269 | } |
| 11270 | 11270 | break; |
| 11271 | 11271 | case 'hotpotatoes': //lowercase because of strtolower above |
@@ -11273,7 +11273,7 @@ discard block |
||
| 11273 | 11273 | $result = Database::query("SELECT * FROM ".$TBL_DOCUMENT." WHERE c_id = $course_id AND id=$id"); |
| 11274 | 11274 | $myrow = Database::fetch_array($result); |
| 11275 | 11275 | $path = $myrow['path']; |
| 11276 | - $link .= $main_dir_path . 'exercise/showinframes.php?file='.$path.'&origin='.$origin.'&cid='.$course_code.'&uid='.api_get_user_id().'' . |
|
| 11276 | + $link .= $main_dir_path.'exercise/showinframes.php?file='.$path.'&origin='.$origin.'&cid='.$course_code.'&uid='.api_get_user_id().''. |
|
| 11277 | 11277 | '&learnpath_id='.$learningPathId.'&learnpath_item_id='.$id_in_path.'&lp_view_id='.$lpViewId; |
| 11278 | 11278 | break; |
| 11279 | 11279 | case TOOL_FORUM: |
@@ -11285,7 +11285,7 @@ discard block |
||
| 11285 | 11285 | $sql = "SELECT * FROM $tbl_topics WHERE c_id = $course_id AND thread_id=$id"; |
| 11286 | 11286 | $result = Database::query($sql); |
| 11287 | 11287 | $myrow = Database::fetch_array($result); |
| 11288 | - $link .= $main_dir_path.'forum/viewthread.php?origin=learnpath&thread='.$id.'' . |
|
| 11288 | + $link .= $main_dir_path.'forum/viewthread.php?origin=learnpath&thread='.$id.''. |
|
| 11289 | 11289 | '&forum='.$myrow['forum_id'].'&lp=true'; |
| 11290 | 11290 | } |
| 11291 | 11291 | break; |
@@ -11293,8 +11293,8 @@ discard block |
||
| 11293 | 11293 | $tbl_post = Database::get_course_table(TABLE_FORUM_POST); |
| 11294 | 11294 | $result = Database::query("SELECT * FROM $tbl_post WHERE c_id = $course_id AND post_id=$id"); |
| 11295 | 11295 | $myrow = Database::fetch_array($result); |
| 11296 | - $link .= $main_dir_path.'forum/viewthread.php?post='.$id.'' . |
|
| 11297 | - '&thread='.$myrow['thread_id'].'&forum='.$myrow['forum_id'].'' . |
|
| 11296 | + $link .= $main_dir_path.'forum/viewthread.php?post='.$id.''. |
|
| 11297 | + '&thread='.$myrow['thread_id'].'&forum='.$myrow['forum_id'].''. |
|
| 11298 | 11298 | '&lp=true'; |
| 11299 | 11299 | break; |
| 11300 | 11300 | case TOOL_DOCUMENT: |
@@ -11312,9 +11312,9 @@ discard block |
||
| 11312 | 11312 | $showDirectUrl = !in_array($extension, $jplayer_supported_files); |
| 11313 | 11313 | |
| 11314 | 11314 | if ($showDirectUrl) { |
| 11315 | - $link = $main_course_path . 'document' . $document->getPath() . '?' . api_get_cidreq(); |
|
| 11315 | + $link = $main_course_path.'document'.$document->getPath().'?'.api_get_cidreq(); |
|
| 11316 | 11316 | } else { |
| 11317 | - $link = api_get_path(WEB_CODE_PATH) . 'document/showinframes.php?' . http_build_query([ |
|
| 11317 | + $link = api_get_path(WEB_CODE_PATH).'document/showinframes.php?'.http_build_query([ |
|
| 11318 | 11318 | 'cidReq' => $course_code, |
| 11319 | 11319 | 'id' => $id, |
| 11320 | 11320 | 'origin' => 'learnpathitem' |
@@ -11323,11 +11323,11 @@ discard block |
||
| 11323 | 11323 | |
| 11324 | 11324 | $openmethod = 2; |
| 11325 | 11325 | $officedoc = false; |
| 11326 | - Session::write('openmethod',$openmethod); |
|
| 11327 | - Session::write('officedoc',$officedoc); |
|
| 11326 | + Session::write('openmethod', $openmethod); |
|
| 11327 | + Session::write('officedoc', $officedoc); |
|
| 11328 | 11328 | break; |
| 11329 | 11329 | case TOOL_LP_FINAL_ITEM: |
| 11330 | - $link .= api_get_path(WEB_CODE_PATH) . 'lp/lp_final_item.php?'.api_get_cidreq().'&id='.$id.'&lp_id='.$learningPathId; |
|
| 11330 | + $link .= api_get_path(WEB_CODE_PATH).'lp/lp_final_item.php?'.api_get_cidreq().'&id='.$id.'&lp_id='.$learningPathId; |
|
| 11331 | 11331 | break; |
| 11332 | 11332 | case 'assignments': |
| 11333 | 11333 | $link .= $main_dir_path.'work/work.php?origin='.$origin; |