@@ -4,7 +4,7 @@ |
||
| 4 | 4 | use ChamiloSession as Session; |
| 5 | 5 | |
| 6 | 6 | require_once '../inc/global.inc.php'; |
| 7 | -$current_course_tool = TOOL_STUDENTPUBLICATION; |
|
| 7 | +$current_course_tool = TOOL_STUDENTPUBLICATION; |
|
| 8 | 8 | |
| 9 | 9 | api_protect_course_script(true); |
| 10 | 10 | |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | if (empty($document_data)) { |
| 71 | - $document_id = $parent_id = 0; |
|
| 71 | + $document_id = $parent_id = 0; |
|
| 72 | 72 | $path = '/'; |
| 73 | 73 | } else { |
| 74 | 74 | $document_id = $document_data['id']; |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | |
| 202 | 202 | // Link back to the documents overview |
| 203 | 203 | if ($is_certificate_mode) { |
| 204 | - $actions = '<a href="document.php?id='.$document_id.'&selectcat=' . $selectcat.'&'.api_get_cidreq().'">'. |
|
| 204 | + $actions = '<a href="document.php?id='.$document_id.'&selectcat='.$selectcat.'&'.api_get_cidreq().'">'. |
|
| 205 | 205 | Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('CertificateOverview'), '', ICON_SIZE_MEDIUM).'</a>'; |
| 206 | 206 | } else { |
| 207 | 207 | $actions = '<a href="document.php?id='.$document_id.'&'.api_get_cidreq().'">'. |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | // Link to create a folder |
| 212 | -echo $toolbar = Display::toolbarAction('toolbar-upload', array( 0 => $actions), 1); |
|
| 212 | +echo $toolbar = Display::toolbarAction('toolbar-upload', array(0 => $actions), 1); |
|
| 213 | 213 | // Form to select directory |
| 214 | 214 | $folders = DocumentManager::get_all_document_folders($_course, $groupId, $is_allowed_to_edit); |
| 215 | 215 | if (!$is_certificate_mode) { |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | $form->addElement('checkbox', 'index_document', '', get_lang('SearchFeatureDoIndexDocument').'<div style="font-size: 80%" >'.$supported_formats.'</div>'); |
| 259 | 259 | $form->addElement('html', '<br /><div class="sub-form">'); |
| 260 | 260 | $form->addElement('html', '<div class="label">'.get_lang('SearchFeatureDocumentLanguage').'</div>'); |
| 261 | - $form->addElement('html', '<div>' . api_get_languages_combo(null) . '</div>'); |
|
| 261 | + $form->addElement('html', '<div>'.api_get_languages_combo(null).'</div>'); |
|
| 262 | 262 | $form->addElement('html', '</div><div class="sub-form">'); |
| 263 | 263 | $specific_fields = get_specific_field_list(); |
| 264 | 264 | foreach ($specific_fields as $specific_field) { |
@@ -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> |
@@ -851,9 +851,9 @@ discard block |
||
| 851 | 851 | $label = get_lang('PleaseStandBy'); |
| 852 | 852 | } |
| 853 | 853 | $this->with_progress_bar = true; |
| 854 | - $this->updateAttributes("onsubmit=\"javascript: myUpload.start('dynamic_div','" . api_get_path(WEB_IMG_PATH) . "progress_bar.gif','" . $label . "','" . $this->getAttribute('id') . "')\""); |
|
| 855 | - $this->addElement('html', '<script language="javascript" src="' . api_get_path(WEB_LIBRARY_PATH) . 'javascript/upload.js" type="text/javascript"></script>'); |
|
| 856 | - $this->addElement('html', '<script type="text/javascript">var myUpload = new upload(' . (abs(intval($delay)) * 1000) . ');</script>'); |
|
| 854 | + $this->updateAttributes("onsubmit=\"javascript: myUpload.start('dynamic_div','".api_get_path(WEB_IMG_PATH)."progress_bar.gif','".$label."','".$this->getAttribute('id')."')\""); |
|
| 855 | + $this->addElement('html', '<script language="javascript" src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/upload.js" type="text/javascript"></script>'); |
|
| 856 | + $this->addElement('html', '<script type="text/javascript">var myUpload = new upload('.(abs(intval($delay)) * 1000).');</script>'); |
|
| 857 | 857 | } |
| 858 | 858 | |
| 859 | 859 | /** |
@@ -870,22 +870,22 @@ discard block |
||
| 870 | 870 | return; |
| 871 | 871 | } |
| 872 | 872 | |
| 873 | - $xajax_upload = new xajax(api_get_path(WEB_LIBRARY_PATH) . 'upload.xajax.php'); |
|
| 873 | + $xajax_upload = new xajax(api_get_path(WEB_LIBRARY_PATH).'upload.xajax.php'); |
|
| 874 | 874 | |
| 875 | 875 | $xajax_upload->registerFunction('updateProgress'); |
| 876 | 876 | |
| 877 | 877 | |
| 878 | 878 | // IMPORTANT : must be the first element of the form |
| 879 | - $el = $this->insertElementBefore(FormValidator::createElement('html', '<input type="hidden" name="UPLOAD_IDENTIFIER" value="' . $upload_id . '" />'), $element_after); |
|
| 879 | + $el = $this->insertElementBefore(FormValidator::createElement('html', '<input type="hidden" name="UPLOAD_IDENTIFIER" value="'.$upload_id.'" />'), $element_after); |
|
| 880 | 880 | |
| 881 | 881 | $this->addElement('html', '<br />'); |
| 882 | 882 | |
| 883 | 883 | // Add div-element where the progress bar is to be displayed |
| 884 | 884 | $this->addElement('html', ' |
| 885 | 885 | <div id="dynamic_div_container" style="display:none"> |
| 886 | - <div id="dynamic_div_label">' . get_lang('UploadFile') . '</div> |
|
| 887 | - <div id="dynamic_div_frame" style="width:214px; height:12px; border:1px solid grey; background-image:url(' . api_get_path(WEB_IMG_PATH) . 'real_upload_frame.gif);"> |
|
| 888 | - <div id="dynamic_div_filled" style="width:0%;height:100%;background-image:url(' . api_get_path(WEB_IMG_PATH) . 'real_upload_step.gif);background-repeat:repeat-x;background-position:center;"></div> |
|
| 886 | + <div id="dynamic_div_label">' . get_lang('UploadFile').'</div> |
|
| 887 | + <div id="dynamic_div_frame" style="width:214px; height:12px; border:1px solid grey; background-image:url(' . api_get_path(WEB_IMG_PATH).'real_upload_frame.gif);"> |
|
| 888 | + <div id="dynamic_div_filled" style="width:0%;height:100%;background-image:url(' . api_get_path(WEB_IMG_PATH).'real_upload_step.gif);background-repeat:repeat-x;background-position:center;"></div> |
|
| 889 | 889 | </div> |
| 890 | 890 | </div>'); |
| 891 | 891 | |
@@ -893,28 +893,28 @@ discard block |
||
| 893 | 893 | $this->addElement('html', ' |
| 894 | 894 | <div id="dynamic_div_waiter_container" style="display:none"> |
| 895 | 895 | <div id="dynamic_div_waiter_label"> |
| 896 | - ' . get_lang('SlideshowConversion') . ' |
|
| 896 | + ' . get_lang('SlideshowConversion').' |
|
| 897 | 897 | </div> |
| 898 | 898 | <div id="dynamic_div_waiter_frame"> |
| 899 | - <img src="' . api_get_path(WEB_IMG_PATH) . 'real_upload_frame.gif" /> |
|
| 899 | + <img src="' . api_get_path(WEB_IMG_PATH).'real_upload_frame.gif" /> |
|
| 900 | 900 | </div> |
| 901 | 901 | </div> |
| 902 | 902 | '); |
| 903 | 903 | } |
| 904 | 904 | |
| 905 | 905 | // Get the xajax code |
| 906 | - $this->addElement('html', $xajax_upload->getJavascript(api_get_path(WEB_LIBRARY_PATH) . 'xajax')); |
|
| 906 | + $this->addElement('html', $xajax_upload->getJavascript(api_get_path(WEB_LIBRARY_PATH).'xajax')); |
|
| 907 | 907 | |
| 908 | 908 | // Get the upload code |
| 909 | - $this->addElement('html', '<script language="javascript" src="' . api_get_path(WEB_LIBRARY_PATH) . 'javascript/upload.js" type="text/javascript"></script>'); |
|
| 910 | - $this->addElement('html', '<script type="text/javascript">var myUpload = new upload(' . (abs(intval($delay)) * 1000) . ');</script>'); |
|
| 909 | + $this->addElement('html', '<script language="javascript" src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/upload.js" type="text/javascript"></script>'); |
|
| 910 | + $this->addElement('html', '<script type="text/javascript">var myUpload = new upload('.(abs(intval($delay)) * 1000).');</script>'); |
|
| 911 | 911 | |
| 912 | 912 | if (!$wait_after_upload) { |
| 913 | 913 | $wait_after_upload = 0; |
| 914 | 914 | } |
| 915 | 915 | |
| 916 | 916 | // Add the upload event |
| 917 | - $this->updateAttributes("onsubmit=\"javascript: myUpload.startRealUpload('dynamic_div','" . $upload_id . "','" . $this->getAttribute('id') . "'," . $wait_after_upload . ")\""); |
|
| 917 | + $this->updateAttributes("onsubmit=\"javascript: myUpload.startRealUpload('dynamic_div','".$upload_id."','".$this->getAttribute('id')."',".$wait_after_upload.")\""); |
|
| 918 | 918 | } |
| 919 | 919 | |
| 920 | 920 | /** |
@@ -63,10 +63,10 @@ discard block |
||
| 63 | 63 | var l = $(this); |
| 64 | 64 | var id = l.closest("tr").attr("id"); |
| 65 | 65 | var filename = l.closest("tr").find(".attachFilename").html(); |
| 66 | - if (confirm("' . get_lang('AreYouSureToDeleteJS') . '", filename)) { |
|
| 66 | + if (confirm("' . get_lang('AreYouSureToDeleteJS').'", filename)) { |
|
| 67 | 67 | $.ajax({ |
| 68 | 68 | type: "POST", |
| 69 | - url: "'.api_get_path(WEB_AJAX_PATH) . 'forum.ajax.php?'.api_get_cidreq().'&a=delete_file&attachId=" + id +"&thread='.$threadId .'&forum='.$forumId .'", |
|
| 69 | + url: "'.api_get_path(WEB_AJAX_PATH).'forum.ajax.php?'.api_get_cidreq().'&a=delete_file&attachId=" + id +"&thread='.$threadId.'&forum='.$forumId.'", |
|
| 70 | 70 | dataType: "json", |
| 71 | 71 | success: function(data) { |
| 72 | 72 | if (data.error == false) { |
@@ -965,24 +965,24 @@ discard block |
||
| 965 | 965 | $html = ''; |
| 966 | 966 | $id = Security::remove_XSS($id); |
| 967 | 967 | if ($current_visibility_status == '1') { |
| 968 | - $html .= '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&'; |
|
| 968 | + $html .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&'; |
|
| 969 | 969 | if (is_array($additional_url_parameters)) { |
| 970 | 970 | foreach ($additional_url_parameters as $key => $value) { |
| 971 | - $html .= $key . '=' . $value . '&'; |
|
| 971 | + $html .= $key.'='.$value.'&'; |
|
| 972 | 972 | } |
| 973 | 973 | } |
| 974 | - $html.='action=invisible&content='.$content.'&id='.$id.'">'. |
|
| 974 | + $html .= 'action=invisible&content='.$content.'&id='.$id.'">'. |
|
| 975 | 975 | Display::return_icon('visible.png', get_lang('MakeInvisible'), array(), ICON_SIZE_SMALL).'</a>'; |
| 976 | 976 | } |
| 977 | 977 | if ($current_visibility_status == '0') { |
| 978 | - $html .= '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&'; |
|
| 978 | + $html .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&'; |
|
| 979 | 979 | if (is_array($additional_url_parameters)) { |
| 980 | 980 | foreach ($additional_url_parameters as $key => $value) { |
| 981 | - $html .= $key . '=' . $value . '&'; |
|
| 981 | + $html .= $key.'='.$value.'&'; |
|
| 982 | 982 | } |
| 983 | 983 | } |
| 984 | - $html .= 'action=visible&content=' . $content . '&id=' . $id . '">' . |
|
| 985 | - Display::return_icon('invisible.png', get_lang('MakeVisible'), array(), ICON_SIZE_SMALL) . '</a>'; |
|
| 984 | + $html .= 'action=visible&content='.$content.'&id='.$id.'">'. |
|
| 985 | + Display::return_icon('invisible.png', get_lang('MakeVisible'), array(), ICON_SIZE_SMALL).'</a>'; |
|
| 986 | 986 | } |
| 987 | 987 | return $html; |
| 988 | 988 | } |
@@ -1003,21 +1003,21 @@ discard block |
||
| 1003 | 1003 | $html .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&'; |
| 1004 | 1004 | if (is_array($additional_url_parameters)) { |
| 1005 | 1005 | foreach ($additional_url_parameters as $key => $value) { |
| 1006 | - $html .= $key . '=' . $value . '&'; |
|
| 1006 | + $html .= $key.'='.$value.'&'; |
|
| 1007 | 1007 | } |
| 1008 | 1008 | } |
| 1009 | - $html.= 'action=unlock&content='.$content.'&id='.$id.'">'. |
|
| 1009 | + $html .= 'action=unlock&content='.$content.'&id='.$id.'">'. |
|
| 1010 | 1010 | Display::return_icon('lock.png', get_lang('Unlock'), array(), ICON_SIZE_SMALL).'</a>'; |
| 1011 | 1011 | } |
| 1012 | 1012 | if ($current_lock_status == '0') { |
| 1013 | 1013 | $html .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&'; |
| 1014 | 1014 | if (is_array($additional_url_parameters)) { |
| 1015 | 1015 | foreach ($additional_url_parameters as $key => $value) { |
| 1016 | - $html .= $key . '=' . $value . '&'; |
|
| 1016 | + $html .= $key.'='.$value.'&'; |
|
| 1017 | 1017 | } |
| 1018 | 1018 | } |
| 1019 | - $html .= 'action=lock&content=' . $content . '&id=' . $id . '">' . |
|
| 1020 | - Display::return_icon('unlock.png', get_lang('Lock'), array(), ICON_SIZE_SMALL) . '</a>'; |
|
| 1019 | + $html .= 'action=lock&content='.$content.'&id='.$id.'">'. |
|
| 1020 | + Display::return_icon('unlock.png', get_lang('Lock'), array(), ICON_SIZE_SMALL).'</a>'; |
|
| 1021 | 1021 | } |
| 1022 | 1022 | return $html; |
| 1023 | 1023 | } |
@@ -1220,7 +1220,7 @@ discard block |
||
| 1220 | 1220 | forum_categories.c_id = $course_id AND |
| 1221 | 1221 | item_properties.c_id = $course_id AND |
| 1222 | 1222 | forum_categories.cat_id=item_properties.ref AND |
| 1223 | - item_properties.tool='" . TOOL_FORUM_CATEGORY . "' |
|
| 1223 | + item_properties.tool='".TOOL_FORUM_CATEGORY."' |
|
| 1224 | 1224 | ORDER BY forum_categories.cat_order $sort_direction"; |
| 1225 | 1225 | } |
| 1226 | 1226 | if ($content == 'forum') { |
@@ -1228,7 +1228,7 @@ discard block |
||
| 1228 | 1228 | FROM $table |
| 1229 | 1229 | WHERE |
| 1230 | 1230 | c_id = $course_id AND |
| 1231 | - forum_category='" . Database::escape_string($forum_category) . "' |
|
| 1231 | + forum_category='".Database::escape_string($forum_category)."' |
|
| 1232 | 1232 | ORDER BY forum_order $sort_direction"; |
| 1233 | 1233 | } |
| 1234 | 1234 | // Finding the items that need to be switched. |
@@ -1285,7 +1285,7 @@ discard block |
||
| 1285 | 1285 | { |
| 1286 | 1286 | $current_visibility_status = intval($current_visibility_status); |
| 1287 | 1287 | if ($current_visibility_status == 0) { |
| 1288 | - $status='invisible'; |
|
| 1288 | + $status = 'invisible'; |
|
| 1289 | 1289 | return $status; |
| 1290 | 1290 | } |
| 1291 | 1291 | } |
@@ -2185,7 +2185,7 @@ discard block |
||
| 2185 | 2185 | { |
| 2186 | 2186 | $table_forums = Database :: get_course_table(TABLE_FORUM); |
| 2187 | 2187 | $table_item_property = Database :: get_course_table(TABLE_ITEM_PROPERTY); |
| 2188 | - $courseId = empty($courseId) ? api_get_course_int_id(): intval($courseId); |
|
| 2188 | + $courseId = empty($courseId) ? api_get_course_int_id() : intval($courseId); |
|
| 2189 | 2189 | $forum_id = intval($forum_id); |
| 2190 | 2190 | |
| 2191 | 2191 | $sql = "SELECT * |
@@ -2344,7 +2344,7 @@ discard block |
||
| 2344 | 2344 | */ |
| 2345 | 2345 | function store_thread($current_forum, $values, $courseInfo = array(), $showMessage = true) |
| 2346 | 2346 | { |
| 2347 | - $courseInfo = empty($courseInfo) ? api_get_course_info() : $courseInfo ; |
|
| 2347 | + $courseInfo = empty($courseInfo) ? api_get_course_info() : $courseInfo; |
|
| 2348 | 2348 | $_user = api_get_user_info(); |
| 2349 | 2349 | $course_id = $courseInfo['real_id']; |
| 2350 | 2350 | $courseCode = $courseInfo['code']; |
@@ -2588,11 +2588,11 @@ discard block |
||
| 2588 | 2588 | $form = new FormValidator( |
| 2589 | 2589 | 'thread', |
| 2590 | 2590 | 'post', |
| 2591 | - api_get_self() . '?' . http_build_query([ |
|
| 2591 | + api_get_self().'?'.http_build_query([ |
|
| 2592 | 2592 | 'forum' => $myForum, |
| 2593 | 2593 | 'gradebook' => $myGradebook, |
| 2594 | 2594 | 'thread' => $myThread, |
| 2595 | - ]) . '&' . api_get_cidreq() |
|
| 2595 | + ]).'&'.api_get_cidreq() |
|
| 2596 | 2596 | ); |
| 2597 | 2597 | |
| 2598 | 2598 | $form->addElement('header', get_lang('EditThread')); |
@@ -2657,7 +2657,7 @@ discard block |
||
| 2657 | 2657 | $form->addElement('html', '</div>'); |
| 2658 | 2658 | |
| 2659 | 2659 | if (!empty($formValues)) { |
| 2660 | - $defaults['thread_qualify_gradebook'] = ($formValues['threadQualifyMax'] > 0 && empty($_POST)) ? 1 : 0 ; |
|
| 2660 | + $defaults['thread_qualify_gradebook'] = ($formValues['threadQualifyMax'] > 0 && empty($_POST)) ? 1 : 0; |
|
| 2661 | 2661 | $defaults['thread_title'] = prepare4display($formValues['threadTitle']); |
| 2662 | 2662 | $defaults['thread_sticky'] = strval(intval($formValues['threadSticky'])); |
| 2663 | 2663 | $defaults['thread_peer_qualify'] = intval($formValues['threadPeerQualify']); |
@@ -2729,13 +2729,13 @@ discard block |
||
| 2729 | 2729 | $form = new FormValidator( |
| 2730 | 2730 | 'thread', |
| 2731 | 2731 | 'post', |
| 2732 | - api_get_self() . '?' . http_build_query([ |
|
| 2732 | + api_get_self().'?'.http_build_query([ |
|
| 2733 | 2733 | 'forum' => intval($my_forum), |
| 2734 | 2734 | 'gradebook' => $my_gradebook, |
| 2735 | 2735 | 'thread' => intval($myThread), |
| 2736 | 2736 | 'post' => intval($my_post), |
| 2737 | 2737 | 'action' => $action, |
| 2738 | - ]) . '&' . api_get_cidreq() |
|
| 2738 | + ]).'&'.api_get_cidreq() |
|
| 2739 | 2739 | ); |
| 2740 | 2740 | $form->setConstants(array('forum' => '5')); |
| 2741 | 2741 | |
@@ -2998,7 +2998,7 @@ discard block |
||
| 2998 | 2998 | |
| 2999 | 2999 | if ($row[0] == 0) { |
| 3000 | 3000 | $sql = "INSERT INTO $table_threads_qualify (c_id, user_id, thread_id,qualify,qualify_user_id,qualify_time,session_id) |
| 3001 | - VALUES (".$course_id.", '".$user_id."','".$thread_id."',".(float)$thread_qualify.", '".$currentUserId."','".$qualify_time."','".$session_id."')"; |
|
| 3001 | + VALUES (".$course_id.", '".$user_id."','".$thread_id."',".(float) $thread_qualify.", '".$currentUserId."','".$qualify_time."','".$session_id."')"; |
|
| 3002 | 3002 | Database::query($sql); |
| 3003 | 3003 | |
| 3004 | 3004 | $insertId = Database::insert_id(); |
@@ -4601,9 +4601,9 @@ discard block |
||
| 4601 | 4601 | continue; |
| 4602 | 4602 | } |
| 4603 | 4603 | |
| 4604 | - $course_dir = $_course['path'] . '/upload/forum'; |
|
| 4604 | + $course_dir = $_course['path'].'/upload/forum'; |
|
| 4605 | 4605 | $sys_course_path = api_get_path(SYS_COURSE_PATH); |
| 4606 | - $updir = $sys_course_path . $course_dir; |
|
| 4606 | + $updir = $sys_course_path.$course_dir; |
|
| 4607 | 4607 | |
| 4608 | 4608 | // Try to add an extension to the file if it hasn't one. |
| 4609 | 4609 | $new_file_name = add_ext_on_mime( |
@@ -4620,7 +4620,7 @@ discard block |
||
| 4620 | 4620 | } |
| 4621 | 4621 | |
| 4622 | 4622 | $new_file_name = uniqid(''); |
| 4623 | - $new_path = $updir . '/' . $new_file_name; |
|
| 4623 | + $new_path = $updir.'/'.$new_file_name; |
|
| 4624 | 4624 | $result = @move_uploaded_file($attachment['tmp_name'], $new_path); |
| 4625 | 4625 | $safe_file_comment = Database::escape_string($file_comment); |
| 4626 | 4626 | $safe_file_name = Database::escape_string($file_name); |
@@ -4785,16 +4785,16 @@ discard block |
||
| 4785 | 4785 | $forum_table_attachment = Database::get_course_table(TABLE_FORUM_ATTACHMENT); |
| 4786 | 4786 | $course_id = api_get_course_int_id(); |
| 4787 | 4787 | |
| 4788 | - $cond = (!empty($id_attach)) ? " iid = " . (int) $id_attach . "" : " post_id = " . (int) $post_id . ""; |
|
| 4788 | + $cond = (!empty($id_attach)) ? " iid = ".(int) $id_attach."" : " post_id = ".(int) $post_id.""; |
|
| 4789 | 4789 | $sql = "SELECT path FROM $forum_table_attachment WHERE c_id = $course_id AND $cond"; |
| 4790 | 4790 | $res = Database::query($sql); |
| 4791 | 4791 | $row = Database::fetch_array($res); |
| 4792 | 4792 | |
| 4793 | - $course_dir = $_course['path'] . '/upload/forum'; |
|
| 4793 | + $course_dir = $_course['path'].'/upload/forum'; |
|
| 4794 | 4794 | $sys_course_path = api_get_path(SYS_COURSE_PATH); |
| 4795 | - $updir = $sys_course_path . $course_dir; |
|
| 4795 | + $updir = $sys_course_path.$course_dir; |
|
| 4796 | 4796 | $my_path = isset($row['path']) ? $row['path'] : null; |
| 4797 | - $file = $updir . '/' . $my_path; |
|
| 4797 | + $file = $updir.'/'.$my_path; |
|
| 4798 | 4798 | if (Security::check_abs_path($file, $updir)) { |
| 4799 | 4799 | @unlink($file); |
| 4800 | 4800 | } |
@@ -5342,35 +5342,35 @@ discard block |
||
| 5342 | 5342 | $post_list = get_thread_user_post_limit($course_code, $thread['thread_id'], $user_id, 1); |
| 5343 | 5343 | $post_counter = count($post_list); |
| 5344 | 5344 | if (is_array($post_list) && count($post_list) > 0) { |
| 5345 | - $hand_forums.= '<div id="social-thread">'; |
|
| 5346 | - $hand_forums.= Display::return_icon('thread.png', get_lang('Thread'), '', ICON_SIZE_MEDIUM); |
|
| 5347 | - $hand_forums.= ' '.Security::remove_XSS($thread['thread_title'], STUDENT); |
|
| 5348 | - $hand_forums.= '</div>'; |
|
| 5345 | + $hand_forums .= '<div id="social-thread">'; |
|
| 5346 | + $hand_forums .= Display::return_icon('thread.png', get_lang('Thread'), '', ICON_SIZE_MEDIUM); |
|
| 5347 | + $hand_forums .= ' '.Security::remove_XSS($thread['thread_title'], STUDENT); |
|
| 5348 | + $hand_forums .= '</div>'; |
|
| 5349 | 5349 | |
| 5350 | 5350 | foreach ($post_list as $posts) { |
| 5351 | - $hand_forums.= '<div id="social-post">'; |
|
| 5352 | - $hand_forums.= '<strong>'.Security::remove_XSS($posts['post_title'], STUDENT).'</strong>'; |
|
| 5353 | - $hand_forums.= '<br / >'; |
|
| 5354 | - $hand_forums.= Security::remove_XSS($posts['post_text'], STUDENT); |
|
| 5355 | - $hand_forums.= '</div>'; |
|
| 5356 | - $hand_forums.= '<br / >'; |
|
| 5351 | + $hand_forums .= '<div id="social-post">'; |
|
| 5352 | + $hand_forums .= '<strong>'.Security::remove_XSS($posts['post_title'], STUDENT).'</strong>'; |
|
| 5353 | + $hand_forums .= '<br / >'; |
|
| 5354 | + $hand_forums .= Security::remove_XSS($posts['post_text'], STUDENT); |
|
| 5355 | + $hand_forums .= '</div>'; |
|
| 5356 | + $hand_forums .= '<br / >'; |
|
| 5357 | 5357 | } |
| 5358 | 5358 | } |
| 5359 | 5359 | } |
| 5360 | 5360 | $i++; |
| 5361 | 5361 | } |
| 5362 | - $forum_results .='<div id="social-forum">'; |
|
| 5363 | - $forum_results .='<div class="clear"></div><br />'; |
|
| 5364 | - $forum_results .='<div id="social-forum-title">'. |
|
| 5362 | + $forum_results .= '<div id="social-forum">'; |
|
| 5363 | + $forum_results .= '<div class="clear"></div><br />'; |
|
| 5364 | + $forum_results .= '<div id="social-forum-title">'. |
|
| 5365 | 5365 | Display::return_icon('forum.gif', get_lang('Forum')).' '.Security::remove_XSS($forum['forum_title'], STUDENT). |
| 5366 | 5366 | '<div style="float:right;margin-top:-35px"> |
| 5367 | 5367 | <a href="../forum/viewforum.php?cidReq='.$course_code.'&gidReq=&forum='.$forum['forum_id'].' " >'.get_lang('SeeForum').'</a> |
| 5368 | 5368 | </div></div>'; |
| 5369 | - $forum_results .='<br / >'; |
|
| 5369 | + $forum_results .= '<br / >'; |
|
| 5370 | 5370 | if ($post_counter > 0) { |
| 5371 | - $forum_results .=$hand_forums; |
|
| 5371 | + $forum_results .= $hand_forums; |
|
| 5372 | 5372 | } |
| 5373 | - $forum_results .='</div>'; |
|
| 5373 | + $forum_results .= '</div>'; |
|
| 5374 | 5374 | }$j++; |
| 5375 | 5375 | } |
| 5376 | 5376 | } |
@@ -5511,16 +5511,16 @@ discard block |
||
| 5511 | 5511 | $courseId = intval($courseId); |
| 5512 | 5512 | if (empty($courseId)) { |
| 5513 | 5513 | // $courseId can be null, use api method |
| 5514 | - $courseId= api_get_course_int_id(); |
|
| 5514 | + $courseId = api_get_course_int_id(); |
|
| 5515 | 5515 | } |
| 5516 | 5516 | /* |
| 5517 | 5517 | * Check if Attachment ID and Course ID are greater than zero |
| 5518 | 5518 | * and array of field values is not empty |
| 5519 | 5519 | */ |
| 5520 | 5520 | if ($id > 0 && $courseId > 0 && !empty($array) && is_array($array)) { |
| 5521 | - foreach($array as $key => &$item) { |
|
| 5521 | + foreach ($array as $key => &$item) { |
|
| 5522 | 5522 | $item = Database::escape_string($item); |
| 5523 | - $setString .= $key . ' = "' .$item . '", '; |
|
| 5523 | + $setString .= $key.' = "'.$item.'", '; |
|
| 5524 | 5524 | } |
| 5525 | 5525 | // Delete last comma |
| 5526 | 5526 | $setString = substr($setString, 0, strlen($setString) - 2); |
@@ -5566,7 +5566,7 @@ discard block |
||
| 5566 | 5566 | return ''; |
| 5567 | 5567 | } |
| 5568 | 5568 | |
| 5569 | - $url = api_get_path(WEB_AJAX_PATH).'forum.ajax.php?'.api_get_cidreq().'&forum=' . $forumId . '&thread=' . $threadId . '&postId=' . $postId . '&a=upload_file'; |
|
| 5569 | + $url = api_get_path(WEB_AJAX_PATH).'forum.ajax.php?'.api_get_cidreq().'&forum='.$forumId.'&thread='.$threadId.'&postId='.$postId.'&a=upload_file'; |
|
| 5570 | 5570 | |
| 5571 | 5571 | $multipleForm = new FormValidator('post'); |
| 5572 | 5572 | $multipleForm->addMultipleUpload($url); |
@@ -5607,10 +5607,10 @@ discard block |
||
| 5607 | 5607 | foreach ($uploadedFiles as $k => $uploadedFile) { |
| 5608 | 5608 | if (!empty($uploadedFile) && in_array($uploadedFile['id'], $attachIds)) { |
| 5609 | 5609 | // Buil html table including an input with attachmentID |
| 5610 | - $fileDataContent .= '<tr id="' . $uploadedFile['id'] . '" ><td>' . $uploadedFile['name'] . '</td><td>' . $uploadedFile['size'] . '</td><td> ' . $uploadedFile['result'] . |
|
| 5611 | - ' </td><td> <input style="width:90%;" type="text" value="' . $uploadedFile['comment'] . '" name="file_comments[]"> </td><td>' . |
|
| 5612 | - $uploadedFile['delete'] . '</td>' . |
|
| 5613 | - '<input type="hidden" value="' . $uploadedFile['id'] .'" name="file_ids[]">' . '</tr>'; |
|
| 5610 | + $fileDataContent .= '<tr id="'.$uploadedFile['id'].'" ><td>'.$uploadedFile['name'].'</td><td>'.$uploadedFile['size'].'</td><td> '.$uploadedFile['result']. |
|
| 5611 | + ' </td><td> <input style="width:90%;" type="text" value="'.$uploadedFile['comment'].'" name="file_comments[]"> </td><td>'. |
|
| 5612 | + $uploadedFile['delete'].'</td>'. |
|
| 5613 | + '<input type="hidden" value="'.$uploadedFile['id'].'" name="file_ids[]">'.'</tr>'; |
|
| 5614 | 5614 | } else { |
| 5615 | 5615 | /* |
| 5616 | 5616 | * If attachment data is empty, then delete it from $_SESSION |
@@ -5623,7 +5623,7 @@ discard block |
||
| 5623 | 5623 | $style = empty($fileDataContent) ? 'display: none;' : ''; |
| 5624 | 5624 | // Forum attachment Ajax table |
| 5625 | 5625 | $fileData = ' |
| 5626 | - <div class="control-group " style="'. $style . '"> |
|
| 5626 | + <div class="control-group " style="'. $style.'"> |
|
| 5627 | 5627 | <label class="control-label">'.get_lang('AttachmentList').'</label> |
| 5628 | 5628 | <div class="controls"> |
| 5629 | 5629 | <table id="attachmentFileList" class="files data_table span10"> |
@@ -5695,7 +5695,7 @@ discard block |
||
| 5695 | 5695 | // name contains an URL to download attachment file and its filename |
| 5696 | 5696 | $json['name'] = Display::url( |
| 5697 | 5697 | api_htmlentities($row['filename']), |
| 5698 | - api_get_path(WEB_CODE_PATH) . 'forum/download.php?file='.$row['path'].'&'.api_get_cidreq(), |
|
| 5698 | + api_get_path(WEB_CODE_PATH).'forum/download.php?file='.$row['path'].'&'.api_get_cidreq(), |
|
| 5699 | 5699 | array('target'=>'_blank', 'class' => 'attachFilename') |
| 5700 | 5700 | ); |
| 5701 | 5701 | $json['id'] = $row['iid']; |
@@ -5706,9 +5706,9 @@ discard block |
||
| 5706 | 5706 | if (!empty($row) && is_array($row)) { |
| 5707 | 5707 | // Set result as success and bring delete URL |
| 5708 | 5708 | $json['result'] = Display::return_icon('accept.png', get_lang('Uploaded')); |
| 5709 | - $url = api_get_path(WEB_CODE_PATH) . 'forum/viewthread.php?' . api_get_cidreq() . '&action=delete_attach&forum=' . $forumId . '&thread=' . $threadId.'&id_attach=' . $row['iid']; |
|
| 5709 | + $url = api_get_path(WEB_CODE_PATH).'forum/viewthread.php?'.api_get_cidreq().'&action=delete_attach&forum='.$forumId.'&thread='.$threadId.'&id_attach='.$row['iid']; |
|
| 5710 | 5710 | $json['delete'] = Display::url( |
| 5711 | - Display::return_icon('delete.png',get_lang('Delete'), array(), ICON_SIZE_SMALL), |
|
| 5711 | + Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL), |
|
| 5712 | 5712 | $url, |
| 5713 | 5713 | array('class' => 'deleteLink') |
| 5714 | 5714 | ); |
@@ -5797,7 +5797,7 @@ discard block |
||
| 5797 | 5797 | WHERE c_id = $courseId AND post_id = $postId"; |
| 5798 | 5798 | $result = Database::query($sql); |
| 5799 | 5799 | if ($result !== false && Database::num_rows($result) > 0) { |
| 5800 | - while ($row = Database::fetch_array($result,'ASSOC')) { |
|
| 5800 | + while ($row = Database::fetch_array($result, 'ASSOC')) { |
|
| 5801 | 5801 | $array[] = $row['id']; |
| 5802 | 5802 | } |
| 5803 | 5803 | } |