@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | } |
57 | 57 | |
58 | 58 | $c_id = $c_id ? intval($c_id) : api_get_course_int_id(); |
59 | - $table = Database::get_course_table(TABLE_TOOL_LIST); |
|
59 | + $table = Database::get_course_table(TABLE_TOOL_LIST); |
|
60 | 60 | $sql = "SELECT * from $table |
61 | 61 | WHERE c_id = $c_id and name='$name' |
62 | 62 | LIMIT 1"; |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | $clean_gradebook = array(); |
114 | 114 | |
115 | 115 | if (!empty($skill_gradebooks_source)) { |
116 | - foreach($skill_gradebooks_source as $source) { |
|
116 | + foreach ($skill_gradebooks_source as $source) { |
|
117 | 117 | $clean_gradebook[] = $source['skill_id']; |
118 | 118 | } |
119 | 119 | } |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | $selected_skills = self::get_skills_by_gradebook($gradebook_id); |
193 | 193 | $clean_selected_skills = array(); |
194 | 194 | if (!empty($selected_skills)) { |
195 | - foreach($selected_skills as $skill) { |
|
195 | + foreach ($selected_skills as $skill) { |
|
196 | 196 | $clean_selected_skills[] = $skill['id']; |
197 | 197 | } |
198 | 198 | } |
@@ -115,8 +115,7 @@ discard block |
||
115 | 115 | */ |
116 | 116 | public static function getUTCDateTimeTypeClass() |
117 | 117 | { |
118 | - return isset(self::$utcDateTimeClass) ? self::$utcDateTimeClass : |
|
119 | - 'Application\DoctrineExtensions\DBAL\Types\UTCDateTimeType'; |
|
118 | + return isset(self::$utcDateTimeClass) ? self::$utcDateTimeClass : 'Application\DoctrineExtensions\DBAL\Types\UTCDateTimeType'; |
|
120 | 119 | } |
121 | 120 | |
122 | 121 | /** |
@@ -393,7 +392,7 @@ discard block |
||
393 | 392 | |
394 | 393 | if (!empty($params)) { |
395 | 394 | $sql = 'INSERT INTO '.$table_name.' ('.implode(',', $params).') |
396 | - VALUES (:'.implode(', :' ,$params).')'; |
|
395 | + VALUES (:'.implode(', :', $params).')'; |
|
397 | 396 | |
398 | 397 | $statement = self::getManager()->getConnection()->prepare($sql); |
399 | 398 | $result = $statement->execute($attributes); |
@@ -434,7 +433,7 @@ discard block |
||
434 | 433 | foreach ($attributes as $key => $value) { |
435 | 434 | $update_sql .= "$key = :$key "; |
436 | 435 | if ($count < count($attributes)) { |
437 | - $update_sql.=', '; |
|
436 | + $update_sql .= ', '; |
|
438 | 437 | } |
439 | 438 | $count++; |
440 | 439 | } |
@@ -481,7 +480,7 @@ discard block |
||
481 | 480 | if ($columns == '*') { |
482 | 481 | $clean_columns = '*'; |
483 | 482 | } else { |
484 | - $clean_columns = (string)$columns; |
|
483 | + $clean_columns = (string) $columns; |
|
485 | 484 | } |
486 | 485 | } |
487 | 486 | |
@@ -527,9 +526,9 @@ discard block |
||
527 | 526 | foreach ($condition_data as $condition => $value_array) { |
528 | 527 | if (is_array($value_array)) { |
529 | 528 | $clean_values = array(); |
530 | - foreach($value_array as $item) { |
|
529 | + foreach ($value_array as $item) { |
|
531 | 530 | $item = Database::escape_string($item); |
532 | - $clean_values[]= $item; |
|
531 | + $clean_values[] = $item; |
|
533 | 532 | } |
534 | 533 | } else { |
535 | 534 | $value_array = Database::escape_string($value_array); |
@@ -537,23 +536,23 @@ discard block |
||
537 | 536 | } |
538 | 537 | |
539 | 538 | if (!empty($condition) && $clean_values != '') { |
540 | - $condition = str_replace('%',"'@percentage@'", $condition); //replace "%" |
|
541 | - $condition = str_replace("'?'","%s", $condition); |
|
542 | - $condition = str_replace("?","%s", $condition); |
|
539 | + $condition = str_replace('%', "'@percentage@'", $condition); //replace "%" |
|
540 | + $condition = str_replace("'?'", "%s", $condition); |
|
541 | + $condition = str_replace("?", "%s", $condition); |
|
543 | 542 | |
544 | - $condition = str_replace("@%s@","@-@", $condition); |
|
545 | - $condition = str_replace("%s","'%s'", $condition); |
|
546 | - $condition = str_replace("@-@","@%s@", $condition); |
|
543 | + $condition = str_replace("@%s@", "@-@", $condition); |
|
544 | + $condition = str_replace("%s", "'%s'", $condition); |
|
545 | + $condition = str_replace("@-@", "@%s@", $condition); |
|
547 | 546 | |
548 | 547 | // Treat conditions as string |
549 | 548 | $condition = vsprintf($condition, $clean_values); |
550 | - $condition = str_replace('@percentage@','%', $condition); //replace "%" |
|
549 | + $condition = str_replace('@percentage@', '%', $condition); //replace "%" |
|
551 | 550 | $where_return .= $condition; |
552 | 551 | } |
553 | 552 | } |
554 | 553 | |
555 | 554 | if (!empty($where_return)) { |
556 | - $return_value = " WHERE $where_return" ; |
|
555 | + $return_value = " WHERE $where_return"; |
|
557 | 556 | } |
558 | 557 | break; |
559 | 558 | case 'order': |
@@ -565,7 +564,7 @@ discard block |
||
565 | 564 | $new_order_array = explode(',', $order_array); |
566 | 565 | $temp_value = array(); |
567 | 566 | |
568 | - foreach($new_order_array as $element) { |
|
567 | + foreach ($new_order_array as $element) { |
|
569 | 568 | $element = explode(' ', $element); |
570 | 569 | $element = array_filter($element); |
571 | 570 | $element = array_values($element); |
@@ -576,10 +575,10 @@ discard block |
||
576 | 575 | if (in_array($element[1], array('desc', 'asc'))) { |
577 | 576 | $order = $element[1]; |
578 | 577 | } |
579 | - $temp_value[]= $element[0].' '.$order.' '; |
|
578 | + $temp_value[] = $element[0].' '.$order.' '; |
|
580 | 579 | } else { |
581 | 580 | //by default DESC |
582 | - $temp_value[]= $element[0].' DESC '; |
|
581 | + $temp_value[] = $element[0].' DESC '; |
|
583 | 582 | } |
584 | 583 | } |
585 | 584 | if (!empty($temp_value)) { |
@@ -594,7 +593,7 @@ discard block |
||
594 | 593 | if (!empty($limit_array)) { |
595 | 594 | if (count($limit_array) > 1) { |
596 | 595 | $return_value .= ' LIMIT '.intval($limit_array[0]).' , '.intval($limit_array[1]); |
597 | - } else { |
|
596 | + } else { |
|
598 | 597 | $return_value .= ' LIMIT '.intval($limit_array[0]); |
599 | 598 | } |
600 | 599 | } |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | { |
28 | 28 | $this->skills = $skills; |
29 | 29 | $this->type = $type; |
30 | - $this->center_x = intval($offset_x + $this->canvas_x/2 - $this->block_size/2); |
|
30 | + $this->center_x = intval($offset_x + $this->canvas_x / 2 - $this->block_size / 2); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | function prepare_skill_box($skill, $position, $class) |
@@ -39,9 +39,9 @@ discard block |
||
39 | 39 | $extra_class = 'second_window'; |
40 | 40 | } |
41 | 41 | |
42 | - $this->html .= '<div id="block_'.$block_id.'" class = "open_block window '.$extra_class.' '.$class.'" style = "top:' . $position['y'] . 'px; left:' . $position['x'] . 'px;">'; |
|
42 | + $this->html .= '<div id="block_'.$block_id.'" class = "open_block window '.$extra_class.' '.$class.'" style = "top:'.$position['y'].'px; left:'.$position['x'].'px;">'; |
|
43 | 43 | |
44 | - $content = $skill['name']; |
|
44 | + $content = $skill['name']; |
|
45 | 45 | $content .= '<div class="btn-group">'; |
46 | 46 | $content .= Display::url(get_lang('Edit'), '#', array('id'=>'edit_block_'.$block_id, 'class'=>'edit_block btn')); |
47 | 47 | $content .= Display::url('+', '#', array('id'=>'edit_block_'.$block_id, 'class'=>'edit_block btn')); |
@@ -87,9 +87,9 @@ discard block |
||
87 | 87 | } |
88 | 88 | //default_arrow_color |
89 | 89 | |
90 | - $this->js .= 'var e'.$block_id.' = prepare("block_' . $block_id.'", '.$end_point.');'."\n"; |
|
91 | - $this->js .= 'var e'.$skill['parent_id'].' = prepare("block_' . $skill['parent_id'].'", '.$end_point.');'."\n"; |
|
92 | - $this->js .= 'jsPlumb.connect({source: e'.$block_id.', target:e'.$skill['parent_id'].'});'."\n";; |
|
90 | + $this->js .= 'var e'.$block_id.' = prepare("block_'.$block_id.'", '.$end_point.');'."\n"; |
|
91 | + $this->js .= 'var e'.$skill['parent_id'].' = prepare("block_'.$skill['parent_id'].'", '.$end_point.');'."\n"; |
|
92 | + $this->js .= 'jsPlumb.connect({source: e'.$block_id.', target:e'.$skill['parent_id'].'});'."\n"; ; |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | /** |
@@ -125,10 +125,10 @@ discard block |
||
125 | 125 | $brothers = array(); |
126 | 126 | |
127 | 127 | foreach ($this->skills as &$skill) { |
128 | - if (!in_array($skill['parent_id'], array(0,1))) { |
|
128 | + if (!in_array($skill['parent_id'], array(0, 1))) { |
|
129 | 129 | continue; |
130 | 130 | } |
131 | - $childs = isset($skill['children']) ? count($skill['children']) : 0 ; |
|
131 | + $childs = isset($skill['children']) ? count($skill['children']) : 0; |
|
132 | 132 | |
133 | 133 | //$x = round($this->offsetX * sin(deg2rad($corner * $count))); |
134 | 134 | //$y = round($this->offsetY * cos(deg2rad($corner * $count))); |
@@ -144,10 +144,10 @@ discard block |
||
144 | 144 | if ($skill['parent_id'] == 0) { |
145 | 145 | //$x = 130*$childs/2; |
146 | 146 | //$x = $this->space_between_blocks_x*$childs/2; |
147 | - $x = $this->canvas_x/2 - $this->block_size/2; |
|
147 | + $x = $this->canvas_x / 2 - $this->block_size / 2; |
|
148 | 148 | } else { |
149 | 149 | $max = isset($this->skills[$skill['parent_id']]['children']) ? count($this->skills[$skill['parent_id']]['children']) : 0; |
150 | - foreach($this->skills[$skill['parent_id']]['children'] as $id => $sk) { |
|
150 | + foreach ($this->skills[$skill['parent_id']]['children'] as $id => $sk) { |
|
151 | 151 | if ($skill['id'] == $sk['id']) { |
152 | 152 | break; |
153 | 153 | } |
@@ -155,17 +155,17 @@ discard block |
||
155 | 155 | } |
156 | 156 | $parent_x = isset($this->skills[$skill['parent_id']]['x']) ? $this->skills[$skill['parent_id']]['x'] : 0; |
157 | 157 | //$x = $my_count*$this->space_between_blocks_x + $parent_x + $this->block_size - ($this->space_between_blocks_x*$max/2) ; |
158 | - $x = $my_count*$this->space_between_blocks_x + $parent_x + $this->block_size - ($this->canvas_x/2 ) ; |
|
158 | + $x = $my_count * $this->space_between_blocks_x + $parent_x + $this->block_size - ($this->canvas_x / 2); |
|
159 | 159 | } |
160 | 160 | |
161 | - $y = $skill['level']*$this->space_between_blocks_y; |
|
161 | + $y = $skill['level'] * $this->space_between_blocks_y; |
|
162 | 162 | |
163 | 163 | $skill['x'] = $x; |
164 | 164 | $skill['y'] = $y; |
165 | 165 | |
166 | 166 | //$skill['description'] = "{$brothers[$skill['parent_id']]} $x - $y"; |
167 | 167 | //$skill['name'] = $skill['name']." | $x = $my_count * 150 + $parent_x - (150* $max/2) - 10*$childs "; |
168 | - $this->add_item($skill, array('x' => $this->offset_x + $x, 'y' => $this->offset_y +$y)); |
|
168 | + $this->add_item($skill, array('x' => $this->offset_x + $x, 'y' => $this->offset_y + $y)); |
|
169 | 169 | } |
170 | 170 | return $this->get_html(); |
171 | 171 | } |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | break; |
210 | 210 | } |
211 | 211 | |
212 | - $fileName = ExtraField::FIELD_TYPE_FILE_IMAGE . "_{$params['item_id']}.png"; |
|
212 | + $fileName = ExtraField::FIELD_TYPE_FILE_IMAGE."_{$params['item_id']}.png"; |
|
213 | 213 | |
214 | 214 | if (!file_exists($fileDir)) { |
215 | 215 | mkdir($fileDir, $dirPermissions, true); |
@@ -217,11 +217,11 @@ discard block |
||
217 | 217 | |
218 | 218 | if ($value['error'] == 0) { |
219 | 219 | $imageExtraField = new Image($value['tmp_name']); |
220 | - $imageExtraField->send_image($fileDir . $fileName, -1, 'png'); |
|
220 | + $imageExtraField->send_image($fileDir.$fileName, -1, 'png'); |
|
221 | 221 | $newParams = array( |
222 | 222 | 'item_id' => $params['item_id'], |
223 | 223 | 'field_id' => $extraFieldInfo['id'], |
224 | - 'value' => $fileDirStored . $fileName, |
|
224 | + 'value' => $fileDirStored.$fileName, |
|
225 | 225 | 'comment' => $comment |
226 | 226 | ); |
227 | 227 | |
@@ -247,18 +247,18 @@ discard block |
||
247 | 247 | } |
248 | 248 | |
249 | 249 | $cleanedName = api_replace_dangerous_char($value['name']); |
250 | - $fileName = ExtraField::FIELD_TYPE_FILE . "_{$params['item_id']}_$cleanedName"; |
|
250 | + $fileName = ExtraField::FIELD_TYPE_FILE."_{$params['item_id']}_$cleanedName"; |
|
251 | 251 | if (!file_exists($fileDir)) { |
252 | 252 | mkdir($fileDir, $dirPermissions, true); |
253 | 253 | } |
254 | 254 | |
255 | 255 | if ($value['error'] == 0) { |
256 | - moveUploadedFile($value, $fileDir . $fileName); |
|
256 | + moveUploadedFile($value, $fileDir.$fileName); |
|
257 | 257 | |
258 | 258 | $new_params = array( |
259 | 259 | 'item_id' => $params['item_id'], |
260 | 260 | 'field_id' => $extraFieldInfo['id'], |
261 | - 'value' => $fileDirStored . $fileName |
|
261 | + 'value' => $fileDirStored.$fileName |
|
262 | 262 | ); |
263 | 263 | |
264 | 264 | if ($this->type !== 'session' && $this->type !== 'course') { |
@@ -380,7 +380,7 @@ discard block |
||
380 | 380 | */ |
381 | 381 | if (false) { |
382 | 382 | global $app; |
383 | - switch($this->type) { |
|
383 | + switch ($this->type) { |
|
384 | 384 | case 'question': |
385 | 385 | $extraFieldValue = new ChamiloLMS\Entity\QuestionFieldValues(); |
386 | 386 | $extraFieldValue->setUserId(api_get_user_id()); |
@@ -442,7 +442,7 @@ discard block |
||
442 | 442 | */ |
443 | 443 | if (false) { |
444 | 444 | global $app; |
445 | - switch($this->type) { |
|
445 | + switch ($this->type) { |
|
446 | 446 | case 'question': |
447 | 447 | $extraFieldValue = $app['orm.ems']['db_write']->getRepository('ChamiloLMS\Entity\QuestionFieldValues')->find($field_values['id']); |
448 | 448 | $extraFieldValue->setUserId(api_get_user_id()); |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | } |
100 | 100 | foreach ($data as $row) { |
101 | 101 | $string = implode("</td><td>", $row); |
102 | - $string = '<tr><td>' . $string . '</td></tr>'; |
|
102 | + $string = '<tr><td>'.$string.'</td></tr>'; |
|
103 | 103 | if ($encoding != 'utf-8') { |
104 | 104 | $string = api_convert_encoding($string, $encoding, $systemEncoding); |
105 | 105 | } |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | fwrite($handle, '<'.$wrapper_tagname.'>'); |
174 | 174 | } |
175 | 175 | $s = self::_export_complex_table_xml_helper($data); |
176 | - fwrite($handle,$s); |
|
176 | + fwrite($handle, $s); |
|
177 | 177 | if (!is_null($wrapper_tagname)) { |
178 | 178 | fwrite($handle, '</'.$wrapper_tagname.'>'."\n"); |
179 | 179 | } |
@@ -195,10 +195,10 @@ discard block |
||
195 | 195 | } |
196 | 196 | $string = ''; |
197 | 197 | foreach ($data as $row) { |
198 | - $string .= "\n".str_repeat("\t",$level).'<'.$row['name'].'>'; |
|
198 | + $string .= "\n".str_repeat("\t", $level).'<'.$row['name'].'>'; |
|
199 | 199 | if (is_array($row['value'])) { |
200 | - $string .= self::_export_complex_table_xml_helper($row['value'],$level+1)."\n"; |
|
201 | - $string .= str_repeat("\t",$level).'</'.$row['name'].'>'; |
|
200 | + $string .= self::_export_complex_table_xml_helper($row['value'], $level + 1)."\n"; |
|
201 | + $string .= str_repeat("\t", $level).'</'.$row['name'].'>'; |
|
202 | 202 | } else { |
203 | 203 | $string .= $row['value']; |
204 | 204 | $string .= '</'.$row['name'].'>'; |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | $to_user_id, |
187 | 187 | $message, |
188 | 188 | $printResult = true, |
189 | - $sanitize = true |
|
189 | + $sanitize = true |
|
190 | 190 | ) |
191 | 191 | { |
192 | 192 | $user_friend_relation = SocialManager::get_relation_between_contacts( |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | $messagesan = $message; |
207 | 207 | } |
208 | 208 | |
209 | - error_log(print_r($sanitize) . '----' . $messagesan); |
|
209 | + error_log(print_r($sanitize).'----'.$messagesan); |
|
210 | 210 | |
211 | 211 | if (!isset($_SESSION['chatHistory'][$to_user_id])) { |
212 | 212 | $_SESSION['chatHistory'][$to_user_id] = array(); |
@@ -289,9 +289,9 @@ discard block |
||
289 | 289 | */ |
290 | 290 | public static function disableChat() |
291 | 291 | { |
292 | - if (!empty($_SESSION['disable_chat'])){ |
|
292 | + if (!empty($_SESSION['disable_chat'])) { |
|
293 | 293 | $status = $_SESSION['disable_chat']; |
294 | - if ($status == true){ |
|
294 | + if ($status == true) { |
|
295 | 295 | $_SESSION['disable_chat'] = null; |
296 | 296 | return true; |
297 | 297 | } |
@@ -110,10 +110,10 @@ discard block |
||
110 | 110 | { |
111 | 111 | $old_locale = setlocale(LC_ALL, null); |
112 | 112 | $code = api_get_language_isocode(); |
113 | - $locale_list = array($code.'.utf8', 'en.utf8','en_US.utf8','en_GB.utf8'); |
|
113 | + $locale_list = array($code.'.utf8', 'en.utf8', 'en_US.utf8', 'en_GB.utf8'); |
|
114 | 114 | $try_sort = false; |
115 | 115 | |
116 | - foreach($locale_list as $locale) { |
|
116 | + foreach ($locale_list as $locale) { |
|
117 | 117 | $my_local = setlocale(LC_COLLATE, $locale); |
118 | 118 | if ($my_local) { |
119 | 119 | $try_sort = true; |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | $flatten = array(); |
152 | 152 | array_walk_recursive( |
153 | 153 | $array, |
154 | - function ($value) use (&$flatten) { |
|
154 | + function($value) use (&$flatten) { |
|
155 | 155 | $flatten[] = $value; |
156 | 156 | } |
157 | 157 | ); |
@@ -78,9 +78,7 @@ discard block |
||
78 | 78 | Database::query($sql); |
79 | 79 | |
80 | 80 | // Auto subscribe |
81 | - $user_status = $userInfo['status'] == SESSIONADMIN ? 'sessionadmin' : |
|
82 | - $userInfo['status'] == COURSEMANAGER ? 'teacher' : |
|
83 | - $userInfo['status'] == DRH ? 'DRH' : 'student'; |
|
81 | + $user_status = $userInfo['status'] == SESSIONADMIN ? 'sessionadmin' : $userInfo['status'] == COURSEMANAGER ? 'teacher' : $userInfo['status'] == DRH ? 'DRH' : 'student'; |
|
84 | 82 | $autoSubscribe = api_get_setting($user_status.'_autosubscribe'); |
85 | 83 | if ($autoSubscribe) { |
86 | 84 | $autoSubscribe = explode('|', $autoSubscribe); |
@@ -334,7 +332,7 @@ discard block |
||
334 | 332 | global $debug; |
335 | 333 | |
336 | 334 | if ($debug) error_log('Called to update_event_exercice'); |
337 | - if ($debug) error_log('duration:' . $duration); |
|
335 | + if ($debug) error_log('duration:'.$duration); |
|
338 | 336 | |
339 | 337 | if ($exeid != '') { |
340 | 338 | /* |
@@ -382,7 +380,7 @@ discard block |
||
382 | 380 | status = '".$status."', |
383 | 381 | questions_to_check = '".$remind_list."', |
384 | 382 | data_tracking = '".implode(',', $question_list)."', |
385 | - user_ip = '" . Database::escape_string(api_get_real_ip()) . "' |
|
383 | + user_ip = '" . Database::escape_string(api_get_real_ip())."' |
|
386 | 384 | WHERE exe_id = '".Database::escape_string($exeid)."'"; |
387 | 385 | $res = Database::query($sql); |
388 | 386 | |
@@ -1036,15 +1034,15 @@ discard block |
||
1036 | 1034 | |
1037 | 1035 | if (!empty($exe_list) && is_array($exe_list) && count($exe_list) > 0) { |
1038 | 1036 | $sql = "DELETE FROM $track_e_exercises |
1039 | - WHERE exe_id IN (" . implode(',', $exe_list) . ")"; |
|
1037 | + WHERE exe_id IN (".implode(',', $exe_list).")"; |
|
1040 | 1038 | Database::query($sql); |
1041 | 1039 | |
1042 | 1040 | $sql = "DELETE FROM $track_attempts |
1043 | - WHERE exe_id IN (" . implode(',', $exe_list) . ")"; |
|
1041 | + WHERE exe_id IN (".implode(',', $exe_list).")"; |
|
1044 | 1042 | Database::query($sql); |
1045 | 1043 | |
1046 | 1044 | $sql = "DELETE FROM $recording_table |
1047 | - WHERE exe_id IN (" . implode(',', $exe_list) . ")"; |
|
1045 | + WHERE exe_id IN (".implode(',', $exe_list).")"; |
|
1048 | 1046 | Database::query($sql); |
1049 | 1047 | } |
1050 | 1048 | |
@@ -1086,7 +1084,7 @@ discard block |
||
1086 | 1084 | Event::addEvent( |
1087 | 1085 | LOG_EXERCISE_RESULT_DELETE, |
1088 | 1086 | LOG_EXERCISE_AND_USER_ID, |
1089 | - $exercise_id . '-' . $user_id, |
|
1087 | + $exercise_id.'-'.$user_id, |
|
1090 | 1088 | null, |
1091 | 1089 | null, |
1092 | 1090 | $course_id, |
@@ -1458,7 +1456,7 @@ discard block |
||
1458 | 1456 | $res = Database::query($sql); |
1459 | 1457 | $list = array(); |
1460 | 1458 | while ($row = Database::fetch_array($res, 'ASSOC')) { |
1461 | - $list[$row['exe_id']] = $row; /* |
|
1459 | + $list[$row['exe_id']] = $row; /* |
|
1462 | 1460 | $sql = "SELECT * FROM $table_track_attempt WHERE exe_id = {$row['exe_id']}"; |
1463 | 1461 | $res_question = Database::query($sql); |
1464 | 1462 | while($row_q = Database::fetch_array($res_question,'ASSOC')) { |
@@ -1684,7 +1682,7 @@ discard block |
||
1684 | 1682 | Event::addEvent( |
1685 | 1683 | LOG_QUESTION_RESULT_DELETE, |
1686 | 1684 | LOG_EXERCISE_ATTEMPT_QUESTION_ID, |
1687 | - $exe_id . '-' . $question_id, |
|
1685 | + $exe_id.'-'.$question_id, |
|
1688 | 1686 | null, |
1689 | 1687 | null, |
1690 | 1688 | $courseId, |
@@ -1720,7 +1718,7 @@ discard block |
||
1720 | 1718 | Event::addEvent( |
1721 | 1719 | LOG_QUESTION_RESULT_DELETE, |
1722 | 1720 | LOG_EXERCISE_ATTEMPT_QUESTION_ID, |
1723 | - $exe_id . '-' . $question_id, |
|
1721 | + $exe_id.'-'.$question_id, |
|
1724 | 1722 | null, |
1725 | 1723 | null, |
1726 | 1724 | $courseId, |
@@ -109,12 +109,12 @@ discard block |
||
109 | 109 | friend_user_id<>'.((int) $user_id).' AND |
110 | 110 | user_id='.((int) $user_id); |
111 | 111 | if (isset($id_group) && $id_group > 0) { |
112 | - $sql.=' AND relation_type='.$id_group; |
|
112 | + $sql .= ' AND relation_type='.$id_group; |
|
113 | 113 | } |
114 | 114 | if (isset($search_name)) { |
115 | 115 | $search_name = trim($search_name); |
116 | 116 | $search_name = str_replace(' ', '', $search_name); |
117 | - $sql.=' AND friend_user_id IN ( |
|
117 | + $sql .= ' AND friend_user_id IN ( |
|
118 | 118 | SELECT user_id FROM '.$tbl_my_user.' |
119 | 119 | WHERE |
120 | 120 | firstName LIKE "%'.Database::escape_string($search_name).'%" OR |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | |
369 | 369 | $user_info = api_get_user_info($userfriend_id); |
370 | 370 | $succes = get_lang('MessageSentTo'); |
371 | - $succes.= ' : '.api_get_person_name($user_info['firstName'], $user_info['lastName']); |
|
371 | + $succes .= ' : '.api_get_person_name($user_info['firstName'], $user_info['lastName']); |
|
372 | 372 | |
373 | 373 | if (isset($subject_message) && isset($content_message) && isset($userfriend_id)) { |
374 | 374 | $send_message = MessageManager::send_message($userfriend_id, $subject_message, $content_message); |
@@ -485,7 +485,7 @@ discard block |
||
485 | 485 | $user_in_course_status = CourseManager :: get_user_in_course_status(api_get_user_id(), $course_code); |
486 | 486 | |
487 | 487 | //$valor = api_get_settings_params(); |
488 | - $course_path = api_get_path(SYS_COURSE_PATH).$course_directory; // course path |
|
488 | + $course_path = api_get_path(SYS_COURSE_PATH).$course_directory; // course path |
|
489 | 489 | if (api_get_setting('course_images_in_courses_list') === 'true') { |
490 | 490 | if (file_exists($course_path.'/course-pic85x85.png')) { |
491 | 491 | $image = $my_course['course_info']['course_image']; |
@@ -510,7 +510,7 @@ discard block |
||
510 | 510 | if ($course_visibility != COURSE_VISIBILITY_HIDDEN && |
511 | 511 | ($course_visibility != COURSE_VISIBILITY_CLOSED || $user_in_course_status == COURSEMANAGER) |
512 | 512 | ) { |
513 | - $result .= '<span class="title">' . $course_title . '<span>'; |
|
513 | + $result .= '<span class="title">'.$course_title.'<span>'; |
|
514 | 514 | } else { |
515 | 515 | $result .= $course_title." "." ".get_lang('CourseClosed').""; |
516 | 516 | } |
@@ -729,57 +729,57 @@ discard block |
||
729 | 729 | $links = '<ul class="nav nav-pills nav-stacked">'; |
730 | 730 | $active = $show == 'home' ? 'active' : null; |
731 | 731 | $links .= ' |
732 | - <li class="home-icon ' . $active . '"> |
|
733 | - <a href="' . api_get_path(WEB_CODE_PATH) . 'social/home.php"> |
|
734 | - ' . $homeIcon . ' ' . get_lang('Home') . ' |
|
732 | + <li class="home-icon ' . $active.'"> |
|
733 | + <a href="' . api_get_path(WEB_CODE_PATH).'social/home.php"> |
|
734 | + ' . $homeIcon.' '.get_lang('Home').' |
|
735 | 735 | </a> |
736 | 736 | </li>'; |
737 | 737 | $active = $show == 'messages' ? 'active' : null; |
738 | 738 | $links .= ' |
739 | - <li class="messages-icon ' . $active . '"> |
|
740 | - <a href="' . api_get_path(WEB_CODE_PATH) . 'messages/inbox.php?f=social"> |
|
741 | - ' . $messagesIcon . ' ' . get_lang('Messages') . $count_unread_message . ' |
|
739 | + <li class="messages-icon ' . $active.'"> |
|
740 | + <a href="' . api_get_path(WEB_CODE_PATH).'messages/inbox.php?f=social"> |
|
741 | + ' . $messagesIcon.' '.get_lang('Messages').$count_unread_message.' |
|
742 | 742 | </a> |
743 | 743 | </li>'; |
744 | 744 | |
745 | 745 | //Invitations |
746 | 746 | $active = $show == 'invitations' ? 'active' : null; |
747 | 747 | $links .= ' |
748 | - <li class="invitations-icon ' . $active . '"> |
|
749 | - <a href="' . api_get_path(WEB_CODE_PATH) . 'social/invitations.php"> |
|
750 | - ' . $invitationsIcon . ' ' . get_lang('Invitations') . $total_invitations . ' |
|
748 | + <li class="invitations-icon ' . $active.'"> |
|
749 | + <a href="' . api_get_path(WEB_CODE_PATH).'social/invitations.php"> |
|
750 | + ' . $invitationsIcon.' '.get_lang('Invitations').$total_invitations.' |
|
751 | 751 | </a> |
752 | 752 | </li>'; |
753 | 753 | |
754 | 754 | //Shared profile and groups |
755 | 755 | $active = $show == 'shared_profile' ? 'active' : null; |
756 | 756 | $links .= ' |
757 | - <li class="shared-profile-icon' . $active . '"> |
|
758 | - <a href="' . api_get_path(WEB_CODE_PATH) . 'social/profile.php"> |
|
759 | - ' . $sharedProfileIcon . ' ' . get_lang('ViewMySharedProfile') . ' |
|
757 | + <li class="shared-profile-icon' . $active.'"> |
|
758 | + <a href="' . api_get_path(WEB_CODE_PATH).'social/profile.php"> |
|
759 | + ' . $sharedProfileIcon.' '.get_lang('ViewMySharedProfile').' |
|
760 | 760 | </a> |
761 | 761 | </li>'; |
762 | 762 | $active = $show == 'friends' ? 'active' : null; |
763 | 763 | $links .= ' |
764 | - <li class="friends-icon ' . $active . '"> |
|
765 | - <a href="' . api_get_path(WEB_CODE_PATH) . 'social/friends.php"> |
|
766 | - ' . $friendsIcon . ' ' . get_lang('Friends') . ' |
|
764 | + <li class="friends-icon ' . $active.'"> |
|
765 | + <a href="' . api_get_path(WEB_CODE_PATH).'social/friends.php"> |
|
766 | + ' . $friendsIcon.' '.get_lang('Friends').' |
|
767 | 767 | </a> |
768 | 768 | </li>'; |
769 | 769 | $active = $show == 'browse_groups' ? 'active' : null; |
770 | 770 | $links .= ' |
771 | - <li class="browse-groups-icon ' . $active . '"> |
|
772 | - <a href="' . api_get_path(WEB_CODE_PATH) . 'social/groups.php"> |
|
773 | - ' . $groupsIcon . ' ' . get_lang('SocialGroups') . ' |
|
771 | + <li class="browse-groups-icon ' . $active.'"> |
|
772 | + <a href="' . api_get_path(WEB_CODE_PATH).'social/groups.php"> |
|
773 | + ' . $groupsIcon.' '.get_lang('SocialGroups').' |
|
774 | 774 | </a> |
775 | 775 | </li>'; |
776 | 776 | |
777 | 777 | //Search users |
778 | 778 | $active = $show == 'search' ? 'active' : null; |
779 | 779 | $links .= ' |
780 | - <li class="search-icon ' . $active . '"> |
|
781 | - <a href="' . api_get_path(WEB_CODE_PATH) . 'social/search.php"> |
|
782 | - ' . $searchIcon . ' ' . get_lang('Search') . ' |
|
780 | + <li class="search-icon ' . $active.'"> |
|
781 | + <a href="' . api_get_path(WEB_CODE_PATH).'social/search.php"> |
|
782 | + ' . $searchIcon.' '.get_lang('Search').' |
|
783 | 783 | </a> |
784 | 784 | </li>'; |
785 | 785 | |
@@ -787,9 +787,9 @@ discard block |
||
787 | 787 | $active = $show == 'myfiles' ? 'active' : null; |
788 | 788 | |
789 | 789 | $myFiles = ' |
790 | - <li class="myfiles-icon ' . $active . '"> |
|
791 | - <a href="' . api_get_path(WEB_CODE_PATH) . 'social/myfiles.php"> |
|
792 | - ' . $filesIcon . ' ' . get_lang('MyFiles') . ' |
|
790 | + <li class="myfiles-icon ' . $active.'"> |
|
791 | + <a href="' . api_get_path(WEB_CODE_PATH).'social/myfiles.php"> |
|
792 | + ' . $filesIcon.' '.get_lang('MyFiles').' |
|
793 | 793 | </a> |
794 | 794 | </li>'; |
795 | 795 | |
@@ -798,7 +798,7 @@ discard block |
||
798 | 798 | } |
799 | 799 | $links .= $myFiles; |
800 | 800 | |
801 | - $links .='</ul>'; |
|
801 | + $links .= '</ul>'; |
|
802 | 802 | |
803 | 803 | $html .= Display::panelCollapse( |
804 | 804 | get_lang('SocialNetwork'), |
@@ -819,57 +819,57 @@ discard block |
||
819 | 819 | } |
820 | 820 | |
821 | 821 | if ($show == 'shared_profile') { |
822 | - $links = '<ul class="nav nav-pills nav-stacked">'; |
|
822 | + $links = '<ul class="nav nav-pills nav-stacked">'; |
|
823 | 823 | // My own profile |
824 | 824 | if ($show_full_profile && $user_id == intval(api_get_user_id())) { |
825 | 825 | $links .= ' |
826 | - <li class="home-icon ' . $active . '"> |
|
827 | - <a href="' . api_get_path(WEB_CODE_PATH) . 'social/home.php"> |
|
828 | - ' . $homeIcon . ' ' . get_lang('Home') . ' |
|
826 | + <li class="home-icon ' . $active.'"> |
|
827 | + <a href="' . api_get_path(WEB_CODE_PATH).'social/home.php"> |
|
828 | + ' . $homeIcon.' '.get_lang('Home').' |
|
829 | 829 | </a> |
830 | 830 | </li> |
831 | - <li class="messages-icon ' . $active . '"> |
|
832 | - <a href="' . api_get_path(WEB_CODE_PATH) . 'messages/inbox.php?f=social"> |
|
833 | - ' . $messagesIcon . ' ' . get_lang('Messages') . $count_unread_message . ' |
|
831 | + <li class="messages-icon ' . $active.'"> |
|
832 | + <a href="' . api_get_path(WEB_CODE_PATH).'messages/inbox.php?f=social"> |
|
833 | + ' . $messagesIcon.' '.get_lang('Messages').$count_unread_message.' |
|
834 | 834 | </a> |
835 | 835 | </li>'; |
836 | 836 | $active = $show == 'invitations' ? 'active' : null; |
837 | 837 | $links .= ' |
838 | - <li class="invitations-icon' . $active . '"> |
|
839 | - <a href="' . api_get_path(WEB_CODE_PATH) . 'social/invitations.php"> |
|
840 | - ' . $invitationsIcon . ' ' . get_lang('Invitations') . $total_invitations . ' |
|
838 | + <li class="invitations-icon' . $active.'"> |
|
839 | + <a href="' . api_get_path(WEB_CODE_PATH).'social/invitations.php"> |
|
840 | + ' . $invitationsIcon.' '.get_lang('Invitations').$total_invitations.' |
|
841 | 841 | </a> |
842 | 842 | </li>'; |
843 | 843 | |
844 | 844 | $links .= ' |
845 | 845 | <li class="shared-profile-icon active"> |
846 | - <a href="' . api_get_path(WEB_CODE_PATH) . 'social/profile.php"> |
|
847 | - ' . $sharedProfileIcon . ' ' . get_lang('ViewMySharedProfile') . ' |
|
846 | + <a href="' . api_get_path(WEB_CODE_PATH).'social/profile.php"> |
|
847 | + ' . $sharedProfileIcon.' '.get_lang('ViewMySharedProfile').' |
|
848 | 848 | </a> |
849 | 849 | </li> |
850 | 850 | <li class="friends-icon"> |
851 | - <a href="' . api_get_path(WEB_CODE_PATH) . 'social/friends.php"> |
|
852 | - ' . $friendsIcon . ' ' . get_lang('Friends') . ' |
|
851 | + <a href="' . api_get_path(WEB_CODE_PATH).'social/friends.php"> |
|
852 | + ' . $friendsIcon.' '.get_lang('Friends').' |
|
853 | 853 | </a> |
854 | 854 | </li> |
855 | 855 | <li class="browse-groups-icon"> |
856 | - <a href="' . api_get_path(WEB_CODE_PATH) . 'social/groups.php"> |
|
857 | - ' . $groupsIcon . ' ' . get_lang('SocialGroups') . ' |
|
856 | + <a href="' . api_get_path(WEB_CODE_PATH).'social/groups.php"> |
|
857 | + ' . $groupsIcon.' '.get_lang('SocialGroups').' |
|
858 | 858 | </a> |
859 | 859 | </li>'; |
860 | 860 | $active = $show == 'search' ? 'active' : null; |
861 | 861 | $links .= ' |
862 | - <li class="search-icon ' . $active . '"> |
|
863 | - <a href="' . api_get_path(WEB_CODE_PATH) . 'social/search.php"> |
|
864 | - ' . $searchIcon . ' ' . get_lang('Search') . ' |
|
862 | + <li class="search-icon ' . $active.'"> |
|
863 | + <a href="' . api_get_path(WEB_CODE_PATH).'social/search.php"> |
|
864 | + ' . $searchIcon.' '.get_lang('Search').' |
|
865 | 865 | </a> |
866 | 866 | </li>'; |
867 | 867 | $active = $show == 'myfiles' ? 'active' : null; |
868 | 868 | |
869 | 869 | $myFiles = ' |
870 | - <li class="myfiles-icon ' . $active . '"> |
|
871 | - <a href="' . api_get_path(WEB_CODE_PATH) . 'social/myfiles.php"> |
|
872 | - ' . $filesIcon . ' ' . get_lang('MyFiles') . ' |
|
870 | + <li class="myfiles-icon ' . $active.'"> |
|
871 | + <a href="' . api_get_path(WEB_CODE_PATH).'social/myfiles.php"> |
|
872 | + ' . $filesIcon.' '.get_lang('MyFiles').' |
|
873 | 873 | </a> |
874 | 874 | </li>'; |
875 | 875 | |
@@ -915,7 +915,7 @@ discard block |
||
915 | 915 | $links .= '<li><a href="'.api_get_path(WEB_CODE_PATH).'social/invitations.php">'.Display::return_icon('invitation.png', get_lang('YouAlreadySentAnInvitation')).' '.get_lang('YouAlreadySentAnInvitation').'</a></li>'; |
916 | 916 | } else { |
917 | 917 | if (!$show_full_profile) { |
918 | - $links .= '<li><a class="btn-to-send-invitation" href="#" data-send-to="' . $user_id . '" title="'.get_lang('SendInvitation').'">'.Display :: return_icon('invitation.png', get_lang('SocialInvitationToFriends')).' '.get_lang('SendInvitation').'</a></li>'; |
|
918 | + $links .= '<li><a class="btn-to-send-invitation" href="#" data-send-to="'.$user_id.'" title="'.get_lang('SendInvitation').'">'.Display :: return_icon('invitation.png', get_lang('SocialInvitationToFriends')).' '.get_lang('SendInvitation').'</a></li>'; |
|
919 | 919 | } |
920 | 920 | } |
921 | 921 | |
@@ -1025,10 +1025,10 @@ discard block |
||
1025 | 1025 | foreach ($user_list as $uid) { |
1026 | 1026 | $user_info = api_get_user_info($uid, $checkIfUserOnline = true); |
1027 | 1027 | $lastname = $user_info['lastname']; |
1028 | - $firstname = $user_info['firstname']; |
|
1028 | + $firstname = $user_info['firstname']; |
|
1029 | 1029 | $completeName = $firstname.', '.$lastname; |
1030 | 1030 | |
1031 | - $user_rol = $user_info['status'] == 1 ? Display::return_icon('teacher.png',get_lang('Teacher'),null,ICON_SIZE_TINY) : Display::return_icon('user.png',get_lang('Student'),null,ICON_SIZE_TINY); |
|
1031 | + $user_rol = $user_info['status'] == 1 ? Display::return_icon('teacher.png', get_lang('Teacher'), null, ICON_SIZE_TINY) : Display::return_icon('user.png', get_lang('Student'), null, ICON_SIZE_TINY); |
|
1032 | 1032 | $status_icon_chat = null; |
1033 | 1033 | if ($user_info['user_is_online_in_chat'] == 1) { |
1034 | 1034 | $status_icon_chat = Display::return_icon('online.png', get_lang('Online')); |
@@ -1039,7 +1039,7 @@ discard block |
||
1039 | 1039 | $userPicture = $user_info['avatar']; |
1040 | 1040 | $img = '<img class="img-responsive img-circle" title="'.$completeName.'" alt="'.$completeName.'" src="'.$userPicture.'">'; |
1041 | 1041 | |
1042 | - $url = null; |
|
1042 | + $url = null; |
|
1043 | 1043 | // Anonymous users can't have access to the profile |
1044 | 1044 | if (!api_is_anonymous()) { |
1045 | 1045 | if (api_get_setting('allow_social_tool') == 'true') { |
@@ -1205,13 +1205,13 @@ discard block |
||
1205 | 1205 | case SOCIAL_CENTER_PLUGIN: |
1206 | 1206 | $social_plugins = array(1, 2); |
1207 | 1207 | if (is_array($social_plugins) && count($social_plugins) > 0) { |
1208 | - $content.= '<div id="social-plugins">'; |
|
1208 | + $content .= '<div id="social-plugins">'; |
|
1209 | 1209 | foreach ($social_plugins as $plugin) { |
1210 | - $content.= '<div class="social-plugin-item">'; |
|
1211 | - $content.= $plugin; |
|
1212 | - $content.= '</div>'; |
|
1210 | + $content .= '<div class="social-plugin-item">'; |
|
1211 | + $content .= $plugin; |
|
1212 | + $content .= '</div>'; |
|
1213 | 1213 | } |
1214 | - $content.= '</div>'; |
|
1214 | + $content .= '</div>'; |
|
1215 | 1215 | } |
1216 | 1216 | break; |
1217 | 1217 | case SOCIAL_LEFT_PLUGIN: |
@@ -1279,12 +1279,12 @@ discard block |
||
1279 | 1279 | if (!in_array($extension, $allowedTypes)) { |
1280 | 1280 | $flag = false; |
1281 | 1281 | } else { |
1282 | - $newFileName = uniqid('') . '.' . $extension; |
|
1282 | + $newFileName = uniqid('').'.'.$extension; |
|
1283 | 1283 | if (!file_exists($pathMessageAttach)) { |
1284 | 1284 | @mkdir($pathMessageAttach, api_get_permissions_for_new_directories(), true); |
1285 | 1285 | } |
1286 | 1286 | |
1287 | - $newPath = $pathMessageAttach . $newFileName; |
|
1287 | + $newPath = $pathMessageAttach.$newFileName; |
|
1288 | 1288 | if (is_uploaded_file($fileAttach['tmp_name'])) { |
1289 | 1289 | @copy($fileAttach['tmp_name'], $newPath); |
1290 | 1290 | } |
@@ -1293,9 +1293,9 @@ discard block |
||
1293 | 1293 | $medium = self::resize_picture($newPath, IMAGE_WALL_MEDIUM_SIZE); |
1294 | 1294 | |
1295 | 1295 | $big = new Image($newPath); |
1296 | - $ok = $small && $small->send_image($pathMessageAttach . IMAGE_WALL_SMALL . '_' . $newFileName) && |
|
1297 | - $medium && $medium->send_image($pathMessageAttach . IMAGE_WALL_MEDIUM .'_' . $newFileName) && |
|
1298 | - $big && $big->send_image($pathMessageAttach . IMAGE_WALL_BIG . '_' . $newFileName); |
|
1296 | + $ok = $small && $small->send_image($pathMessageAttach.IMAGE_WALL_SMALL.'_'.$newFileName) && |
|
1297 | + $medium && $medium->send_image($pathMessageAttach.IMAGE_WALL_MEDIUM.'_'.$newFileName) && |
|
1298 | + $big && $big->send_image($pathMessageAttach.IMAGE_WALL_BIG.'_'.$newFileName); |
|
1299 | 1299 | |
1300 | 1300 | // Insert |
1301 | 1301 | $newFileName = $social.$newFileName; |
@@ -1386,7 +1386,7 @@ discard block |
||
1386 | 1386 | $start = '0000-00-00'; |
1387 | 1387 | } |
1388 | 1388 | |
1389 | - $isOwnWall = (api_get_user_id() == $userId && $userId == $friendId); |
|
1389 | + $isOwnWall = (api_get_user_id() == $userId && $userId == $friendId); |
|
1390 | 1390 | $messages = self::getWallMessages($userId, MESSAGE_STATUS_WALL, $idMessage, $start, $limit, $offset); |
1391 | 1391 | $formattedList = '<div class="sub-mediapost">'; |
1392 | 1392 | $users = array(); |
@@ -1401,8 +1401,8 @@ discard block |
||
1401 | 1401 | } |
1402 | 1402 | |
1403 | 1403 | $nameComplete = api_is_western_name_order() |
1404 | - ? $users[$userIdLoop]['firstname'] .' ' . $users[$userIdLoop]['lastname'] |
|
1405 | - : $users[$userIdLoop]['lastname'] . ' ' . $users[$userIdLoop]['firstname']; |
|
1404 | + ? $users[$userIdLoop]['firstname'].' '.$users[$userIdLoop]['lastname'] |
|
1405 | + : $users[$userIdLoop]['lastname'].' '.$users[$userIdLoop]['firstname']; |
|
1406 | 1406 | $url = api_get_path(WEB_CODE_PATH).'social/profile.php?u='.$userIdLoop; |
1407 | 1407 | $media = ''; |
1408 | 1408 | $media .= '<div class="rep-post">'; |
@@ -1413,11 +1413,11 @@ discard block |
||
1413 | 1413 | $media .= '</div>'; |
1414 | 1414 | } |
1415 | 1415 | $media .= '<div class="user-image">'; |
1416 | - $media .= '<a href="'.$url.'" ><img src="'. $users[$userIdLoop]['avatar'] . |
|
1416 | + $media .= '<a href="'.$url.'" ><img src="'.$users[$userIdLoop]['avatar']. |
|
1417 | 1417 | '" alt="'.$users[$userIdLoop]['complete_name'].'" class="avatar-thumb"></a>'; |
1418 | 1418 | $media .= '</div>'; |
1419 | 1419 | $media .= '<div class="user-data">'; |
1420 | - $media .= '<div class="username">' . '<a href="'.$url.'">'.$nameComplete.'</a></div>'; |
|
1420 | + $media .= '<div class="username">'.'<a href="'.$url.'">'.$nameComplete.'</a></div>'; |
|
1421 | 1421 | $media .= '<div class="time timeago" title="'.$date.'">'.$date.'</div>'; |
1422 | 1422 | $media .= '</div>'; |
1423 | 1423 | $media .= '<div class="msg-content">'; |
@@ -1452,12 +1452,12 @@ discard block |
||
1452 | 1452 | * @param int $offset Wall messages offset |
1453 | 1453 | * @return array $data return user's starting wall messages along with message extra data |
1454 | 1454 | */ |
1455 | - public static function getWallMessagesPostHTML($userId, $friendId = 0, $start = null, $limit = 10, $offset= 0) |
|
1455 | + public static function getWallMessagesPostHTML($userId, $friendId = 0, $start = null, $limit = 10, $offset = 0) |
|
1456 | 1456 | { |
1457 | 1457 | if (empty($start)) { |
1458 | 1458 | $start = '0000-00-00'; |
1459 | 1459 | } |
1460 | - $isOwnWall = (api_get_user_id() == $userId && $userId == $friendId); |
|
1460 | + $isOwnWall = (api_get_user_id() == $userId && $userId == $friendId); |
|
1461 | 1461 | $messages = self::getWallMessages($userId, MESSAGE_STATUS_WALL_POST, null, $start, $limit, $offset); |
1462 | 1462 | $users = array(); |
1463 | 1463 | $data = array(); |
@@ -1516,7 +1516,7 @@ discard block |
||
1516 | 1516 | |
1517 | 1517 | $htmlReceiver = ''; |
1518 | 1518 | if ($authorId != $receiverId) { |
1519 | - $htmlReceiver = ' > <a href="'.$urlReceiver.'">' . $nameCompleteReceiver . '</a> '; |
|
1519 | + $htmlReceiver = ' > <a href="'.$urlReceiver.'">'.$nameCompleteReceiver.'</a> '; |
|
1520 | 1520 | } |
1521 | 1521 | |
1522 | 1522 | $wallImage = ''; |
@@ -1551,7 +1551,7 @@ discard block |
||
1551 | 1551 | $html .= '<div class="img-post">'; |
1552 | 1552 | $html .= $wallImage; |
1553 | 1553 | $html .= '</div>'; |
1554 | - $html .= '<p>'. Security::remove_XSS($message['content']).'</p>'; |
|
1554 | + $html .= '<p>'.Security::remove_XSS($message['content']).'</p>'; |
|
1555 | 1555 | $html .= '</div>'; |
1556 | 1556 | $html .= '</div>'; // end mediaPost |
1557 | 1557 | |
@@ -1574,11 +1574,11 @@ discard block |
||
1574 | 1574 | $domain = empty($url) ? parse_url($link) : parse_url($url); |
1575 | 1575 | $domain = $domain['scheme'].'://'.$domain['host']; |
1576 | 1576 | // Trick to verify if the Image Url Exist because of some bad metatag dev |
1577 | - if (self::verifyUrl($image) == false){ |
|
1578 | - if (!($image[0] == '/')){ |
|
1579 | - $domain = $domain . '/'; |
|
1577 | + if (self::verifyUrl($image) == false) { |
|
1578 | + if (!($image[0] == '/')) { |
|
1579 | + $domain = $domain.'/'; |
|
1580 | 1580 | } |
1581 | - $image = $domain . $image; |
|
1581 | + $image = $domain.$image; |
|
1582 | 1582 | } |
1583 | 1583 | $title = $graph->title; |
1584 | 1584 | |
@@ -1630,16 +1630,16 @@ discard block |
||
1630 | 1630 | if (isset($array[2]) && !empty($array[2])) { |
1631 | 1631 | |
1632 | 1632 | if ($size == IMAGE_WALL_SMALL) { |
1633 | - $name = IMAGE_WALL_SMALL. '_' . $array[2]; |
|
1634 | - }else if($size == IMAGE_WALL_MEDIUM){ |
|
1635 | - $name = IMAGE_WALL_MEDIUM. '_' . $array[2]; |
|
1636 | - }else if($size == IMAGE_WALL_BIG){ |
|
1637 | - $name = IMAGE_WALL_BIG. '_' . $array[2]; |
|
1638 | - }else { |
|
1639 | - $name = IMAGE_WALL_SMALL. '_' . $array[2]; |
|
1633 | + $name = IMAGE_WALL_SMALL.'_'.$array[2]; |
|
1634 | + } else if ($size == IMAGE_WALL_MEDIUM) { |
|
1635 | + $name = IMAGE_WALL_MEDIUM.'_'.$array[2]; |
|
1636 | + } else if ($size == IMAGE_WALL_BIG) { |
|
1637 | + $name = IMAGE_WALL_BIG.'_'.$array[2]; |
|
1638 | + } else { |
|
1639 | + $name = IMAGE_WALL_SMALL.'_'.$array[2]; |
|
1640 | 1640 | } |
1641 | 1641 | $lessImage = str_replace($array[2], '', $path); |
1642 | - $name = $lessImage . $name; |
|
1642 | + $name = $lessImage.$name; |
|
1643 | 1643 | } |
1644 | 1644 | |
1645 | 1645 | return $name; |
@@ -1747,18 +1747,18 @@ discard block |
||
1747 | 1747 | if ($number_friends != 0) { |
1748 | 1748 | if ($number_friends > $number_of_images) { |
1749 | 1749 | if (api_get_user_id() == $user_id) { |
1750 | - $friendHtml.= ' <span><a href="friends.php">'.get_lang('SeeAll').'</a></span>'; |
|
1750 | + $friendHtml .= ' <span><a href="friends.php">'.get_lang('SeeAll').'</a></span>'; |
|
1751 | 1751 | } else { |
1752 | - $friendHtml.= ' <span>' |
|
1752 | + $friendHtml .= ' <span>' |
|
1753 | 1753 | .'<a href="'.api_get_path(WEB_CODE_PATH).'social/profile_friends_and_groups.inc.php' |
1754 | 1754 | .'?view=friends&height=390&width=610&user_id='.$user_id.'"' |
1755 | 1755 | .'class="ajax" data-title="'.get_lang('SeeAll').'" title="'.get_lang('SeeAll').'" >'.get_lang('SeeAll').'</a></span>'; |
1756 | 1756 | } |
1757 | 1757 | } |
1758 | 1758 | |
1759 | - $friendHtml.= '<ul class="nav nav-list">'; |
|
1759 | + $friendHtml .= '<ul class="nav nav-list">'; |
|
1760 | 1760 | $j = 1; |
1761 | - for ($k=0; $k < $number_friends; $k++) { |
|
1761 | + for ($k = 0; $k < $number_friends; $k++) { |
|
1762 | 1762 | if ($j > $number_of_images) break; |
1763 | 1763 | |
1764 | 1764 | if (isset($friends[$k])) { |
@@ -1772,26 +1772,26 @@ discard block |
||
1772 | 1772 | $statusIcon = Display::span('', array('class' => 'offline_user_in_text')); |
1773 | 1773 | } |
1774 | 1774 | |
1775 | - $friendHtml.= '<li>'; |
|
1776 | - $friendHtml.= '<div>'; |
|
1775 | + $friendHtml .= '<li>'; |
|
1776 | + $friendHtml .= '<div>'; |
|
1777 | 1777 | |
1778 | 1778 | // the height = 92 must be the same in the image_friend_network span style in default.css |
1779 | 1779 | $friends_profile = UserManager::getUserPicture($friend['friend_user_id'], USER_IMAGE_SIZE_SMALL); |
1780 | - $friendHtml.= '<img src="'.$friends_profile.'" id="imgfriend_'.$friend['friend_user_id'].'" title="'.$name_user.'"/>'; |
|
1780 | + $friendHtml .= '<img src="'.$friends_profile.'" id="imgfriend_'.$friend['friend_user_id'].'" title="'.$name_user.'"/>'; |
|
1781 | 1781 | $link_shared = (empty($link_shared)) ? '' : '&'.$link_shared; |
1782 | - $friendHtml.= $statusIcon .'<a href="profile.php?' .'u=' . $friend['friend_user_id'] . $link_shared . '">' . $name_user .'</a>'; |
|
1783 | - $friendHtml.= '</div>'; |
|
1784 | - $friendHtml.= '</li>'; |
|
1782 | + $friendHtml .= $statusIcon.'<a href="profile.php?'.'u='.$friend['friend_user_id'].$link_shared.'">'.$name_user.'</a>'; |
|
1783 | + $friendHtml .= '</div>'; |
|
1784 | + $friendHtml .= '</li>'; |
|
1785 | 1785 | } |
1786 | 1786 | $j++; |
1787 | 1787 | } |
1788 | - $friendHtml.='</ul>'; |
|
1788 | + $friendHtml .= '</ul>'; |
|
1789 | 1789 | } else { |
1790 | - $friendHtml.= '<div class="">'.get_lang('NoFriendsInYourContactList').'<br />' |
|
1791 | - .'<a class="btn btn-primary" href="'.api_get_path(WEB_PATH).'whoisonline.php"><em class="fa fa-search"></em> '. get_lang('TryAndFindSomeFriends').'</a></div>'; |
|
1790 | + $friendHtml .= '<div class="">'.get_lang('NoFriendsInYourContactList').'<br />' |
|
1791 | + .'<a class="btn btn-primary" href="'.api_get_path(WEB_PATH).'whoisonline.php"><em class="fa fa-search"></em> '.get_lang('TryAndFindSomeFriends').'</a></div>'; |
|
1792 | 1792 | } |
1793 | 1793 | |
1794 | - $friendHtml = Display::panel($friendHtml, get_lang('SocialFriend').' (' . $number_friends . ')' ); |
|
1794 | + $friendHtml = Display::panel($friendHtml, get_lang('SocialFriend').' ('.$number_friends.')'); |
|
1795 | 1795 | |
1796 | 1796 | return $friendHtml; |
1797 | 1797 | } |
@@ -1812,9 +1812,9 @@ discard block |
||
1812 | 1812 | |
1813 | 1813 | if ($number_friends != 0) { |
1814 | 1814 | |
1815 | - $friendHtml.= '<div class="list-group">'; |
|
1815 | + $friendHtml .= '<div class="list-group">'; |
|
1816 | 1816 | $j = 1; |
1817 | - for ($k=0; $k < $number_friends; $k++) { |
|
1817 | + for ($k = 0; $k < $number_friends; $k++) { |
|
1818 | 1818 | if ($j > $number_of_images) break; |
1819 | 1819 | |
1820 | 1820 | if (isset($friends[$k])) { |
@@ -1823,11 +1823,11 @@ discard block |
||
1823 | 1823 | $user_info_friend = api_get_user_info($friend['friend_user_id'], true); |
1824 | 1824 | |
1825 | 1825 | if ($user_info_friend['user_is_online']) { |
1826 | - $statusIcon = Display::return_icon('statusonline.png',get_lang('Online')); |
|
1827 | - $status=1; |
|
1826 | + $statusIcon = Display::return_icon('statusonline.png', get_lang('Online')); |
|
1827 | + $status = 1; |
|
1828 | 1828 | } else { |
1829 | - $statusIcon = Display::return_icon('statusoffline.png',get_lang('Offline')); |
|
1830 | - $status=0; |
|
1829 | + $statusIcon = Display::return_icon('statusoffline.png', get_lang('Offline')); |
|
1830 | + $status = 0; |
|
1831 | 1831 | } |
1832 | 1832 | |
1833 | 1833 | $friendAvatarMedium = UserManager::getUserPicture($friend['friend_user_id'], USER_IMAGE_SIZE_MEDIUM); |
@@ -1836,24 +1836,24 @@ discard block |
||
1836 | 1836 | $showLinkToChat = api_is_global_chat_enabled() && |
1837 | 1837 | $friend['friend_user_id'] != api_get_user_id(); |
1838 | 1838 | |
1839 | - if ($showLinkToChat){ |
|
1839 | + if ($showLinkToChat) { |
|
1840 | 1840 | $friendHtml .= '<a onclick="javascript:chatWith(\''.$friend['friend_user_id'].'\', \''.$name_user.'\', \''.$status.'\',\''.$friendAvatarSmall.'\')" href="javascript:void(0);" class="list-group-item">'; |
1841 | - $friendHtml .= $friend_avatar.' <span class="username">' . $name_user . '</span>'; |
|
1842 | - $friendHtml .= '<span class="status">' . $statusIcon . '</span>'; |
|
1841 | + $friendHtml .= $friend_avatar.' <span class="username">'.$name_user.'</span>'; |
|
1842 | + $friendHtml .= '<span class="status">'.$statusIcon.'</span>'; |
|
1843 | 1843 | } else { |
1844 | 1844 | $link_shared = (empty($link_shared)) ? '' : '&'.$link_shared; |
1845 | - $friendHtml .= '<a href="profile.php?' .'u=' . $friend['friend_user_id'] . $link_shared . '" class="list-group-item">'; |
|
1846 | - $friendHtml .= $friend_avatar.' <span class="username-all">' . $name_user . '</span>'; |
|
1845 | + $friendHtml .= '<a href="profile.php?'.'u='.$friend['friend_user_id'].$link_shared.'" class="list-group-item">'; |
|
1846 | + $friendHtml .= $friend_avatar.' <span class="username-all">'.$name_user.'</span>'; |
|
1847 | 1847 | } |
1848 | 1848 | |
1849 | 1849 | $friendHtml .= '</a>'; |
1850 | 1850 | } |
1851 | 1851 | $j++; |
1852 | 1852 | } |
1853 | - $friendHtml.='</div>'; |
|
1853 | + $friendHtml .= '</div>'; |
|
1854 | 1854 | } else { |
1855 | - $friendHtml.= '<div class="help">'.get_lang('NoFriendsInYourContactList').' ' |
|
1856 | - .'<a href="'.api_get_path(WEB_PATH).'whoisonline.php"><em class="fa fa-search"></em> '. get_lang('TryAndFindSomeFriends').'</a></div>'; |
|
1855 | + $friendHtml .= '<div class="help">'.get_lang('NoFriendsInYourContactList').' ' |
|
1856 | + .'<a href="'.api_get_path(WEB_PATH).'whoisonline.php"><em class="fa fa-search"></em> '.get_lang('TryAndFindSomeFriends').'</a></div>'; |
|
1857 | 1857 | } |
1858 | 1858 | |
1859 | 1859 | return $friendHtml; |
@@ -1871,7 +1871,7 @@ discard block |
||
1871 | 1871 | 'post', |
1872 | 1872 | api_get_path(WEB_CODE_PATH).'social/profile.php'.$userId, |
1873 | 1873 | null, |
1874 | - array('enctype' => 'multipart/form-data') , |
|
1874 | + array('enctype' => 'multipart/form-data'), |
|
1875 | 1875 | FormValidator::LAYOUT_HORIZONTAL |
1876 | 1876 | ); |
1877 | 1877 |