Completed
Push — 1.10.x ( ad23de...73a570 )
by Yannick
448:11 queued 407:15
created
main/chat/chat_chat.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,14 +14,14 @@  discard block
 block discarded – undo
14 14
 
15 15
 $course = $_GET['cidReq'];
16 16
 $session_id = api_get_session_id();
17
-$group_id 	= api_get_group_id();
17
+$group_id = api_get_group_id();
18 18
 $userId = api_get_user_id();
19 19
 $_course = api_get_course_info();
20 20
 $time = api_get_utc_datetime();
21 21
 
22 22
 // if we have the session set up
23 23
 if (!empty($course)) {
24
-    $reset = isset($_GET['reset']) ? (bool)$_GET['reset'] : null;
24
+    $reset = isset($_GET['reset']) ? (bool) $_GET['reset'] : null;
25 25
     $tbl_user = Database::get_main_table(TABLE_MAIN_USER);
26 26
     $query = "SELECT username FROM $tbl_user WHERE user_id='".$userId."'";
27 27
     $result = Database::query($query);
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
     list($pseudo_user) = Database::fetch_row($result);
30 30
 
31 31
     $isAllowed = !(empty($pseudo_user) || !$_cid);
32
-    $isMaster = (bool)api_is_course_admin();
32
+    $isMaster = (bool) api_is_course_admin();
33 33
 
34 34
     $date_now = date('Y-m-d');
35 35
     $basepath_chat = '';
Please login to merge, or discard this patch.
main/chat/chat_hidden.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 list($pseudo_user) = Database::fetch_row($result);
25 25
 
26 26
 $isAllowed = !(empty($pseudo_user) || !$_cid);
27
-$isMaster = (bool)api_is_course_admin();
27
+$isMaster = (bool) api_is_course_admin();
28 28
 
29 29
 $date_now = date('Y-m-d');
30 30
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 	$extra_condition = $session_condition;
41 41
 }
42 42
 
43
-$extra_condition.= " AND c_id = $course_id";
43
+$extra_condition .= " AND c_id = $course_id";
44 44
 
45 45
 // get chat path
46 46
 $chat_path = '';
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 }
95 95
 
96 96
 $query = "SELECT COUNT(user_id) FROM $tbl_chat_connected
97
-          WHERE last_connection>'".date('Y-m-d H:i:s',time()-60*5)."' $extra_condition";
97
+          WHERE last_connection>'".date('Y-m-d H:i:s', time() - 60 * 5)."' $extra_condition";
98 98
 $result = Database::query($query);
99 99
 
100 100
 $connected_old = isset($_POST['connected_old']) ? intval($_POST['connected_old']) : null;
Please login to merge, or discard this patch.
main/chat/chat_functions.lib.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -28,12 +28,12 @@  discard block
 block discarded – undo
28 28
 	}
29 29
 
30 30
  	$sql = 'SELECT COUNT(*) AS count
31
- 	        FROM '.$tbl_chat_connected .' c
31
+ 	        FROM '.$tbl_chat_connected.' c
32 32
  	        WHERE
33 33
  	            c_id = '.$course_id.' AND
34 34
  	            user_id='.$user_id.$extra_condition;
35 35
  	$result = Database::query($sql);
36
- 	$count  = Database::fetch_array($result,'ASSOC');
36
+ 	$count  = Database::fetch_array($result, 'ASSOC');
37 37
 
38 38
  	return $count['count'] == 1;
39 39
 }
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
     $cdate_h = date('H', $now);
72 72
     $cdate_m = date('i', $now);
73 73
     $cdate_s = date('s', $now);
74
-	$cd_count_time_seconds = $cdate_h*3600 + $cdate_m*60 + $cdate_s;
74
+	$cd_count_time_seconds = $cdate_h * 3600 + $cdate_m * 60 + $cdate_s;
75 75
 
76 76
     if (is_array($list_info_user_in_chat) && count($list_info_user_in_chat) > 0) {
77 77
         foreach ($list_info_user_in_chat as $list_info_user) {
@@ -106,14 +106,14 @@  discard block
 block discarded – undo
106 106
     $course_id = api_get_course_int_id();
107 107
 
108 108
  	$session_id = api_get_session_id();
109
-    $group_id   = api_get_group_id();
109
+    $group_id = api_get_group_id();
110 110
 
111 111
 	if (!empty($group_id)) {
112 112
 		$extra_condition = " WHERE to_group_id = '$group_id'";
113
-	} else{
113
+	} else {
114 114
 		$extra_condition = api_get_session_condition($session_id, false);
115 115
 	}
116
-    $extra_condition.= " AND c_id = $course_id ";
116
+    $extra_condition .= " AND c_id = $course_id ";
117 117
  	$sql = 'SELECT user_id, last_connection FROM '.$tbl_chat_connected.$extra_condition;
118 118
  	$result = Database::query($sql);
119 119
  	while ($row = Database::fetch_array($result, 'ASSOC')) {
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 {
135 135
     $userInfo = api_get_user_info($userId);
136 136
     $fullName = $userInfo['complete_name'];
137
-    $isMaster = (bool)api_is_course_admin();
137
+    $isMaster = (bool) api_is_course_admin();
138 138
 
139 139
     $document_path = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document';
140 140
     if (!empty($group_id)) {
@@ -182,10 +182,10 @@  discard block
 block discarded – undo
182 182
             if (!file_exists($chat_path.$basename_chat.'.log.html')) {
183 183
                 $doc_id = add_document(
184 184
                     $_course,
185
-                    $basepath_chat . '/' . $basename_chat . '.log.html',
185
+                    $basepath_chat.'/'.$basename_chat.'.log.html',
186 186
                     'file',
187 187
                     0,
188
-                    $basename_chat . '.log.html'
188
+                    $basename_chat.'.log.html'
189 189
                 );
190 190
                 api_item_property_update(
191 191
                     $_course,
Please login to merge, or discard this patch.
main/chat/footer_frame.inc.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,9 +9,9 @@
 block discarded – undo
9 9
  */
10 10
 ?>
11 11
 <audio id="audio">
12
-	<source src="<?php echo api_get_path(WEB_PATH);?>main/chat/sound/notification.wav" type="audio/wav"></source>
13
-	<source src="<?php echo api_get_path(WEB_PATH);?>main/chat/sound/notification.ogg" type="audio/ogg"></source>
14
-	<source src="<?php echo api_get_path(WEB_PATH);?>main/chat/sound/notification.mp3" type="audio/mpeg"></source>
12
+	<source src="<?php echo api_get_path(WEB_PATH); ?>main/chat/sound/notification.wav" type="audio/wav"></source>
13
+	<source src="<?php echo api_get_path(WEB_PATH); ?>main/chat/sound/notification.ogg" type="audio/ogg"></source>
14
+	<source src="<?php echo api_get_path(WEB_PATH); ?>main/chat/sound/notification.mp3" type="audio/mpeg"></source>
15 15
 </audio>
16 16
 </body>
17 17
 </html>
18 18
\ No newline at end of file
Please login to merge, or discard this patch.
main/glossary/index.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 
10 10
 require_once '../inc/global.inc.php';
11 11
 
12
-$current_course_tool  = TOOL_GLOSSARY;
12
+$current_course_tool = TOOL_GLOSSARY;
13 13
 
14 14
 // The section (tabs).
15 15
 $this_section = SECTION_COURSES;
@@ -44,24 +44,24 @@  discard block
 block discarded – undo
44 44
 
45 45
 $tool = 'GlossaryManagement';
46 46
 
47
-$interbreadcrumb[] = array ("url"=>"index.php", "name"=> get_lang('Glossary'));
47
+$interbreadcrumb[] = array("url"=>"index.php", "name"=> get_lang('Glossary'));
48 48
 
49 49
 if (!empty($action)) {
50 50
 
51 51
 }
52 52
 switch ($action) {
53 53
     case 'addglossary':
54
-        $tool_name =  get_lang('Add');
54
+        $tool_name = get_lang('Add');
55 55
         break;
56 56
     case 'edit_glossary':
57
-        $tool_name =  get_lang('Edit');
57
+        $tool_name = get_lang('Edit');
58 58
         break;
59 59
     case 'import':
60
-        $tool_name =  get_lang('ImportGlossary');
60
+        $tool_name = get_lang('ImportGlossary');
61 61
         break;
62 62
     case 'changeview':
63 63
     default:
64
-        $tool_name =  get_lang('List');
64
+        $tool_name = get_lang('List');
65 65
         break;
66 66
 }
67 67
 
@@ -75,9 +75,9 @@  discard block
 block discarded – undo
75 75
 
76 76
     usort($data, "sorter");
77 77
     $list = array();
78
-    $list[] = array('term','definition');
79
-    foreach($data as $line) {
80
-        $list[] = array ($line[0], $line[1]);
78
+    $list[] = array('term', 'definition');
79
+    foreach ($data as $line) {
80
+        $list[] = array($line[0], $line[1]);
81 81
     }
82 82
     $filename = 'glossary_course_'.api_get_course_id();
83 83
 	Export::arrayToCsv($list, $filename);
@@ -91,11 +91,11 @@  discard block
 block discarded – undo
91 91
 // Tool introduction
92 92
 Display::display_introduction_section(TOOL_GLOSSARY);
93 93
 
94
-if (isset($_GET['action']) && $_GET['action'] == 'changeview' && in_array($_GET['view'], array('list','table'))) {
94
+if (isset($_GET['action']) && $_GET['action'] == 'changeview' && in_array($_GET['view'], array('list', 'table'))) {
95 95
     $_SESSION['glossary_view'] = $_GET['view'];
96 96
 } else {
97 97
     if (!isset($_SESSION['glossary_view'])) {
98
-        $_SESSION['glossary_view'] = 'table';//Default option
98
+        $_SESSION['glossary_view'] = 'table'; //Default option
99 99
     }
100 100
 }
101 101
 
@@ -143,12 +143,12 @@  discard block
 block discarded – undo
143 143
                 // Setting the form elements
144 144
                 $form->addElement('header', '', get_lang('TermEdit'));
145 145
                 $form->addElement('hidden', 'glossary_id');
146
-                $form->addElement('text', 'glossary_title', get_lang('TermName'),array('size'=>'80'));
146
+                $form->addElement('text', 'glossary_title', get_lang('TermName'), array('size'=>'80'));
147 147
                 //$form->applyFilter('glossary_title', 'html_filter');
148 148
                 $form->addElement('html_editor', 'glossary_comment', get_lang('TermDefinition'), null, array('ToolbarSet' => 'Glossary', 'Height' => '300'));
149
-                $element = $form->addElement('text', 'insert_date', get_lang('CreationDate'),array('size'=>'100'));
149
+                $element = $form->addElement('text', 'insert_date', get_lang('CreationDate'), array('size'=>'100'));
150 150
                 $element->freeze();
151
-                $element = $form->addElement('text', 'update_date', get_lang('UpdateDate'),array('size'=>'100'));
151
+                $element = $form->addElement('text', 'update_date', get_lang('UpdateDate'), array('size'=>'100'));
152 152
                 $element->freeze();
153 153
                 $form->addButtonUpdate(get_lang('TermUpdateButton'), 'SubmitGlossary');
154 154
 
@@ -156,16 +156,16 @@  discard block
 block discarded – undo
156 156
                 $glossary_data = GlossaryManager::get_glossary_information($_GET['glossary_id']);
157 157
 
158 158
                 // Date treatment for timezones
159
-                if (!empty($glossary_data['insert_date'])  && $glossary_data['insert_date'] != '0000-00-00 00:00:00:') {
159
+                if (!empty($glossary_data['insert_date']) && $glossary_data['insert_date'] != '0000-00-00 00:00:00:') {
160 160
                     $glossary_data['insert_date'] = api_get_local_time($glossary_data['insert_date']);
161 161
                 } else {
162
-                    $glossary_data['insert_date']  = '';
162
+                    $glossary_data['insert_date'] = '';
163 163
                 }
164 164
 
165
-                if (!empty($glossary_data['update_date'])  && $glossary_data['update_date'] != '0000-00-00 00:00:00:') {
165
+                if (!empty($glossary_data['update_date']) && $glossary_data['update_date'] != '0000-00-00 00:00:00:') {
166 166
                     $glossary_data['update_date'] = api_get_local_time($glossary_data['update_date']);
167 167
                 } else {
168
-                    $glossary_data['update_date']  = '';
168
+                    $glossary_data['update_date'] = '';
169 169
                 }
170 170
 
171 171
                 $form->setDefaults($glossary_data);
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
                 if (isset($_POST['replace']) && $_POST['replace']) {
226 226
                     foreach (GlossaryManager::get_glossary_terms() as $term) {
227 227
                         if (!GlossaryManager::delete_glossary($term['id'], false)) {
228
-                            Display::display_error_message(get_lang ("CannotDeleteGlossary") . ':' . $term['id']);
228
+                            Display::display_error_message(get_lang("CannotDeleteGlossary").':'.$term['id']);
229 229
                         }
230 230
                     }
231 231
                 }
@@ -248,10 +248,10 @@  discard block
 block discarded – undo
248 248
                         $bad++;
249 249
                 }
250 250
 
251
-                Display::display_confirmation_message(get_lang ("TermsImported") . ':' . $good);
251
+                Display::display_confirmation_message(get_lang("TermsImported").':'.$good);
252 252
 
253 253
                 if ($bad) {
254
-                    Display::display_error_message (get_lang ("TermsNotImported") . ':' . $bad);
254
+                    Display::display_error_message(get_lang("TermsNotImported").':'.$bad);
255 255
                 }
256 256
 
257 257
                 GlossaryManager::display_glossary();
Please login to merge, or discard this patch.
main/glossary/glossary_ajax_request.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 if (isset($_POST['glossary_id']) &&
22 22
     $_POST['glossary_id'] == strval(intval($_POST['glossary_id']))
23 23
 ) {
24
-    $glossary_id= Security::remove_XSS($_POST['glossary_id']);
24
+    $glossary_id = Security::remove_XSS($_POST['glossary_id']);
25 25
     $glossary_description_by_id = GlossaryManager::get_glossary_term_by_glossary_id(
26 26
         $glossary_id
27 27
     );
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
         $glossary_description_by_id
32 32
     );
33 33
     echo api_xml_http_response_encode($glossary_description_by_id);
34
-} elseif (isset($_POST['glossary_data']) && $_POST['glossary_data']=='true') {
34
+} elseif (isset($_POST['glossary_data']) && $_POST['glossary_data'] == 'true') {
35 35
     //get_glossary_terms
36 36
     $glossary_data = GlossaryManager::get_glossary_terms();
37 37
     $glossary_all_data = array();
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
         $glossary_all_data = implode('[|.|_|.|-|.|]', $glossary_all_data);
43 43
         echo api_xml_http_response_encode($glossary_all_data);
44 44
     }
45
-} elseif(isset($_POST['glossary_name'])) {
45
+} elseif (isset($_POST['glossary_name'])) {
46 46
     $my_glossary_name = Security::remove_XSS($_POST['glossary_name']);
47 47
     $my_glossary_name = api_convert_encoding($my_glossary_name, $charset, 'UTF-8');
48 48
     $my_glossary_name = trim($my_glossary_name);
Please login to merge, or discard this patch.
main/inc/global.inc.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -155,9 +155,9 @@  discard block
 block discarded – undo
155 155
     $request_url_root = '';
156 156
     if (empty($_SERVER['HTTP_HOST'])) {
157 157
         if (empty($_SERVER['SERVER_NAME'])) {
158
-            $request_url_root = $protocol . 'localhost/';
158
+            $request_url_root = $protocol.'localhost/';
159 159
         } else {
160
-            $request_url_root = $protocol . $_SERVER['SERVER_NAME'] . '/';
160
+            $request_url_root = $protocol.$_SERVER['SERVER_NAME'].'/';
161 161
         }
162 162
     } else {
163 163
         $request_url_root = $protocol.$_SERVER['HTTP_HOST'].'/';
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
     }
447 447
 
448 448
     if (!empty($language_priority1) && api_get_language_from_type($language_priority1) !== false) {
449
-        $language_interface =  api_get_language_from_type($language_priority1);
449
+        $language_interface = api_get_language_from_type($language_priority1);
450 450
     } else {
451 451
         if (isset($_course['language'])) {
452 452
             $language_interface = $_course['language'];
Please login to merge, or discard this patch.
main/inc/introductionSection.inc.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     $form = new FormValidator('introduction_text');
54 54
 }
55 55
 
56
-$renderer =& $form->defaultRenderer();
56
+$renderer = & $form->defaultRenderer();
57 57
 $renderer->setCustomElementTemplate('<div style="width: 80%; margin: 0px auto; padding-bottom: 10px; ">{element}</div>');
58 58
 
59 59
 $config = array(
@@ -208,11 +208,11 @@  discard block
 block discarded – undo
208 208
     if ($displayMode == '1') {
209 209
         // Show only the current course progress step
210 210
         // $information_title = get_lang('InfoAboutLastDoneAdvance');
211
-        $last_done_advance =  $thematic->get_last_done_thematic_advance();
211
+        $last_done_advance = $thematic->get_last_done_thematic_advance();
212 212
         $thematic_advance_info = $thematic->get_thematic_advance_list($last_done_advance);
213 213
         $subTitle1 = get_lang('CurrentTopic');
214 214
         $class1 = ' current';
215
-    } else if($displayMode == '2') {
215
+    } else if ($displayMode == '2') {
216 216
         // Show only the two next course progress steps
217 217
         // $information_title = get_lang('InfoAboutNextAdvanceNotDone');
218 218
         $last_done_advance = $thematic->get_next_thematic_advance_not_done();
@@ -220,10 +220,10 @@  discard block
 block discarded – undo
220 220
         $thematic_advance_info = $thematic->get_thematic_advance_list($last_done_advance);
221 221
         $thematic_advance_info2 = $thematic->get_thematic_advance_list($next_advance_not_done);
222 222
         $subTitle1 = $subTitle2 = get_lang('NextTopic');
223
-    } else if($displayMode == '3') {
223
+    } else if ($displayMode == '3') {
224 224
         // Show the current and next course progress steps
225 225
         // $information_title = get_lang('InfoAboutLastDoneAdvanceAndNextAdvanceNotDone');
226
-        $last_done_advance =  $thematic->get_last_done_thematic_advance();
226
+        $last_done_advance = $thematic->get_last_done_thematic_advance();
227 227
         $next_advance_not_done = $thematic->get_next_thematic_advance_not_done();
228 228
         $thematic_advance_info = $thematic->get_thematic_advance_list($last_done_advance);
229 229
         $thematic_advance_info2 = $thematic->get_thematic_advance_list($next_advance_not_done);
@@ -234,8 +234,8 @@  discard block
 block discarded – undo
234 234
 
235 235
     if (!empty($thematic_advance_info)) {
236 236
         $thematic_advance = get_lang('CourseThematicAdvance');
237
-        $thematicScore = $thematic->get_total_average_of_thematic_advances() . '%';
238
-        $thematicUrl = api_get_path(WEB_CODE_PATH) .
237
+        $thematicScore = $thematic->get_total_average_of_thematic_advances().'%';
238
+        $thematicUrl = api_get_path(WEB_CODE_PATH).
239 239
             'course_progress/index.php?action=thematic_details&'.api_get_cidreq();
240 240
         $thematic_info = $thematic->get_thematic_list(
241 241
             $thematic_advance_info['thematic_id']
@@ -250,13 +250,13 @@  discard block
 block discarded – undo
250 250
         );
251 251
         $userInfo = $_SESSION['_user'];
252 252
         $courseInfo = api_get_course_info();
253
-        $titleThematic = $thematic_advance .' : '. $courseInfo['name'] . ' <b>( '. $thematicScore .' )</b>';
253
+        $titleThematic = $thematic_advance.' : '.$courseInfo['name'].' <b>( '.$thematicScore.' )</b>';
254 254
 
255 255
 
256 256
 
257
-        $infoUser = '<div class="thematic-avatar"><img src="' . $userInfo['avatar'] . '" class="img-circle img-responsive"></div>';
257
+        $infoUser = '<div class="thematic-avatar"><img src="'.$userInfo['avatar'].'" class="img-circle img-responsive"></div>';
258 258
         $infoUser .= '<div class="progress">
259
-                        <div class="progress-bar progress-bar-danger" role="progressbar" style="width: ' . $thematicScore . ';">
259
+                        <div class="progress-bar progress-bar-danger" role="progressbar" style="width: ' . $thematicScore.';">
260 260
                         '.$thematicScore.'
261 261
                         </div>
262 262
                     </div>';
@@ -265,11 +265,11 @@  discard block
 block discarded – undo
265 265
         $thematicItemOne = '
266 266
         <div class="col-md-6 items-progress">
267 267
             <div class="thematic-cont '.$class1.'">
268
-            <div class="topics">' . $subTitle1 . '</div>
269
-            <h4 class="title-topics">' . Display::returnFontAwesomeIcon('book') . $thematic_info['title'] . '</h4>
270
-            <p class="date">' .  Display::returnFontAwesomeIcon('calendar-o') . $thematic_advance_info['start_date'] . '</p>
271
-            <div class="views">' . Display::returnFontAwesomeIcon('file-text-o')  . strip_tags($thematic_advance_info['content']). '</div>
272
-            <p class="time">'. Display::returnFontAwesomeIcon('clock-o') . get_lang('DurationInHours') . ' : ' . $thematic_advance_info['duration'] . ' - <a href="' . $thematicUrl . '">' . get_lang('SeeDetail') . '</a></p>
268
+            <div class="topics">' . $subTitle1.'</div>
269
+            <h4 class="title-topics">' . Display::returnFontAwesomeIcon('book').$thematic_info['title'].'</h4>
270
+            <p class="date">' .  Display::returnFontAwesomeIcon('calendar-o').$thematic_advance_info['start_date'].'</p>
271
+            <div class="views">' . Display::returnFontAwesomeIcon('file-text-o').strip_tags($thematic_advance_info['content']).'</div>
272
+            <p class="time">'. Display::returnFontAwesomeIcon('clock-o').get_lang('DurationInHours').' : '.$thematic_advance_info['duration'].' - <a href="'.$thematicUrl.'">'.get_lang('SeeDetail').'</a></p>
273 273
             </div>
274 274
         </div>';
275 275
 
@@ -282,21 +282,21 @@  discard block
 block discarded – undo
282 282
                 <div class="col-md-6 items-progress">
283 283
                     <div class="thematic-cont">
284 284
                     <div class="topics">'.$subTitle2.'</div>
285
-                    <h4 class="title-topics">'. Display::returnFontAwesomeIcon('book')  . $thematic_info2['title'].'</h4>
286
-                    <p class="date">' . Display::returnFontAwesomeIcon('calendar-o') .$thematic_advance_info2['start_date'].'</p>
287
-                    <div class="views">' . Display::returnFontAwesomeIcon('file-text-o')  . strip_tags($thematic_advance_info2['content']).'</div>
288
-                    <p class="time">'. Display::returnFontAwesomeIcon('clock-o') .get_lang('DurationInHours').' : '.$thematic_advance_info2['duration'].' - <a href="'.$thematicUrl.'">'.get_lang('SeeDetail').'</a></p>
285
+                    <h4 class="title-topics">'. Display::returnFontAwesomeIcon('book').$thematic_info2['title'].'</h4>
286
+                    <p class="date">' . Display::returnFontAwesomeIcon('calendar-o').$thematic_advance_info2['start_date'].'</p>
287
+                    <div class="views">' . Display::returnFontAwesomeIcon('file-text-o').strip_tags($thematic_advance_info2['content']).'</div>
288
+                    <p class="time">'. Display::returnFontAwesomeIcon('clock-o').get_lang('DurationInHours').' : '.$thematic_advance_info2['duration'].' - <a href="'.$thematicUrl.'">'.get_lang('SeeDetail').'</a></p>
289 289
                     </div>
290 290
                 </div>';
291 291
         }
292 292
 
293 293
 
294 294
         $thematicPanel = '<div class="row">';
295
-        $thematicPanel .= '<div class="col-md-2">' . $infoUser . '</div>';
296
-        $thematicPanel .= '<div class="col-md-10"><div class="row">' . $thematicItemOne . $thematicItemTwo . '</div></div>';
295
+        $thematicPanel .= '<div class="col-md-2">'.$infoUser.'</div>';
296
+        $thematicPanel .= '<div class="col-md-10"><div class="row">'.$thematicItemOne.$thematicItemTwo.'</div></div>';
297 297
         $thematicPanel .= '</div>';
298 298
         $thematicPanel .= '<div class="separate">
299
-                        <a href="' . $thematicUrl . '" class="btn btn-default btn-block">' . get_lang('ShowFullCourseAdvance') . '</a>
299
+                        <a href="' . $thematicUrl.'" class="btn btn-default btn-block">'.get_lang('ShowFullCourseAdvance').'</a>
300 300
                     </div>';
301 301
         $thematicProgress = Display::panelCollapse($titleThematic, $thematicPanel, 'thematic', null, 'accordion-thematic', 'collapse-thematic', false);
302 302
     }
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
     $editIconButton = Display::url(
314 314
         '<em class="fa fa-wrench"></em> ',
315 315
         api_get_path(WEB_CODE_PATH).'course_info/tools.php?'.api_get_cidreq(),
316
-        ['class' => 'btn btn-default', 'title' => get_lang('CustomizeIcons') ]
316
+        ['class' => 'btn btn-default', 'title' => get_lang('CustomizeIcons')]
317 317
     );
318 318
 }
319 319
 
@@ -324,12 +324,12 @@  discard block
 block discarded – undo
324 324
         // Displays "Add intro" commands
325 325
         $toolbar = '<div class="btn-group pull-right" role="group">';
326 326
         if (!empty($courseId)) {
327
-            $textIntro  = '<a class="btn btn-default" title="' . get_lang('AddIntro') . '" href="'.api_get_self().'?' . api_get_cidreq().'&intro_cmdAdd=1">';
327
+            $textIntro  = '<a class="btn btn-default" title="'.get_lang('AddIntro').'" href="'.api_get_self().'?'.api_get_cidreq().'&intro_cmdAdd=1">';
328 328
             $textIntro .= '<em class="fa fa-file-text"></em> ';
329 329
             $textIntro .= "</a>";
330
-            $toolbar .= $textIntro . $editIconButton;
330
+            $toolbar .= $textIntro.$editIconButton;
331 331
         } else {
332
-            $toolbar .= '<a class="btn btn-default" href="' . api_get_self() . '?intro_cmdAdd=1">"' . get_lang('AddIntro') . '</a>';
332
+            $toolbar .= '<a class="btn btn-default" href="'.api_get_self().'?intro_cmdAdd=1">"'.get_lang('AddIntro').'</a>';
333 333
             $toolbar .= $editIconButton;
334 334
         }
335 335
         $toolbar .= '</div>';
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
                 '<a  class="btn btn-default" href="'.api_get_self().'?'.api_get_cidreq().'&intro_cmdEdit=1" title="'.get_lang('Modify').'">
343 343
                 <em class="fa fa-pencil"></em></a>';
344 344
             $toolbar .= $editIconButton;
345
-            $toolbar .="<a class=\"btn btn-default\" href=\"".api_get_self()."?".api_get_cidreq()."&intro_cmdDel=1\" onclick=\"javascript:
345
+            $toolbar .= "<a class=\"btn btn-default\" href=\"".api_get_self()."?".api_get_cidreq()."&intro_cmdDel=1\" onclick=\"javascript:
346 346
                 if(!confirm('".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES, $charset)).
347 347
                 "')) return false;\"><em class=\"fa fa-trash-o\"></em></a>";
348 348
 
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
                 if(!confirm('".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES, $charset)).
357 357
                 "')) return false;\"><em class=\"fa fa-trash-o\"></em></a>";
358 358
         }
359
-        $toolbar .=  "</div>";
359
+        $toolbar .= "</div>";
360 360
         // Fix for chrome XSS filter for videos in iframes - BT#7930
361 361
         $browser = api_get_navigator();
362 362
         if (strpos($introduction_section, '<iframe') !== false && $browser['name'] == 'Chrome') {
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
     } else {
376 376
         if (api_is_allowed_to_edit()) {
377 377
             $introduction_section .= '<div class="help-course">';
378
-            $introduction_section .= get_lang('AddCustomCourseIntro') . ' ' . $textIntro;
378
+            $introduction_section .= get_lang('AddCustomCourseIntro').' '.$textIntro;
379 379
             $introduction_section .= '</div>';
380 380
         }
381 381
     }
Please login to merge, or discard this patch.
main/inc/ajax/social.ajax.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -21,13 +21,13 @@  discard block
 block discarded – undo
21 21
         }
22 22
 
23 23
         if (isset($_GET['friend_id'])) {
24
-            $my_current_friend  = $_GET['friend_id'];
24
+            $my_current_friend = $_GET['friend_id'];
25 25
             UserManager::relate_users($current_user_id, $my_current_friend, $relation_type);
26 26
             UserManager::relate_users($my_current_friend, $current_user_id, $relation_type);
27 27
             SocialManager::invitation_accepted($my_current_friend, $current_user_id);
28 28
             Display::display_normal_message(api_xml_http_response_encode(get_lang('AddedContactToList')));
29 29
 
30
-            header('Location: ' . api_get_path(WEB_CODE_PATH) . 'social/invitations.php');
30
+            header('Location: '.api_get_path(WEB_CODE_PATH).'social/invitations.php');
31 31
         }
32 32
         break;
33 33
     case 'deny_friend':
@@ -37,15 +37,15 @@  discard block
 block discarded – undo
37 37
         }
38 38
 
39 39
         if (isset($_GET['is_my_friend'])) {
40
-            $relation_type = USER_RELATION_TYPE_FRIEND;//my friend
40
+            $relation_type = USER_RELATION_TYPE_FRIEND; //my friend
41 41
         } else {
42
-            $relation_type = USER_RELATION_TYPE_UNKNOW;//Contact unknown
42
+            $relation_type = USER_RELATION_TYPE_UNKNOW; //Contact unknown
43 43
         }
44 44
         if (isset($_GET['denied_friend_id'])) {
45 45
             SocialManager::invitation_denied($_GET['denied_friend_id'], $current_user_id);
46 46
             Display::display_confirmation_message(api_xml_http_response_encode(get_lang('InvitationDenied')));
47 47
             
48
-            header('Location: ' . api_get_path(WEB_CODE_PATH) . 'social/invitations.php');
48
+            header('Location: '.api_get_path(WEB_CODE_PATH).'social/invitations.php');
49 49
         }
50 50
         break;
51 51
     case 'delete_friend':
@@ -63,8 +63,8 @@  discard block
 block discarded – undo
63 63
             echo '';
64 64
             break;
65 65
         }
66
-        $user_id	= api_get_user_id();
67
-        $name_search= Security::remove_XSS($_POST['search_name_q']);
66
+        $user_id = api_get_user_id();
67
+        $name_search = Security::remove_XSS($_POST['search_name_q']);
68 68
         $number_friends = 0;
69 69
 
70 70
         if (isset($name_search) && $name_search != 'undefined') {
@@ -78,14 +78,14 @@  discard block
 block discarded – undo
78 78
 
79 79
         $number_friends = count($friends);
80 80
         if ($number_friends != 0) {
81
-            $number_loop   = ($number_friends/$number_of_images);
81
+            $number_loop   = ($number_friends / $number_of_images);
82 82
             $loop_friends  = ceil($number_loop);
83
-            $j=0;
84
-            for ($k=0; $k<$loop_friends; $k++) {
85
-                if ($j==$number_of_images) {
86
-                    $number_of_images=$number_of_images*2;
83
+            $j = 0;
84
+            for ($k = 0; $k < $loop_friends; $k++) {
85
+                if ($j == $number_of_images) {
86
+                    $number_of_images = $number_of_images * 2;
87 87
                 }
88
-                while ($j<$number_of_images) {
88
+                while ($j < $number_of_images) {
89 89
                     if (isset($friends[$j])) {
90 90
                         $friend = $friends[$j];
91 91
                         $user_name = api_xml_http_response_encode($friend['firstName'].' '.$friend['lastName']);
@@ -93,15 +93,15 @@  discard block
 block discarded – undo
93 93
 
94 94
                         $friend_html .= '
95 95
                             <div class="col-md-3">
96
-                                <div class="thumbnail text-center" id="div_' . $friends[$j]['friend_user_id'] . '">
97
-                                    <img src="' . $userPicture . '" class="img-responsive" id="imgfriend_' . $friend['friend_user_id'] . '" title="$user_name">
96
+                                <div class="thumbnail text-center" id="div_' . $friends[$j]['friend_user_id'].'">
97
+                                    <img src="' . $userPicture.'" class="img-responsive" id="imgfriend_'.$friend['friend_user_id'].'" title="$user_name">
98 98
                                     <div class="caption">
99 99
                                         <h3>
100
-                                            <a href="profile.php?u=' . $friend['friend_user_id'] . '">' . $user_name . '</a>
100
+                                            <a href="profile.php?u=' . $friend['friend_user_id'].'">'.$user_name.'</a>
101 101
                                         </h3>
102 102
                                         <p>
103
-                                            <button class="btn btn-danger" onclick="delete_friend(this)" id=img_' . $friend['friend_user_id'] . '>
104
-                                                ' . get_lang('Delete') . '
103
+                                            <button class="btn btn-danger" onclick="delete_friend(this)" id=img_' . $friend['friend_user_id'].'>
104
+                                                ' . get_lang('Delete').'
105 105
                                             </button>
106 106
                                         </p>
107 107
                                     </div>
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 
131 131
         switch ($action) {
132 132
             case 'load_course':
133
-                $course_id =  intval($_POST['course_code']); // the int course id
133
+                $course_id = intval($_POST['course_code']); // the int course id
134 134
                 $course_info = api_get_course_info_by_id($course_id);
135 135
                 $course_code = $course_info['code'];
136 136
 
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
                     //------Forum messages
139 139
                     $forum_result = get_all_post_from_user($user_id, $course_code);
140 140
                     $all_result_data = 0;
141
-                    if ($forum_result !='') {
141
+                    if ($forum_result != '') {
142 142
                         echo '<div id="social-forum-main-title">';
143 143
                         echo api_xml_http_response_encode(get_lang('Forum'));
144 144
                         echo '</div>';
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
         if (!empty($array)) {
202 202
             ksort($array);
203 203
             $html = '';
204
-            for($i = 0; $i < count($array); $i++) {
204
+            for ($i = 0; $i < count($array); $i++) {
205 205
                 $post = $array[$i]['html'];
206 206
                 $comment = SocialManager::getWallMessagesHTML($userId, $friendId, $array[$i]['id']);
207 207
                 $html .= '<div class="panel panel-info"><div class="panel-body">'.$post.$comment.'</div></div>';
@@ -209,8 +209,8 @@  discard block
 block discarded – undo
209 209
             $html .= Display::div(
210 210
                 Display::url(
211 211
                     get_lang('SeeMore'),
212
-                    api_get_self() . '?u=' . $userId . '&a=listWallMessage&start=' .
213
-                    ($start + $length + 1) . '&length=' . $length,
212
+                    api_get_self().'?u='.$userId.'&a=listWallMessage&start='.
213
+                    ($start + $length + 1).'&length='.$length,
214 214
                     array(
215 215
                         'class' => 'nextPage',
216 216
                     )
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
     case 'readUrlWithOpenGraph':
227 227
         $url = isset($_POST['social_wall_new_msg_main']) ? $_POST['social_wall_new_msg_main'] : '';
228 228
         $html = '';
229
-        if (SocialManager::verifyUrl($url) == true){
229
+        if (SocialManager::verifyUrl($url) == true) {
230 230
             $html = Security::remove_XSS(
231 231
                 SocialManager::readContentWithOpenGraph($url)
232 232
             );
Please login to merge, or discard this patch.