@@ -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 |
@@ -734,7 +734,7 @@ discard block |
||
734 | 734 | { |
735 | 735 | $skill_rel_skill = new SkillRelSkill(); |
736 | 736 | $skills = $skill_rel_skill->get_direct_parents($skill_id, true); |
737 | - foreach($skills as &$skill) { |
|
737 | + foreach ($skills as &$skill) { |
|
738 | 738 | $skill['data'] = self::get($skill['skill_id']); |
739 | 739 | $skill_info2 = $skill_rel_skill->get_skill_info($skill['skill_id']); |
740 | 740 | $skill['data']['parent_id'] = $skill_info2['parent_id']; |
@@ -772,7 +772,7 @@ discard block |
||
772 | 772 | $attributes = array( |
773 | 773 | 'skill_id' => $skill_id, |
774 | 774 | 'parent_id' => $parent_id, |
775 | - 'relation_type' => (isset($params['relation_type'])?$params['relation_type']:0), |
|
775 | + 'relation_type' => (isset($params['relation_type']) ? $params['relation_type'] : 0), |
|
776 | 776 | //'level' => $params['level'], |
777 | 777 | ); |
778 | 778 | $skill_rel_skill->save($attributes); |
@@ -969,8 +969,8 @@ discard block |
||
969 | 969 | // 2nd node |
970 | 970 | $skills[$skill_id] = $skill_info; |
971 | 971 | // Uncomment code below to hide the searched skill |
972 | - $skills[$skill_id]['data']['parent_id'] = $skill_info['extra']['parent_id']; |
|
973 | - $skills[$skill_id]['parent_id'] = 1; |
|
972 | + $skills[$skill_id]['data']['parent_id'] = $skill_info['extra']['parent_id']; |
|
973 | + $skills[$skill_id]['parent_id'] = 1; |
|
974 | 974 | } |
975 | 975 | } |
976 | 976 | } |
@@ -1033,7 +1033,7 @@ discard block |
||
1033 | 1033 | $skill['data']['skill_has_gradebook'] = true; |
1034 | 1034 | } |
1035 | 1035 | $refs[$skill['id']] = &$skill; |
1036 | - $flat_array[$skill['id']] = &$skill; |
|
1036 | + $flat_array[$skill['id']] = &$skill; |
|
1037 | 1037 | } |
1038 | 1038 | |
1039 | 1039 | // Checking family value |
@@ -1054,7 +1054,7 @@ discard block |
||
1054 | 1054 | $refs['root']['children'][0] = $skills[1]; |
1055 | 1055 | $skills[$skill_id]['data']['family_id'] = 1; |
1056 | 1056 | $refs['root']['children'][0]['children'][0] = $skills[$skill_id]; |
1057 | - $flat_array[$skill_id] = $skills[$skill_id]; |
|
1057 | + $flat_array[$skill_id] = $skills[$skill_id]; |
|
1058 | 1058 | } else { |
1059 | 1059 | // Moving node to the children index of their parents |
1060 | 1060 | |
@@ -1063,7 +1063,7 @@ discard block |
||
1063 | 1063 | $skill['data']['family_id'] = $new_family_array[$skill['id']]; |
1064 | 1064 | } |
1065 | 1065 | $refs[$skill['parent_id']]['children'][] = &$skill; |
1066 | - $flat_array[$my_skill_id] = $skill; |
|
1066 | + $flat_array[$my_skill_id] = $skill; |
|
1067 | 1067 | } |
1068 | 1068 | } |
1069 | 1069 | |
@@ -1161,7 +1161,7 @@ discard block |
||
1161 | 1161 | INNER JOIN {$this->table_skill_rel_user} su |
1162 | 1162 | ON (s.id = su.skill_id) |
1163 | 1163 | WHERE user_id = $user_id"; |
1164 | - $result = Database::query($sql); |
|
1164 | + $result = Database::query($sql); |
|
1165 | 1165 | if (Database::num_rows($result)) { |
1166 | 1166 | $result = Database::fetch_row($result); |
1167 | 1167 | return $result[0]; |
@@ -1203,7 +1203,7 @@ discard block |
||
1203 | 1203 | */ |
1204 | 1204 | public function get_user_list_skill_ranking_count() |
1205 | 1205 | { |
1206 | - $sql = "SELECT count(*) FROM ( |
|
1206 | + $sql = "SELECT count(*) FROM ( |
|
1207 | 1207 | SELECT count(distinct 1) |
1208 | 1208 | FROM {$this->table} s |
1209 | 1209 | INNER JOIN {$this->table_skill_rel_user} su |
@@ -1256,7 +1256,7 @@ discard block |
||
1256 | 1256 | ON c.code = g.course_code |
1257 | 1257 | WHERE sg.skill_id = $skill_id |
1258 | 1258 | AND (g.session_id IS NULL OR g.session_id = 0)"; |
1259 | - $result = Database::query($sql); |
|
1259 | + $result = Database::query($sql); |
|
1260 | 1260 | |
1261 | 1261 | return Database::store_result($result, 'ASSOC'); |
1262 | 1262 | } |
@@ -1443,7 +1443,7 @@ discard block |
||
1443 | 1443 | WHERE sg.skill_id = $skillId |
1444 | 1444 | AND g.session_id > 0"; |
1445 | 1445 | |
1446 | - $result = Database::query($sql); |
|
1446 | + $result = Database::query($sql); |
|
1447 | 1447 | |
1448 | 1448 | return Database::store_result($result, 'ASSOC'); |
1449 | 1449 | } |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | */ |
7 | 7 | |
8 | 8 | require_once 'xapian.php'; |
9 | -require_once dirname(__FILE__) . '/../IndexableChunk.class.php'; |
|
9 | +require_once dirname(__FILE__).'/../IndexableChunk.class.php'; |
|
10 | 10 | |
11 | 11 | /** |
12 | 12 | * Abstract helper class |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | if (!empty($chunk->terms)) { |
131 | 131 | foreach ($chunk->terms as $term) { |
132 | 132 | /* FIXME: think of getting weight */ |
133 | - $doc->add_term($term['flag'] . $term['name'], 1); |
|
133 | + $doc->add_term($term['flag'].$term['name'], 1); |
|
134 | 134 | } |
135 | 135 | } |
136 | 136 | |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | $doc->clear_terms(); |
216 | 216 | foreach ($terms as $term) { |
217 | 217 | //add directly |
218 | - $doc->add_term($prefix . $term, 1); |
|
218 | + $doc->add_term($prefix.$term, 1); |
|
219 | 219 | } |
220 | 220 | $this->db->replace_document($did, $doc); |
221 | 221 | $this->db->flush(); |
@@ -8,11 +8,11 @@ discard block |
||
8 | 8 | * Code |
9 | 9 | */ |
10 | 10 | require_once 'xapian.php'; |
11 | -require_once dirname(__FILE__) . '/../IndexableChunk.class.php'; |
|
11 | +require_once dirname(__FILE__).'/../IndexableChunk.class.php'; |
|
12 | 12 | //TODO: think another way without including specific fields here |
13 | -require_once api_get_path(LIBRARY_PATH) . 'specific_fields_manager.lib.php'; |
|
13 | +require_once api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php'; |
|
14 | 14 | |
15 | -define('XAPIAN_DB', api_get_path(SYS_UPLOAD_PATH) . 'plugins/xapian/searchdb/'); |
|
15 | +define('XAPIAN_DB', api_get_path(SYS_UPLOAD_PATH).'plugins/xapian/searchdb/'); |
|
16 | 16 | |
17 | 17 | /** |
18 | 18 | * Queries the database. |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | |
96 | 96 | // process each specific field prefix |
97 | 97 | foreach ($specific_fields as $specific_field) { |
98 | - $results[$count]['sf-' . $specific_field['code']] = xapian_get_doc_terms($document, $specific_field['code']); |
|
98 | + $results[$count]['sf-'.$specific_field['code']] = xapian_get_doc_terms($document, $specific_field['code']); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | // rest of data |
@@ -261,6 +261,6 @@ discard block |
||
261 | 261 | } else { |
262 | 262 | $message_error = get_lang('SearchOtherXapianError'); |
263 | 263 | } |
264 | - $display_message = get_lang('Error') . ' : ' . $message_error; |
|
264 | + $display_message = get_lang('Error').' : '.$message_error; |
|
265 | 265 | Display::display_error_message($display_message); |
266 | 266 | } |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | /** |
8 | 8 | * code |
9 | 9 | */ |
10 | -require_once dirname(__FILE__) . '/../../global.inc.php'; |
|
10 | +require_once dirname(__FILE__).'/../../global.inc.php'; |
|
11 | 11 | include_once 'xapian/XapianIndexer.class.php'; |
12 | 12 | |
13 | 13 | /** |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | if ((count(array_diff($terms, $stored_terms)) == 0) && (count(array_diff($stored_terms, $terms)) == 0)) |
40 | 40 | return FALSE; |
41 | 41 | |
42 | - require_once api_get_path(LIBRARY_PATH) . 'search/xapian/XapianQuery.php'; |
|
42 | + require_once api_get_path(LIBRARY_PATH).'search/xapian/XapianQuery.php'; |
|
43 | 43 | |
44 | 44 | // compare terms |
45 | 45 | $doc = $this->get_document($search_did); |
@@ -55,10 +55,10 @@ discard block |
||
55 | 55 | |
56 | 56 | // save it to search engine |
57 | 57 | foreach ($missing_terms as $term) { |
58 | - $this->add_term_to_doc($prefix . $term, $doc); |
|
58 | + $this->add_term_to_doc($prefix.$term, $doc); |
|
59 | 59 | } |
60 | 60 | foreach ($deprecated_terms as $term) { |
61 | - $this->remove_term_from_doc($prefix . $term, $doc); |
|
61 | + $this->remove_term_from_doc($prefix.$term, $doc); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | // don't do anything if no change |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | * @return array Array of terms |
75 | 75 | */ |
76 | 76 | function get_terms_on_db($prefix, $course_code, $tool_id, $ref_id) { |
77 | - require_once api_get_path(LIBRARY_PATH) . 'specific_fields_manager.lib.php'; |
|
77 | + require_once api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php'; |
|
78 | 78 | $terms = get_specific_field_values_list_by_prefix($prefix, $course_code, $tool_id, $ref_id); |
79 | 79 | $prefix_terms = array(); |
80 | 80 | foreach ($terms as $term) { |
@@ -18,12 +18,12 @@ discard block |
||
18 | 18 | * @param array extra Extra queries to join with. Optional |
19 | 19 | * @return array |
20 | 20 | */ |
21 | -function chamilo_query_query($query_string, $offset=0, $length=10, $extra=NULL) { |
|
21 | +function chamilo_query_query($query_string, $offset = 0, $length = 10, $extra = NULL) { |
|
22 | 22 | list($count, $results) = xapian_query($query_string, NULL, $offset, $length, $extra); |
23 | 23 | return chamilo_preprocess_results($results); |
24 | 24 | } |
25 | 25 | |
26 | -function chamilo_query_simple_query($query_string, $offset=0, $length=10, $extra=NULL) { |
|
26 | +function chamilo_query_simple_query($query_string, $offset = 0, $length = 10, $extra = NULL) { |
|
27 | 27 | return xapian_query($query_string, NULL, $offset, $length, $extra); |
28 | 28 | } |
29 | 29 | |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | function chamilo_preprocess_results($results) { |
43 | 43 | // group by toolid |
44 | 44 | $results_by_tool = array(); |
45 | - if (count($results)>0) { |
|
45 | + if (count($results) > 0) { |
|
46 | 46 | |
47 | 47 | foreach ($results as $key => $row) { |
48 | 48 | $results_by_tool[$row['toolid']][] = $row; |
@@ -50,8 +50,8 @@ discard block |
||
50 | 50 | |
51 | 51 | $processed_results = array(); |
52 | 52 | foreach ($results_by_tool as $toolid => $rows) { |
53 | - $tool_processor_class = $toolid .'_processor'; |
|
54 | - $tool_processor_path = api_get_path(LIBRARY_PATH) .'search/tool_processors/'. $tool_processor_class .'.class.php'; |
|
53 | + $tool_processor_class = $toolid.'_processor'; |
|
54 | + $tool_processor_path = api_get_path(LIBRARY_PATH).'search/tool_processors/'.$tool_processor_class.'.class.php'; |
|
55 | 55 | if (file_exists($tool_processor_path)) { |
56 | 56 | require_once($tool_processor_path); |
57 | 57 | $tool_processor = new $tool_processor_class($rows); |
@@ -71,6 +71,6 @@ discard block |
||
71 | 71 | * @param string $op |
72 | 72 | * @return XapianQuery query joined |
73 | 73 | */ |
74 | -function chamilo_join_queries($query1, $query2=NULL, $op='or') { |
|
74 | +function chamilo_join_queries($query1, $query2 = NULL, $op = 'or') { |
|
75 | 75 | return xapian_join_queries($query1, $query2, $op); |
76 | 76 | } |
@@ -17,8 +17,8 @@ discard block |
||
17 | 17 | return; |
18 | 18 | } |
19 | 19 | |
20 | -require_once dirname(__FILE__) . '../../../global.inc.php'; |
|
21 | -require_once api_get_path(LIBRARY_PATH) . 'search/ChamiloQuery.php'; |
|
20 | +require_once dirname(__FILE__).'../../../global.inc.php'; |
|
21 | +require_once api_get_path(LIBRARY_PATH).'search/ChamiloQuery.php'; |
|
22 | 22 | |
23 | 23 | /** |
24 | 24 | * search with filter and build base array avoding repeated terms |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | if (is_array($dkterms) && is_array($dkterms[1])) { |
34 | 34 | foreach ($specific_fields as $specific_field) { |
35 | 35 | foreach ($dkterms[1] as $obj) { |
36 | - foreach ($obj['sf-' . $specific_field['code']] as $raw_term) { |
|
36 | + foreach ($obj['sf-'.$specific_field['code']] as $raw_term) { |
|
37 | 37 | if (count($raw_term['name']) > 1) { |
38 | 38 | $normal_term = substr($raw_term['name'], 1); |
39 | 39 | $sf_terms[$specific_field['code']][$normal_term] = $normal_term; |
@@ -54,10 +54,10 @@ discard block |
||
54 | 54 | |
55 | 55 | if (($cid = api_get_course_id()) != -1) { // with cid |
56 | 56 | // course filter |
57 | - $filter[] = chamilo_get_boolean_query(XAPIAN_PREFIX_COURSEID . $cid); |
|
57 | + $filter[] = chamilo_get_boolean_query(XAPIAN_PREFIX_COURSEID.$cid); |
|
58 | 58 | // term filter |
59 | 59 | if ($term != '__all__') { |
60 | - $filter[] = chamilo_get_boolean_query($prefix . $term); |
|
60 | + $filter[] = chamilo_get_boolean_query($prefix.$term); |
|
61 | 61 | // always and between term and courseid |
62 | 62 | $filter = chamilo_join_queries($filter, null, 'and'); |
63 | 63 | } |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | $sf_terms = get_usual_sf_terms($filter, $specific_fields); |
66 | 66 | } else { // without cid |
67 | 67 | if ($term != '__all__') { |
68 | - $filter[] = chamilo_get_boolean_query($prefix . $term); |
|
68 | + $filter[] = chamilo_get_boolean_query($prefix.$term); |
|
69 | 69 | |
70 | 70 | $sf_terms = get_usual_sf_terms($filter, $specific_fields); |
71 | 71 | } else { // no cid and all/any terms |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | foreach (array_keys($this->_chunks[$type]) as $typekey) { |
52 | 52 | list($key, $data) = explode("\0", $this->_chunks[$type][$typekey]); |
53 | 53 | if (strcmp($key, $check) == 0) { |
54 | - echo 'Key "' . $check . '" already exists in "' . $type . '" chunk.'; |
|
54 | + echo 'Key "'.$check.'" already exists in "'.$type.'" chunk.'; |
|
55 | 55 | return false; |
56 | 56 | } |
57 | 57 | } |
@@ -70,11 +70,11 @@ discard block |
||
70 | 70 | */ |
71 | 71 | public function addChunk($chunkType, $key, $value) { |
72 | 72 | |
73 | - $chunkData = $key . "\0" . $value; |
|
74 | - $crc = pack("N", crc32($chunkType . $chunkData)); |
|
73 | + $chunkData = $key."\0".$value; |
|
74 | + $crc = pack("N", crc32($chunkType.$chunkData)); |
|
75 | 75 | $len = pack("N", strlen($chunkData)); |
76 | 76 | |
77 | - $newChunk = $len . $chunkType . $chunkData . $crc; |
|
77 | + $newChunk = $len.$chunkType.$chunkData.$crc; |
|
78 | 78 | $result = substr($this->_contents, 0, $this->_size - 12) |
79 | 79 | . $newChunk |
80 | 80 | . substr($this->_contents, $this->_size - 12, 12); |
@@ -92,30 +92,30 @@ discard block |
||
92 | 92 | */ |
93 | 93 | public function removeChunks($chunkType, $key, $png) { |
94 | 94 | // Read the magic bytes and verify |
95 | - $retval = substr($png,0,8); |
|
95 | + $retval = substr($png, 0, 8); |
|
96 | 96 | $ipos = 8; |
97 | 97 | if ($retval != "\x89PNG\x0d\x0a\x1a\x0a") |
98 | 98 | throw new Exception('Is not a valid PNG image'); |
99 | 99 | // Loop through the chunks. Byte 0-3 is length, Byte 4-7 is type |
100 | - $chunkHeader = substr($png,$ipos,8); |
|
100 | + $chunkHeader = substr($png, $ipos, 8); |
|
101 | 101 | $ipos = $ipos + 8; |
102 | 102 | while ($chunkHeader) { |
103 | 103 | // Extract length and type from binary data |
104 | 104 | $chunk = @unpack('Nsize/a4type', $chunkHeader); |
105 | 105 | $skip = false; |
106 | - if ( $chunk['type'] == $chunkType ) { |
|
107 | - $data = substr($png,$ipos,$chunk['size']); |
|
106 | + if ($chunk['type'] == $chunkType) { |
|
107 | + $data = substr($png, $ipos, $chunk['size']); |
|
108 | 108 | $sections = explode("\0", $data); |
109 | 109 | print_r($sections); |
110 | - if ( $sections[0] == $key ) $skip = true; |
|
110 | + if ($sections[0] == $key) $skip = true; |
|
111 | 111 | } |
112 | 112 | // Extract the data and the CRC |
113 | - $data = substr($png,$ipos,$chunk['size']+4); |
|
113 | + $data = substr($png, $ipos, $chunk['size'] + 4); |
|
114 | 114 | $ipos = $ipos + $chunk['size'] + 4; |
115 | 115 | // Add in the header, data, and CRC |
116 | - if ( ! $skip ) $retval = $retval . $chunkHeader . $data; |
|
116 | + if (!$skip) $retval = $retval.$chunkHeader.$data; |
|
117 | 117 | // Read next chunk header |
118 | - $chunkHeader = substr($png,$ipos,8); |
|
118 | + $chunkHeader = substr($png, $ipos, 8); |
|
119 | 119 | $ipos = $ipos + 8; |
120 | 120 | } |
121 | 121 | return $retval; |
@@ -131,34 +131,34 @@ discard block |
||
131 | 131 | * If there is PNG information that matches the key an array is returned |
132 | 132 | * |
133 | 133 | */ |
134 | - public function extractBadgeInfo($png, $key='openbadges') { |
|
134 | + public function extractBadgeInfo($png, $key = 'openbadges') { |
|
135 | 135 | // Read the magic bytes and verify |
136 | - $retval = substr($png,0,8); |
|
136 | + $retval = substr($png, 0, 8); |
|
137 | 137 | $ipos = 8; |
138 | 138 | if ($retval != "\x89PNG\x0d\x0a\x1a\x0a") { |
139 | 139 | return false; |
140 | 140 | } |
141 | 141 | |
142 | 142 | // Loop through the chunks. Byte 0-3 is length, Byte 4-7 is type |
143 | - $chunkHeader = substr($png,$ipos,8); |
|
143 | + $chunkHeader = substr($png, $ipos, 8); |
|
144 | 144 | $ipos = $ipos + 8; |
145 | 145 | while ($chunkHeader) { |
146 | 146 | // Extract length and type from binary data |
147 | 147 | $chunk = @unpack('Nsize/a4type', $chunkHeader); |
148 | 148 | $skip = false; |
149 | 149 | if ($chunk['type'] == 'tEXt') { |
150 | - $data = substr($png,$ipos,$chunk['size']); |
|
150 | + $data = substr($png, $ipos, $chunk['size']); |
|
151 | 151 | $sections = explode("\0", $data); |
152 | 152 | if ($sections[0] == $key) { |
153 | 153 | return $sections; |
154 | 154 | } |
155 | 155 | } |
156 | 156 | // Extract the data and the CRC |
157 | - $data = substr($png,$ipos,$chunk['size']+4); |
|
157 | + $data = substr($png, $ipos, $chunk['size'] + 4); |
|
158 | 158 | $ipos = $ipos + $chunk['size'] + 4; |
159 | 159 | |
160 | 160 | // Read next chunk header |
161 | - $chunkHeader = substr($png,$ipos,8); |
|
161 | + $chunkHeader = substr($png, $ipos, 8); |
|
162 | 162 | $ipos = $ipos + 8; |
163 | 163 | } |
164 | 164 | } |
@@ -41,9 +41,9 @@ |
||
41 | 41 | */ |
42 | 42 | function _createElements() |
43 | 43 | { |
44 | - $this->_elements[] = new HTML_QuickForm_Radio('receivers', '', get_lang('Everybody'), '0', array ('onclick' => 'javascript:receivers_hide(\'receivers_to\')')); |
|
44 | + $this->_elements[] = new HTML_QuickForm_Radio('receivers', '', get_lang('Everybody'), '0', array('onclick' => 'javascript:receivers_hide(\'receivers_to\')')); |
|
45 | 45 | $this->_elements[0]->setChecked(true); |
46 | - $this->_elements[] = new HTML_QuickForm_Radio('receivers', '', get_lang('SelectGroupsUsers'), '1', array ('onclick' => 'javascript:receivers_show(\'receivers_to\')')); |
|
46 | + $this->_elements[] = new HTML_QuickForm_Radio('receivers', '', get_lang('SelectGroupsUsers'), '1', array('onclick' => 'javascript:receivers_show(\'receivers_to\')')); |
|
47 | 47 | $this->_elements[] = new HTML_QuickForm_advmultiselect('to', '', $this->receivers); |
48 | 48 | $this->_elements[2]->setSelected($this->receivers_selected); |
49 | 49 | } |