@@ -10,25 +10,25 @@ discard block |
||
10 | 10 | require_once '../inc/global.inc.php'; |
11 | 11 | |
12 | 12 | api_block_anonymous_users(); |
13 | -if (api_get_setting('allow_social_tool') !='true') { |
|
13 | +if (api_get_setting('allow_social_tool') != 'true') { |
|
14 | 14 | api_not_allowed(); |
15 | 15 | } |
16 | 16 | |
17 | 17 | $tok = Security::get_token(); |
18 | 18 | |
19 | 19 | if (isset($_REQUEST['user_friend'])) { |
20 | - $info_user_friend=array(); |
|
21 | - $info_path_friend=array(); |
|
20 | + $info_user_friend = array(); |
|
21 | + $info_path_friend = array(); |
|
22 | 22 | $userfriend_id = intval($_REQUEST['user_friend']); |
23 | 23 | $info_user_friend = api_get_user_info($userfriend_id); |
24 | - $info_path_friend = UserManager::get_user_picture_path_by_id($userfriend_id,'web'); |
|
24 | + $info_path_friend = UserManager::get_user_picture_path_by_id($userfriend_id, 'web'); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | $group_id = isset($_GET['group_id']) ? intval($_GET['group_id']) : null; |
28 | 28 | $message_id = isset($_GET['message_id']) ? intval($_GET['message_id']) : null; |
29 | 29 | $actions = array('add_message_group', 'edit_message_group', 'reply_message_group'); |
30 | 30 | |
31 | -$allowed_action = isset($_GET['action']) && in_array($_GET['action'],$actions) ? Security::remove_XSS($_GET['action']):''; |
|
31 | +$allowed_action = isset($_GET['action']) && in_array($_GET['action'], $actions) ? Security::remove_XSS($_GET['action']) : ''; |
|
32 | 32 | |
33 | 33 | $to_group = ''; |
34 | 34 | $subject = ''; |
@@ -54,13 +54,13 @@ discard block |
||
54 | 54 | } |
55 | 55 | } |
56 | 56 | |
57 | -$page_item = !empty($_GET['topics_page_nr']) ? intval($_GET['topics_page_nr']):1; |
|
58 | -$param_item_page = isset($_GET['items_page_nr']) && isset($_GET['topic_id']) ? ('&items_'.intval($_GET['topic_id']).'_page_nr='.(!empty($_GET['topics_page_nr'])?intval($_GET['topics_page_nr']):1)):''; |
|
57 | +$page_item = !empty($_GET['topics_page_nr']) ? intval($_GET['topics_page_nr']) : 1; |
|
58 | +$param_item_page = isset($_GET['items_page_nr']) && isset($_GET['topic_id']) ? ('&items_'.intval($_GET['topic_id']).'_page_nr='.(!empty($_GET['topics_page_nr']) ? intval($_GET['topics_page_nr']) : 1)) : ''; |
|
59 | 59 | if (isset($_GET['topic_id'])) { |
60 | 60 | $param_item_page .= '&topic_id='.intval($_GET['topic_id']); |
61 | 61 | } |
62 | -$page_topic = isset($_GET['topics_page_nr']) ? intval($_GET['topics_page_nr']) : 1; |
|
63 | -$anchor_topic = isset($_GET['anchor_topic']) ? Security::remove_XSS($_GET['anchor_topic']) : null; |
|
62 | +$page_topic = isset($_GET['topics_page_nr']) ? intval($_GET['topics_page_nr']) : 1; |
|
63 | +$anchor_topic = isset($_GET['anchor_topic']) ? Security::remove_XSS($_GET['anchor_topic']) : null; |
|
64 | 64 | |
65 | 65 | $url = api_get_path(WEB_CODE_PATH).'social/group_topics.php?id='.$group_id.'&anchor_topic='.$anchor_topic.'&topics_page_nr='.$page_topic.$param_item_page; |
66 | 66 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | |
74 | 74 | $tpl = new Template(get_lang('Groups')); |
75 | 75 | |
76 | -if (api_get_setting('allow_message_tool')=='true') { |
|
76 | +if (api_get_setting('allow_message_tool') == 'true') { |
|
77 | 77 | // Normal message |
78 | 78 | $user_info = api_get_user_info($userfriend_id); |
79 | 79 | $height = 180; |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | ' |
91 | 91 | <div id="link-more-attach"> |
92 | 92 | <a class="btn btn-default" href="javascript://" onclick="return add_image_form()"> |
93 | - ' . get_lang('AddOneMoreFile') . ' |
|
93 | + ' . get_lang('AddOneMoreFile').' |
|
94 | 94 | </a> |
95 | 95 | </div> |
96 | 96 | ' |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | |
19 | 19 | // Database Table Definitions |
20 | 20 | $tbl_user = Database::get_main_table(TABLE_MAIN_USER); |
21 | -$tbl_group_rel_user = Database::get_main_table(TABLE_USERGROUP_REL_USER); |
|
21 | +$tbl_group_rel_user = Database::get_main_table(TABLE_USERGROUP_REL_USER); |
|
22 | 22 | |
23 | 23 | // setting the name of the tool |
24 | 24 | $tool_name = get_lang('SubscribeUsersToGroup'); |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | } |
41 | 41 | } |
42 | 42 | |
43 | -$interbreadcrumb[] = array('url' =>'groups.php','name' => get_lang('Groups')); |
|
43 | +$interbreadcrumb[] = array('url' =>'groups.php', 'name' => get_lang('Groups')); |
|
44 | 44 | $interbreadcrumb[] = array('url' => 'group_view.php?id='.$group_id, 'name' => $group_info['name']); |
45 | 45 | $interbreadcrumb[] = array('url' =>'#', 'name' => get_lang('SubscribeUsersToGroup')); |
46 | 46 | |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | |
75 | 75 | if (is_array($user_list) && count($user_list) > 0) { |
76 | 76 | //send invitation message |
77 | - foreach ($user_list as $user_id){ |
|
77 | + foreach ($user_list as $user_id) { |
|
78 | 78 | $result = MessageManager::send_message( |
79 | 79 | $user_id, |
80 | 80 | $title, |
@@ -110,8 +110,8 @@ discard block |
||
110 | 110 | |
111 | 111 | if (!isset($group_friend_list[$group_id]) || |
112 | 112 | isset($group_friend_list[$group_id]) && |
113 | - $group_friend_list[$group_id]['relation_type'] == '' ) { |
|
114 | - $Users[$friend['friend_user_id']]= array( |
|
113 | + $group_friend_list[$group_id]['relation_type'] == '') { |
|
114 | + $Users[$friend['friend_user_id']] = array( |
|
115 | 115 | 'user_id' => $friend['friend_user_id'], |
116 | 116 | 'firstname' => $friend['firstName'], |
117 | 117 | 'lastname' => $friend['lastName'], |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | ); |
121 | 121 | } |
122 | 122 | } else { |
123 | - $Users[$friend['friend_user_id']]= array( |
|
123 | + $Users[$friend['friend_user_id']] = array( |
|
124 | 124 | 'user_id' => $friend['friend_user_id'], |
125 | 125 | 'firstname' =>$friend['firstName'], |
126 | 126 | 'lastname' => $friend['lastName'], |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | } |
132 | 132 | } |
133 | 133 | |
134 | -if (is_array($Users) && count($Users) > 0 ) { |
|
134 | +if (is_array($Users) && count($Users) > 0) { |
|
135 | 135 | foreach ($Users as $user) { |
136 | 136 | if ($user['group_id'] != $group_id) { |
137 | 137 | $nosessionUsersList[$user['user_id']] = api_get_person_name( |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | } |
144 | 144 | |
145 | 145 | $social_left_content = SocialManager::show_social_menu('invite_friends', $group_id); |
146 | -$social_right_content = '<h2>'.Security::remove_XSS($group_info['name'], STUDENT, true).'</h2>'; |
|
146 | +$social_right_content = '<h2>'.Security::remove_XSS($group_info['name'], STUDENT, true).'</h2>'; |
|
147 | 147 | |
148 | 148 | if (count($nosessionUsersList) == 0) { |
149 | 149 | $friends = SocialManager::get_friends(api_get_user_id()); |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | array(GROUP_USER_PERMISSION_PENDING_INVITATION) |
180 | 180 | ); |
181 | 181 | |
182 | -if (is_array($members) && count($members)>0) { |
|
182 | +if (is_array($members) && count($members) > 0) { |
|
183 | 183 | foreach ($members as &$member) { |
184 | 184 | $image = UserManager::getUserPicture($member['id']); |
185 | 185 | $member['image'] = '<img src="'.$image.'" width="50px" height="50px" />'; |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | $cidReset = true; |
13 | 13 | require_once '../inc/global.inc.php'; |
14 | 14 | |
15 | -if (api_get_setting('allow_social_tool') !='true') { |
|
15 | +if (api_get_setting('allow_social_tool') != 'true') { |
|
16 | 16 | $url = api_get_path(WEB_PATH).'whoisonline.php?id='.intval($_GET['u']); |
17 | 17 | header('Location: '.$url); |
18 | 18 | exit; |
@@ -58,9 +58,9 @@ discard block |
||
58 | 58 | |
59 | 59 | Display::addFlash(Display::return_message(get_lang('MessageSent'))); |
60 | 60 | |
61 | - $url = api_get_path(WEB_CODE_PATH) . 'social/profile.php'; |
|
61 | + $url = api_get_path(WEB_CODE_PATH).'social/profile.php'; |
|
62 | 62 | $url .= empty($_SERVER['QUERY_STRING']) ? '' : '?'.Security::remove_XSS($_SERVER['QUERY_STRING']); |
63 | - header('Location: ' . $url); |
|
63 | + header('Location: '.$url); |
|
64 | 64 | exit; |
65 | 65 | |
66 | 66 | } else if (!empty($_POST['social_wall_new_msg']) && !empty($_POST['messageId'])) { |
@@ -75,9 +75,9 @@ discard block |
||
75 | 75 | MESSAGE_STATUS_WALL |
76 | 76 | ); |
77 | 77 | Display::addFlash(Display::return_message(get_lang('MessageSent'))); |
78 | - $url = api_get_path(WEB_CODE_PATH) . 'social/profile.php'; |
|
78 | + $url = api_get_path(WEB_CODE_PATH).'social/profile.php'; |
|
79 | 79 | $url .= empty($_SERVER['QUERY_STRING']) ? '' : '?'.Security::remove_XSS($_SERVER['QUERY_STRING']); |
80 | - header('Location: ' . $url); |
|
80 | + header('Location: '.$url); |
|
81 | 81 | exit; |
82 | 82 | |
83 | 83 | } else if (isset($_GET['messageId'])) { |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | $status = SocialManager::deleteMessage($messageId); |
90 | 90 | |
91 | 91 | Display::addFlash(Display::return_message(get_lang('MessageDeleted'))); |
92 | - header('Location: ' . api_get_path(WEB_CODE_PATH) . 'social/profile.php'); |
|
92 | + header('Location: '.api_get_path(WEB_CODE_PATH).'social/profile.php'); |
|
93 | 93 | exit; |
94 | 94 | } |
95 | 95 | } |
@@ -154,16 +154,16 @@ discard block |
||
154 | 154 | require_once $libpath.'magpierss/rss_fetch.inc'; |
155 | 155 | $ajax_url = api_get_path(WEB_AJAX_PATH).'message.ajax.php'; |
156 | 156 | $socialAjaxUrl = api_get_path(WEB_AJAX_PATH).'social.ajax.php'; |
157 | -$javascriptDir = api_get_path(LIBRARY_PATH) . 'javascript/'; |
|
157 | +$javascriptDir = api_get_path(LIBRARY_PATH).'javascript/'; |
|
158 | 158 | api_block_anonymous_users(); |
159 | 159 | $locale = api_get_language_isocode(); |
160 | 160 | // Add Jquery scroll pagination plugin |
161 | 161 | $htmlHeadXtra[] = api_get_js('jscroll/jquery.jscroll.js'); |
162 | 162 | // Add Jquery Time ago plugin |
163 | 163 | $htmlHeadXtra[] = api_get_asset('jquery-timeago/jquery.timeago.js'); |
164 | -$timeAgoLocaleDir = $javascriptDir . 'jquery-timeago/locales/jquery.timeago.' . $locale . '.js'; |
|
164 | +$timeAgoLocaleDir = $javascriptDir.'jquery-timeago/locales/jquery.timeago.'.$locale.'.js'; |
|
165 | 165 | if (file_exists($timeAgoLocaleDir)) { |
166 | - $htmlHeadXtra[] = api_get_js('jquery-timeago/locales/jquery.timeago.' . $locale . '.js'); |
|
166 | + $htmlHeadXtra[] = api_get_js('jquery-timeago/locales/jquery.timeago.'.$locale.'.js'); |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | $htmlHeadXtra[] = '<script> |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | $(document).ready(function (){ |
172 | 172 | var container = $("#wallMessages"); |
173 | 173 | container.jscroll({ |
174 | - loadingHtml: "<div class=\"well_border\">' . get_lang('Loading') . ' </div>", |
|
174 | + loadingHtml: "<div class=\"well_border\">' . get_lang('Loading').' </div>", |
|
175 | 175 | nextSelector: "a.nextPage:last", |
176 | 176 | contentSelector: "", |
177 | 177 | callback: timeAgo |
@@ -222,8 +222,8 @@ discard block |
||
222 | 222 | ); |
223 | 223 | |
224 | 224 | if (isset($_GET['u']) && is_numeric($_GET['u']) && $_GET['u'] != api_get_user_id()) { |
225 | - $info_user = api_get_user_info($_GET['u']); |
|
226 | - $interbreadcrumb[]= array( |
|
225 | + $info_user = api_get_user_info($_GET['u']); |
|
226 | + $interbreadcrumb[] = array( |
|
227 | 227 | 'url' => '#', |
228 | 228 | 'name' => $info_user['complete_name'] |
229 | 229 | ); |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | $list = []; |
248 | 248 | if (is_array($personal_course_list)) { |
249 | 249 | foreach ($personal_course_list as $my_course) { |
250 | - if ($i<=10) { |
|
250 | + if ($i <= 10) { |
|
251 | 251 | $list[] = SocialManager::get_logged_user_course_html($my_course, $i); |
252 | 252 | $course_list_code[] = array('code' => $my_course['code']); |
253 | 253 | } else { |
@@ -285,14 +285,14 @@ discard block |
||
285 | 285 | $social_wall_block = $wallSocialAddPost; |
286 | 286 | |
287 | 287 | // Social Post Wall |
288 | -$posts = SocialManager::getWallMessagesByUser($my_user_id, $friendId) ; |
|
288 | +$posts = SocialManager::getWallMessagesByUser($my_user_id, $friendId); |
|
289 | 289 | |
290 | 290 | $posts = empty($posts) ? '<p>'.get_lang("NoPosts").'</p>' : $posts; |
291 | 291 | $social_post_wall_block = Display::panel($posts, get_lang('Posts')); |
292 | 292 | |
293 | 293 | $socialAutoExtendLink = Display::url( |
294 | 294 | get_lang('SeeMore'), |
295 | - $socialAjaxUrl . '?u='. $my_user_id . '&a=listWallMessage&start=10&length=5', |
|
295 | + $socialAjaxUrl.'?u='.$my_user_id.'&a=listWallMessage&start=10&length=5', |
|
296 | 296 | array( |
297 | 297 | 'class' => 'nextPage next', |
298 | 298 | ) |
@@ -311,12 +311,12 @@ discard block |
||
311 | 311 | $(".spinner").html("'. |
312 | 312 | '<div class=\'text-center\'>'. |
313 | 313 | '<em class=\'fa fa-spinner fa-pulse fa-1x\'></em>'. |
314 | - '<p>'. get_lang('Loading') . ' ' . get_lang('Preview') .'</p>'. |
|
314 | + '<p>'.get_lang('Loading').' '.get_lang('Preview').'</p>'. |
|
315 | 315 | '</div>'. |
316 | 316 | '"); |
317 | 317 | }, |
318 | 318 | type: "POST", |
319 | - url: "'. api_get_path(WEB_AJAX_PATH) .'social.ajax.php?a=readUrlWithOpenGraph", |
|
319 | + url: "'. api_get_path(WEB_AJAX_PATH).'social.ajax.php?a=readUrlWithOpenGraph", |
|
320 | 320 | data: "social_wall_new_msg_main=" + e.originalEvent.clipboardData.getData("text"), |
321 | 321 | success: function(response) { |
322 | 322 | $("[name=\'wall_post_button\']").prop( "disabled", false ); |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | $extra_user_data = UserManager::get_extra_user_data($user_id, false, true); |
344 | 344 | |
345 | 345 | $extra_information = ''; |
346 | - if (is_array($extra_user_data) && count($extra_user_data)>0 ) { |
|
346 | + if (is_array($extra_user_data) && count($extra_user_data) > 0) { |
|
347 | 347 | $extra_information_value = '<ul class="list-group">'; |
348 | 348 | $extraField = new ExtraField('user'); |
349 | 349 | foreach ($extra_user_data as $key => $data) { |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | .$tags['tag'] |
398 | 398 | .'</a>'; |
399 | 399 | } |
400 | - if (is_array($user_tags) && count($user_tags)>0) { |
|
400 | + if (is_array($user_tags) && count($user_tags) > 0) { |
|
401 | 401 | $extra_information_value .= '<li class="list-group-item">'.ucfirst($extraFieldInfo['display_text']).': ' |
402 | 402 | .' '.implode('', $tag_tmp).'</li>'; |
403 | 403 | } |
@@ -424,8 +424,8 @@ discard block |
||
424 | 424 | if (!empty($data)) { |
425 | 425 | $extra_field_title = ucfirst($extraFieldInfo['display_text']); |
426 | 426 | if ($extra_field_title == 'Skype') { |
427 | - $data = '<a href="skype:' . $data . '?chat">' . get_lang('Chat') . '</a>'; |
|
428 | - $extra_information_value .= '<li class="list-group-item">'.Display::return_icon('skype.png', $extraFieldInfo['display_text'], null, ICON_SIZE_TINY, false) . ' ' . $data.'</li>'; |
|
427 | + $data = '<a href="skype:'.$data.'?chat">'.get_lang('Chat').'</a>'; |
|
428 | + $extra_information_value .= '<li class="list-group-item">'.Display::return_icon('skype.png', $extraFieldInfo['display_text'], null, ICON_SIZE_TINY, false).' '.$data.'</li>'; |
|
429 | 429 | } else { |
430 | 430 | $extra_information_value .= '<dt>'.ucfirst($extraFieldInfo['display_text']).':</dt><dd>'.$data.'</dd>'; |
431 | 431 | } |
@@ -484,7 +484,7 @@ discard block |
||
484 | 484 | ); |
485 | 485 | } |
486 | 486 | $count_users_group = count($userGroup->get_all_users_by_group($id)); |
487 | - if ($count_users_group == 1 ) { |
|
487 | + if ($count_users_group == 1) { |
|
488 | 488 | $count_users_group = $count_users_group.' '.get_lang('Member'); |
489 | 489 | } else { |
490 | 490 | $count_users_group = $count_users_group.' '.get_lang('Members'); |
@@ -504,7 +504,7 @@ discard block |
||
504 | 504 | if (count($grid_my_groups) > 0) { |
505 | 505 | $my_groups = ''; |
506 | 506 | $count_groups = 0; |
507 | - if (count($results) == 1 ) { |
|
507 | + if (count($results) == 1) { |
|
508 | 508 | $count_groups = count($results); |
509 | 509 | } else { |
510 | 510 | $count_groups = count($results); |
@@ -515,10 +515,10 @@ discard block |
||
515 | 515 | |
516 | 516 | if ($i > $max_numbers_of_group) { |
517 | 517 | if (api_get_user_id() == $user_id) { |
518 | - $my_groups .= '<div class="box_shared_profile_group_actions">' |
|
518 | + $my_groups .= '<div class="box_shared_profile_group_actions">' |
|
519 | 519 | .'<a href="groups.php?#tab_browse-1">'.get_lang('SeeAllMyGroups').'</a></div>'; |
520 | 520 | } else { |
521 | - $my_groups .= '<div class="box_shared_profile_group_actions">' |
|
521 | + $my_groups .= '<div class="box_shared_profile_group_actions">' |
|
522 | 522 | .'<a href="'.api_get_path(WEB_CODE_PATH).'social/profile_friends_and_groups.inc.php' |
523 | 523 | .'?view=mygroups&height=390&width=610&user_id='.$user_id.'"' |
524 | 524 | .' class="ajax" title="'.get_lang('SeeAll').'" >' |
@@ -531,7 +531,7 @@ discard block |
||
531 | 531 | $i = 1; |
532 | 532 | foreach ($grid_my_groups as $group) { |
533 | 533 | $my_groups .= '<div class="panel-body">'; |
534 | - $my_groups .= $group[0]; |
|
534 | + $my_groups .= $group[0]; |
|
535 | 535 | $my_groups .= '</div>'; |
536 | 536 | $i++; |
537 | 537 | } |
@@ -549,12 +549,12 @@ discard block |
||
549 | 549 | $i = 1; |
550 | 550 | |
551 | 551 | foreach ($list as $key => $value) { |
552 | - if ( empty($value[2]) ) { //if out of any session |
|
553 | - $my_courses .= $value[1]; |
|
552 | + if (empty($value[2])) { //if out of any session |
|
553 | + $my_courses .= $value[1]; |
|
554 | 554 | $i++; |
555 | 555 | } |
556 | 556 | } |
557 | - $social_course_block .= $my_courses; |
|
557 | + $social_course_block .= $my_courses; |
|
558 | 558 | //$social_course_block = Display::panel($my_courses, get_lang('MyCourses')); |
559 | 559 | } |
560 | 560 | |
@@ -572,19 +572,19 @@ discard block |
||
572 | 572 | } |
573 | 573 | |
574 | 574 | // Productions |
575 | - $production_list = UserManager::build_production_list($user_id); |
|
575 | + $production_list = UserManager::build_production_list($user_id); |
|
576 | 576 | |
577 | 577 | // Images uploaded by course |
578 | 578 | $file_list = ''; |
579 | - if (is_array($course_list_code) && count($course_list_code)>0) { |
|
579 | + if (is_array($course_list_code) && count($course_list_code) > 0) { |
|
580 | 580 | foreach ($course_list_code as $course) { |
581 | - $file_list.= UserManager::get_user_upload_files_by_course($user_id,$course['code'],$resourcetype='images'); |
|
581 | + $file_list .= UserManager::get_user_upload_files_by_course($user_id, $course['code'], $resourcetype = 'images'); |
|
582 | 582 | } |
583 | 583 | } |
584 | 584 | |
585 | 585 | $count_pending_invitations = 0; |
586 | 586 | if (!isset($_GET['u']) || |
587 | - (isset($_GET['u']) && $_GET['u']==api_get_user_id()) |
|
587 | + (isset($_GET['u']) && $_GET['u'] == api_get_user_id()) |
|
588 | 588 | ) { |
589 | 589 | $pending_invitations = SocialManager::get_list_invitation_of_friends_by_user_id(api_get_user_id()); |
590 | 590 | $list_get_path_web = SocialManager::get_list_web_path_user_invitation_by_user_id(api_get_user_id()); |
@@ -594,92 +594,92 @@ discard block |
||
594 | 594 | if (!empty($production_list) || !empty($file_list) || $count_pending_invitations > 0) { |
595 | 595 | |
596 | 596 | //Pending invitations |
597 | - if (!isset($_GET['u']) || (isset($_GET['u']) && $_GET['u']==api_get_user_id())) { |
|
597 | + if (!isset($_GET['u']) || (isset($_GET['u']) && $_GET['u'] == api_get_user_id())) { |
|
598 | 598 | if ($count_pending_invitations > 0) { |
599 | - $invitations = '<div><h3>'.get_lang('PendingInvitations').'</h3></div>'; |
|
600 | - for ($i=0;$i<$count_pending_invitations;$i++) { |
|
599 | + $invitations = '<div><h3>'.get_lang('PendingInvitations').'</h3></div>'; |
|
600 | + for ($i = 0; $i < $count_pending_invitations; $i++) { |
|
601 | 601 | $user_invitation_id = $pending_invitations[$i]['user_sender_id']; |
602 | - $invitations .= '<div id="dpending_'.$user_invitation_id.'" class="friend_invitations">'; |
|
603 | - $invitations .= '<div style="float:left;width:60px;" >'; |
|
604 | - $invitations .= '<img style="margin-bottom:5px;"' |
|
602 | + $invitations .= '<div id="dpending_'.$user_invitation_id.'" class="friend_invitations">'; |
|
603 | + $invitations .= '<div style="float:left;width:60px;" >'; |
|
604 | + $invitations .= '<img style="margin-bottom:5px;"' |
|
605 | 605 | .' src="'.$list_get_path_web[$i]['dir'].'/'.$list_get_path_web[$i]['file'].'"' |
606 | 606 | .' width="60px">'; |
607 | - $invitations .= '</div>'; |
|
607 | + $invitations .= '</div>'; |
|
608 | 608 | |
609 | - $invitations .= '<div style="padding-left:70px;">'; |
|
609 | + $invitations .= '<div style="padding-left:70px;">'; |
|
610 | 610 | $user_invitation_info = api_get_user_info($user_invitation_id); |
611 | - $invitations .= '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php' |
|
611 | + $invitations .= '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php' |
|
612 | 612 | .'?u='.$user_invitation_id.'">' |
613 | 613 | .api_get_person_name( |
614 | 614 | $user_invitation_info['firstname'], |
615 | 615 | $user_invitation_info['lastname']) |
616 | 616 | .'</a>'; |
617 | - $invitations .= '<br />'; |
|
618 | - $invitations .= Security::remove_XSS( |
|
617 | + $invitations .= '<br />'; |
|
618 | + $invitations .= Security::remove_XSS( |
|
619 | 619 | cut($pending_invitations[$i]['content'], 50), |
620 | 620 | STUDENT, |
621 | 621 | true |
622 | 622 | ); |
623 | - $invitations .= '<br />'; |
|
624 | - $invitations .= '<a id="btn_accepted_'.$user_invitation_id.'"' |
|
623 | + $invitations .= '<br />'; |
|
624 | + $invitations .= '<a id="btn_accepted_'.$user_invitation_id.'"' |
|
625 | 625 | .' class="btn btn-default" onclick="register_friend(this)" href="javascript:void(0)">' |
626 | 626 | .get_lang('SocialAddToFriends') |
627 | 627 | .'</a>'; |
628 | - $invitations .= '<div id="id_response"></div>'; |
|
629 | - $invitations .= '</div>'; |
|
630 | - $invitations .= '</div>'; |
|
628 | + $invitations .= '<div id="id_response"></div>'; |
|
629 | + $invitations .= '</div>'; |
|
630 | + $invitations .= '</div>'; |
|
631 | 631 | } |
632 | - $socialRightInformation .= SocialManager::social_wrapper_div($invitations, 4); |
|
632 | + $socialRightInformation .= SocialManager::social_wrapper_div($invitations, 4); |
|
633 | 633 | } |
634 | 634 | } |
635 | 635 | |
636 | 636 | // Productions |
637 | - $production_list = UserManager::build_production_list($user_id); |
|
637 | + $production_list = UserManager::build_production_list($user_id); |
|
638 | 638 | |
639 | - $product_content = ''; |
|
639 | + $product_content = ''; |
|
640 | 640 | if (!empty($production_list)) { |
641 | 641 | $product_content .= '<div><h3>'.get_lang('MyProductions').'</h3></div>'; |
642 | - $product_content .= $production_list; |
|
643 | - $socialRightInformation .= SocialManager::social_wrapper_div($product_content, 4); |
|
642 | + $product_content .= $production_list; |
|
643 | + $socialRightInformation .= SocialManager::social_wrapper_div($product_content, 4); |
|
644 | 644 | } |
645 | 645 | |
646 | 646 | $images_uploaded = null; |
647 | 647 | // Images uploaded by course |
648 | 648 | if (!empty($file_list)) { |
649 | - $images_uploaded .= '<div><h3>'.get_lang('ImagesUploaded').'</h3></div>'; |
|
650 | - $images_uploaded .= '<div class="social-content-information">'; |
|
651 | - $images_uploaded .= $file_list; |
|
652 | - $images_uploaded .= '</div>'; |
|
653 | - $socialRightInformation .= SocialManager::social_wrapper_div($images_uploaded, 4); |
|
649 | + $images_uploaded .= '<div><h3>'.get_lang('ImagesUploaded').'</h3></div>'; |
|
650 | + $images_uploaded .= '<div class="social-content-information">'; |
|
651 | + $images_uploaded .= $file_list; |
|
652 | + $images_uploaded .= '</div>'; |
|
653 | + $socialRightInformation .= SocialManager::social_wrapper_div($images_uploaded, 4); |
|
654 | 654 | } |
655 | 655 | } |
656 | 656 | |
657 | 657 | if (!empty($user_info['competences']) || !empty($user_info['diplomas']) |
658 | - || !empty($user_info['openarea']) || !empty($user_info['teach']) ) { |
|
658 | + || !empty($user_info['openarea']) || !empty($user_info['teach'])) { |
|
659 | 659 | |
660 | - $more_info .= '<div><h3>'.get_lang('MoreInformation').'</h3></div>'; |
|
660 | + $more_info .= '<div><h3>'.get_lang('MoreInformation').'</h3></div>'; |
|
661 | 661 | if (!empty($user_info['competences'])) { |
662 | - $more_info .= '<br />'; |
|
663 | - $more_info .= '<div class="social-actions-message"><strong>'.get_lang('MyCompetences').'</strong></div>'; |
|
664 | - $more_info .= '<div class="social-profile-extended">'.$user_info['competences'].'</div>'; |
|
665 | - $more_info .= '<br />'; |
|
662 | + $more_info .= '<br />'; |
|
663 | + $more_info .= '<div class="social-actions-message"><strong>'.get_lang('MyCompetences').'</strong></div>'; |
|
664 | + $more_info .= '<div class="social-profile-extended">'.$user_info['competences'].'</div>'; |
|
665 | + $more_info .= '<br />'; |
|
666 | 666 | } |
667 | 667 | if (!empty($user_info['diplomas'])) { |
668 | - $more_info .= '<div class="social-actions-message"><strong>'.get_lang('MyDiplomas').'</strong></div>'; |
|
669 | - $more_info .= '<div class="social-profile-extended">'.$user_info['diplomas'].'</div>'; |
|
670 | - $more_info .= '<br />'; |
|
668 | + $more_info .= '<div class="social-actions-message"><strong>'.get_lang('MyDiplomas').'</strong></div>'; |
|
669 | + $more_info .= '<div class="social-profile-extended">'.$user_info['diplomas'].'</div>'; |
|
670 | + $more_info .= '<br />'; |
|
671 | 671 | } |
672 | 672 | if (!empty($user_info['openarea'])) { |
673 | - $more_info .= '<div class="social-actions-message"><strong>'.get_lang('MyPersonalOpenArea').'</strong></div>'; |
|
674 | - $more_info .= '<div class="social-profile-extended">'.$user_info['openarea'].'</div>'; |
|
675 | - $more_info .= '<br />'; |
|
673 | + $more_info .= '<div class="social-actions-message"><strong>'.get_lang('MyPersonalOpenArea').'</strong></div>'; |
|
674 | + $more_info .= '<div class="social-profile-extended">'.$user_info['openarea'].'</div>'; |
|
675 | + $more_info .= '<br />'; |
|
676 | 676 | } |
677 | 677 | if (!empty($user_info['teach'])) { |
678 | - $more_info .= '<div class="social-actions-message"><strong>'.get_lang('MyTeach').'</strong></div>'; |
|
679 | - $more_info .= '<div class="social-profile-extended">'.$user_info['teach'].'</div>'; |
|
680 | - $more_info .= '<br />'; |
|
678 | + $more_info .= '<div class="social-actions-message"><strong>'.get_lang('MyTeach').'</strong></div>'; |
|
679 | + $more_info .= '<div class="social-profile-extended">'.$user_info['teach'].'</div>'; |
|
680 | + $more_info .= '<br />'; |
|
681 | 681 | } |
682 | - $socialRightInformation .= SocialManager::social_wrapper_div($more_info, 4); |
|
682 | + $socialRightInformation .= SocialManager::social_wrapper_div($more_info, 4); |
|
683 | 683 | } |
684 | 684 | } |
685 | 685 | |
@@ -700,7 +700,7 @@ discard block |
||
700 | 700 | $tpl->assign('social_right_information', $socialRightInformation); |
701 | 701 | $tpl->assign('social_auto_extend_link', $socialAutoExtendLink); |
702 | 702 | |
703 | -$formModalTpl = new Template(); |
|
703 | +$formModalTpl = new Template(); |
|
704 | 704 | //$formModalTpl->assign('messageForm', MessageManager::generate_message_form('send_message')); |
705 | 705 | $formModalTpl->assign('invitation_form', MessageManager::generate_invitation_form('send_invitation')); |
706 | 706 | $formModals = $formModalTpl->fetch('default/social/form_modals.tpl'); |
@@ -12,30 +12,30 @@ discard block |
||
12 | 12 | |
13 | 13 | api_block_anonymous_users(); |
14 | 14 | |
15 | -if (api_get_setting('allow_social_tool') !='true') { |
|
15 | +if (api_get_setting('allow_social_tool') != 'true') { |
|
16 | 16 | api_not_allowed(); |
17 | 17 | } |
18 | 18 | $join_url = ''; |
19 | 19 | |
20 | 20 | $this_section = SECTION_SOCIAL; |
21 | -$allowed_views = array('mygroups','newest','pop'); |
|
21 | +$allowed_views = array('mygroups', 'newest', 'pop'); |
|
22 | 22 | $content = null; |
23 | 23 | |
24 | 24 | if (isset($_GET['view']) && in_array($_GET['view'], $allowed_views)) { |
25 | 25 | if ($_GET['view'] == 'mygroups') { |
26 | - $interbreadcrumb[]= array ('url' =>'groups.php','name' => get_lang('Groups')); |
|
27 | - $interbreadcrumb[]= array ('url' =>'#','name' => get_lang('MyGroups')); |
|
28 | - } else if ( $_GET['view'] == 'newest') { |
|
29 | - $interbreadcrumb[]= array ('url' =>'groups.php','name' => get_lang('Groups')); |
|
30 | - $interbreadcrumb[]= array ('url' =>'#','name' => get_lang('Newest')); |
|
31 | - } else { |
|
32 | - $interbreadcrumb[]= array ('url' =>'groups.php','name' => get_lang('Groups')); |
|
33 | - $interbreadcrumb[]= array ('url' =>'#','name' => get_lang('Popular')); |
|
26 | + $interbreadcrumb[] = array('url' =>'groups.php', 'name' => get_lang('Groups')); |
|
27 | + $interbreadcrumb[] = array('url' =>'#', 'name' => get_lang('MyGroups')); |
|
28 | + } else if ($_GET['view'] == 'newest') { |
|
29 | + $interbreadcrumb[] = array('url' =>'groups.php', 'name' => get_lang('Groups')); |
|
30 | + $interbreadcrumb[] = array('url' =>'#', 'name' => get_lang('Newest')); |
|
31 | + } else { |
|
32 | + $interbreadcrumb[] = array('url' =>'groups.php', 'name' => get_lang('Groups')); |
|
33 | + $interbreadcrumb[] = array('url' =>'#', 'name' => get_lang('Popular')); |
|
34 | 34 | } |
35 | 35 | } else { |
36 | - $interbreadcrumb[]= array ('url' =>'groups.php','name' => get_lang('Groups')); |
|
36 | + $interbreadcrumb[] = array('url' =>'groups.php', 'name' => get_lang('Groups')); |
|
37 | 37 | if (!isset($_GET['id'])) { |
38 | - $interbreadcrumb[]= array ('url' =>'#','name' => get_lang('GroupList')); |
|
38 | + $interbreadcrumb[] = array('url' =>'#', 'name' => get_lang('GroupList')); |
|
39 | 39 | } |
40 | 40 | } |
41 | 41 | |
@@ -72,16 +72,16 @@ discard block |
||
72 | 72 | } elseif ($result['relation_type'] == GROUP_USER_PERMISSION_MODERATOR) { |
73 | 73 | $name .= ' '.Display::return_icon('social_group_moderator.png', get_lang('Moderator'), array('style'=>'vertical-align:middle')); |
74 | 74 | } |
75 | - $url = '<a href="group_view.php?id='.$id.'">' . $name . '</a>'; |
|
75 | + $url = '<a href="group_view.php?id='.$id.'">'.$name.'</a>'; |
|
76 | 76 | |
77 | - $count_users_group = count($usergroup->get_users_by_group($id, false, array(GROUP_USER_PERMISSION_ADMIN, GROUP_USER_PERMISSION_READER, GROUP_USER_PERMISSION_MODERATOR), 0 , 1000)); |
|
78 | - if ($count_users_group == 1 ) { |
|
77 | + $count_users_group = count($usergroup->get_users_by_group($id, false, array(GROUP_USER_PERMISSION_ADMIN, GROUP_USER_PERMISSION_READER, GROUP_USER_PERMISSION_MODERATOR), 0, 1000)); |
|
78 | + if ($count_users_group == 1) { |
|
79 | 79 | $count_users_group = $count_users_group.' '.get_lang('Member'); |
80 | 80 | } else { |
81 | 81 | $count_users_group = $count_users_group.' '.get_lang('Members'); |
82 | 82 | } |
83 | 83 | |
84 | - $picture = $usergroup->get_picture_group($result['id'], $result['picture'],80); |
|
84 | + $picture = $usergroup->get_picture_group($result['id'], $result['picture'], 80); |
|
85 | 85 | $result['picture'] = '<img class="social-groups-image" src="'.$picture['file'].'" />'; |
86 | 86 | |
87 | 87 | $members = Display::returnFontAwesomeIcon('user').$count_users_group; |
@@ -93,9 +93,9 @@ discard block |
||
93 | 93 | $html .= '<div class="title-groups">'; |
94 | 94 | $html .= Display::tag('h5', $url); |
95 | 95 | $html .= '</div>'; |
96 | - $html .= '<div class="members-groups">' . $members . '</div>'; |
|
96 | + $html .= '<div class="members-groups">'.$members.'</div>'; |
|
97 | 97 | if ($result['description'] != '') { |
98 | - $html .= '<div class="description-groups">' . cut($result['description'],100,true) . '</div>'; |
|
98 | + $html .= '<div class="description-groups">'.cut($result['description'], 100, true).'</div>'; |
|
99 | 99 | } else { |
100 | 100 | $html .= ''; |
101 | 101 | } |
@@ -103,12 +103,12 @@ discard block |
||
103 | 103 | $html .= '</div>'; |
104 | 104 | |
105 | 105 | $grid_item_2 = $html; |
106 | - $grid_my_groups[]= array($grid_item_2); |
|
106 | + $grid_my_groups[] = array($grid_item_2); |
|
107 | 107 | } |
108 | 108 | } |
109 | 109 | |
110 | 110 | // Newest groups |
111 | -$results = $usergroup->get_groups_by_age(4,false); |
|
111 | +$results = $usergroup->get_groups_by_age(4, false); |
|
112 | 112 | |
113 | 113 | $grid_newest_groups = array(); |
114 | 114 | foreach ($results as $result) { |
@@ -117,16 +117,16 @@ discard block |
||
117 | 117 | $id = $result['id']; |
118 | 118 | $name = cut($result['name'], GROUP_TITLE_LENGTH, true); |
119 | 119 | |
120 | - $count_users_group = count($usergroup->get_users_by_group($id, false, array(GROUP_USER_PERMISSION_ADMIN, GROUP_USER_PERMISSION_READER, GROUP_USER_PERMISSION_MODERATOR), 0 , 1000)); |
|
121 | - if ($count_users_group == 1 ) { |
|
120 | + $count_users_group = count($usergroup->get_users_by_group($id, false, array(GROUP_USER_PERMISSION_ADMIN, GROUP_USER_PERMISSION_READER, GROUP_USER_PERMISSION_MODERATOR), 0, 1000)); |
|
121 | + if ($count_users_group == 1) { |
|
122 | 122 | $count_users_group = $count_users_group.' '.get_lang('Member'); |
123 | 123 | } else { |
124 | 124 | $count_users_group = $count_users_group.' '.get_lang('Members'); |
125 | 125 | } |
126 | 126 | |
127 | - $url = '<a href="group_view.php?id='.$id.'">' . $name . '</a>'; |
|
127 | + $url = '<a href="group_view.php?id='.$id.'">'.$name.'</a>'; |
|
128 | 128 | |
129 | - $picture = $usergroup->get_picture_group($result['id'], $result['picture'],80); |
|
129 | + $picture = $usergroup->get_picture_group($result['id'], $result['picture'], 80); |
|
130 | 130 | $result['picture'] = '<img class="social-groups-image" src="'.$picture['file'].'" />'; |
131 | 131 | $members = Display::returnFontAwesomeIcon('user').$count_users_group; |
132 | 132 | |
@@ -138,15 +138,15 @@ discard block |
||
138 | 138 | $html .= '<div class="title-groups">'; |
139 | 139 | $html .= Display::tag('h5', $url); |
140 | 140 | $html .= '</div>'; |
141 | - $html .= '<div class="members-groups">' . $members . '</div>'; |
|
141 | + $html .= '<div class="members-groups">'.$members.'</div>'; |
|
142 | 142 | if ($result['description'] != '') { |
143 | - $html .= '<div class="description-groups">' . cut($result['description'],100,true) . '</div>'; |
|
143 | + $html .= '<div class="description-groups">'.cut($result['description'], 100, true).'</div>'; |
|
144 | 144 | } else { |
145 | 145 | $html .= ''; |
146 | 146 | } |
147 | 147 | //Avoiding my groups |
148 | 148 | |
149 | - if (!in_array($id,$my_group_list)) { |
|
149 | + if (!in_array($id, $my_group_list)) { |
|
150 | 150 | $html .= '<a class="btn" href="group_view.php?id='.$id.'&action=join&u='.api_get_user_id().'">'.get_lang('JoinGroup').'</a> '; |
151 | 151 | } |
152 | 152 | |
@@ -157,11 +157,11 @@ discard block |
||
157 | 157 | |
158 | 158 | $grid_item_2 = $html; |
159 | 159 | |
160 | - $grid_newest_groups[]= array($grid_item_2); |
|
160 | + $grid_newest_groups[] = array($grid_item_2); |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | // Pop groups |
164 | -$results = $usergroup->get_groups_by_popularity(4,false); |
|
164 | +$results = $usergroup->get_groups_by_popularity(4, false); |
|
165 | 165 | $grid_pop_groups = array(); |
166 | 166 | |
167 | 167 | if (is_array($results) && count($results) > 0) { |
@@ -169,18 +169,18 @@ discard block |
||
169 | 169 | $result['name'] = Security::remove_XSS($result['name'], STUDENT, true); |
170 | 170 | $result['description'] = Security::remove_XSS($result['description'], STUDENT, true); |
171 | 171 | $id = $result['id']; |
172 | - $name = cut($result['name'],GROUP_TITLE_LENGTH,true); |
|
172 | + $name = cut($result['name'], GROUP_TITLE_LENGTH, true); |
|
173 | 173 | |
174 | - $count_users_group = count($usergroup->get_users_by_group($id, false, array(GROUP_USER_PERMISSION_ADMIN, GROUP_USER_PERMISSION_READER, GROUP_USER_PERMISSION_MODERATOR), 0 , 1000)); |
|
175 | - if ($count_users_group == 1 ) { |
|
174 | + $count_users_group = count($usergroup->get_users_by_group($id, false, array(GROUP_USER_PERMISSION_ADMIN, GROUP_USER_PERMISSION_READER, GROUP_USER_PERMISSION_MODERATOR), 0, 1000)); |
|
175 | + if ($count_users_group == 1) { |
|
176 | 176 | $count_users_group = $count_users_group.' '.get_lang('Member'); |
177 | 177 | } else { |
178 | 178 | $count_users_group = $count_users_group.' '.get_lang('Members'); |
179 | 179 | } |
180 | 180 | |
181 | - $url = '<a href="group_view.php?id='.$id.'">' . $name . '</a>'; |
|
181 | + $url = '<a href="group_view.php?id='.$id.'">'.$name.'</a>'; |
|
182 | 182 | |
183 | - $picture = $usergroup->get_picture_group($result['id'], $result['picture'],80); |
|
183 | + $picture = $usergroup->get_picture_group($result['id'], $result['picture'], 80); |
|
184 | 184 | $result['picture'] = '<img class="social-groups-image" src="'.$picture['file'].'" />'; |
185 | 185 | |
186 | 186 | $html = '<div class="row">'; |
@@ -191,15 +191,15 @@ discard block |
||
191 | 191 | $html .= '<div class="title-groups">'; |
192 | 192 | $html .= Display::tag('h5', $url); |
193 | 193 | $html .= '</div>'; |
194 | - $html .= '<div class="members-groups">' . $members . '</div>'; |
|
194 | + $html .= '<div class="members-groups">'.$members.'</div>'; |
|
195 | 195 | if ($result['description'] != '') { |
196 | - $html .= '<div class="description-groups">' . cut($result['description'],100,true) . '</div>'; |
|
196 | + $html .= '<div class="description-groups">'.cut($result['description'], 100, true).'</div>'; |
|
197 | 197 | } else { |
198 | 198 | $html .= ''; |
199 | 199 | } |
200 | 200 | //Avoiding my groups |
201 | 201 | |
202 | - if (!in_array($id,$my_group_list)) { |
|
202 | + if (!in_array($id, $my_group_list)) { |
|
203 | 203 | $html .= '<a class="btn" href="group_view.php?id='.$id.'&action=join&u='.api_get_user_id().'">'.get_lang('JoinGroup').'</a> '; |
204 | 204 | } |
205 | 205 | |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | $html .= '</div>'; |
209 | 209 | |
210 | 210 | $grid_item_2 = $html; |
211 | - $grid_pop_groups[]= array($grid_item_2); |
|
211 | + $grid_pop_groups[] = array($grid_item_2); |
|
212 | 212 | } |
213 | 213 | } |
214 | 214 | |
@@ -222,61 +222,61 @@ discard block |
||
222 | 222 | switch ($view_group) { |
223 | 223 | case 'mygroups': |
224 | 224 | if (count($grid_my_groups) > 0) { |
225 | - $my_group_content = Display::return_sortable_grid('mygroups', array(), $grid_my_groups, array('hide_navigation'=>true, 'per_page' => 2), $query_vars, false, array(true, true, true,false)); |
|
225 | + $my_group_content = Display::return_sortable_grid('mygroups', array(), $grid_my_groups, array('hide_navigation'=>true, 'per_page' => 2), $query_vars, false, array(true, true, true, false)); |
|
226 | 226 | } |
227 | 227 | if (api_get_setting('allow_students_to_create_groups_in_social') == 'true') { |
228 | - $create_group_item = '<a class="btn btn-default" href="'.api_get_path(WEB_PATH).'main/social/group_add.php">'. |
|
228 | + $create_group_item = '<a class="btn btn-default" href="'.api_get_path(WEB_PATH).'main/social/group_add.php">'. |
|
229 | 229 | get_lang('CreateASocialGroup').'</a>'; |
230 | 230 | } else { |
231 | - if (api_is_allowed_to_edit(null,true)) { |
|
232 | - $create_group_item = '<a class="btn btn-default" href="'.api_get_path(WEB_PATH).'main/social/group_add.php">'. |
|
231 | + if (api_is_allowed_to_edit(null, true)) { |
|
232 | + $create_group_item = '<a class="btn btn-default" href="'.api_get_path(WEB_PATH).'main/social/group_add.php">'. |
|
233 | 233 | get_lang('CreateASocialGroup').'</a>'; |
234 | 234 | } |
235 | 235 | } |
236 | 236 | break; |
237 | 237 | case 'newest': |
238 | 238 | if (count($grid_newest_groups) > 0) { |
239 | - $newest_content = Display::return_sortable_grid('newest', array(), $grid_newest_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true,false)); |
|
239 | + $newest_content = Display::return_sortable_grid('newest', array(), $grid_newest_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true, false)); |
|
240 | 240 | } |
241 | 241 | break; |
242 | 242 | default: |
243 | 243 | if (count($grid_pop_groups) > 0) { |
244 | - $popular_content = Display::return_sortable_grid('popular', array(), $grid_pop_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true,true,true)); |
|
244 | + $popular_content = Display::return_sortable_grid('popular', array(), $grid_pop_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true, true, true)); |
|
245 | 245 | } |
246 | 246 | break; |
247 | 247 | } |
248 | 248 | } else { |
249 | 249 | $my_group_content = null; |
250 | 250 | if (count($grid_my_groups) > 0) { |
251 | - $my_group_content = Display::return_sortable_grid('mygroups', array(), $grid_my_groups, array('hide_navigation'=>true, 'per_page' => 2), $query_vars, false, array(true, true, true,false)); |
|
251 | + $my_group_content = Display::return_sortable_grid('mygroups', array(), $grid_my_groups, array('hide_navigation'=>true, 'per_page' => 2), $query_vars, false, array(true, true, true, false)); |
|
252 | 252 | } else { |
253 | 253 | $my_group_content = '<span class="muted">'.get_lang('GroupNone').'</span>'; |
254 | 254 | } |
255 | 255 | if (api_get_setting('allow_students_to_create_groups_in_social') == 'true') { |
256 | - $create_group_item = '<a class="btn btn-default" href="'.api_get_path(WEB_PATH).'main/social/group_add.php">'. |
|
256 | + $create_group_item = '<a class="btn btn-default" href="'.api_get_path(WEB_PATH).'main/social/group_add.php">'. |
|
257 | 257 | get_lang('CreateASocialGroup').'</a>'; |
258 | 258 | } else { |
259 | - if (api_is_allowed_to_edit(null,true)) { |
|
260 | - $create_group_item = '<a class="btn btn-default" href="'.api_get_path(WEB_PATH).'main/social/group_add.php">'.get_lang('CreateASocialGroup').'</a>'; |
|
259 | + if (api_is_allowed_to_edit(null, true)) { |
|
260 | + $create_group_item = '<a class="btn btn-default" href="'.api_get_path(WEB_PATH).'main/social/group_add.php">'.get_lang('CreateASocialGroup').'</a>'; |
|
261 | 261 | } |
262 | 262 | } |
263 | 263 | if (count($grid_newest_groups) > 0) { |
264 | - $newest_content = Display::return_sortable_grid('mygroups', array(), $grid_newest_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true,false)); |
|
264 | + $newest_content = Display::return_sortable_grid('mygroups', array(), $grid_newest_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true, false)); |
|
265 | 265 | } else { |
266 | 266 | $newest_content = '<span class="muted">'.get_lang('GroupNone').'</span>'; |
267 | 267 | } |
268 | 268 | if (count($grid_pop_groups) > 0) { |
269 | - $popular_content = Display::return_sortable_grid('mygroups', array(), $grid_pop_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true,true,true)); |
|
269 | + $popular_content = Display::return_sortable_grid('mygroups', array(), $grid_pop_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true, true, true)); |
|
270 | 270 | } else { |
271 | 271 | $popular_content = '<span class="muted">'.get_lang('GroupNone').'</span>'; |
272 | 272 | } |
273 | 273 | } |
274 | 274 | |
275 | 275 | if (!empty($create_group_item)) { |
276 | - $social_right_content .= Display::page_subheader($create_group_item); |
|
276 | + $social_right_content .= Display::page_subheader($create_group_item); |
|
277 | 277 | } |
278 | 278 | $headers = array(get_lang('Newest'), get_lang('Popular'), get_lang('MyGroups')); |
279 | -$social_right_content .= Display::tabs($headers, array($newest_content, $popular_content, $my_group_content),'tab_browse'); |
|
279 | +$social_right_content .= Display::tabs($headers, array($newest_content, $popular_content, $my_group_content), 'tab_browse'); |
|
280 | 280 | |
281 | 281 | $show_message = null; |
282 | 282 | if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'show_message' && isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'topic_deleted') { |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $group_id |
118 | 118 | ); |
119 | 119 | $social_menu_block = SocialManager::show_social_menu('member_list', $group_id); |
120 | -$social_right_content = '<h2>' . $group_info['name'] . '</h2>'; |
|
120 | +$social_right_content = '<h2>'.$group_info['name'].'</h2>'; |
|
121 | 121 | |
122 | 122 | foreach ($users as $user) { |
123 | 123 | switch ($user['relation_type']) { |
@@ -136,24 +136,24 @@ discard block |
||
136 | 136 | ) |
137 | 137 | ) |
138 | 138 | ) { |
139 | - $user['link'] = '<a href="group_members.php?id=' . $group_id . '&u=' . $user['id'] . '&action=delete">' . |
|
139 | + $user['link'] = '<a href="group_members.php?id='.$group_id.'&u='.$user['id'].'&action=delete">'. |
|
140 | 140 | Display::return_icon( |
141 | 141 | 'delete.png', |
142 | 142 | get_lang('DeleteFromGroup') |
143 | - ) . '</a>' . |
|
144 | - '<a href="group_members.php?id=' . $group_id . '&u=' . $user['id'] . '&action=set_moderator">' . |
|
143 | + ).'</a>'. |
|
144 | + '<a href="group_members.php?id='.$group_id.'&u='.$user['id'].'&action=set_moderator">'. |
|
145 | 145 | Display::return_icon( |
146 | 146 | 'social_moderator_add.png', |
147 | 147 | get_lang('AddModerator') |
148 | - ) . '</a>'; |
|
148 | + ).'</a>'; |
|
149 | 149 | } |
150 | 150 | break; |
151 | 151 | case GROUP_USER_PERMISSION_PENDING_INVITATION: |
152 | - $user['link'] = '<a href="group_members.php?id=' . $group_id . '&u=' . $user['id'] . '&action=add">' . |
|
152 | + $user['link'] = '<a href="group_members.php?id='.$group_id.'&u='.$user['id'].'&action=add">'. |
|
153 | 153 | Display::return_icon( |
154 | 154 | 'pending_invitation.png', |
155 | 155 | get_lang('PendingInvitation') |
156 | - ) . '</a>'; |
|
156 | + ).'</a>'; |
|
157 | 157 | break; |
158 | 158 | case GROUP_USER_PERMISSION_MODERATOR: |
159 | 159 | $user['link'] = Display::return_icon( |
@@ -162,17 +162,17 @@ discard block |
||
162 | 162 | ); |
163 | 163 | //only group admin can manage moderators |
164 | 164 | if ($user_role == GROUP_USER_PERMISSION_ADMIN) { |
165 | - $user['link'] .= '<a href="group_members.php?id=' . $group_id . '&u=' . $user['id'] . '&action=delete_moderator">'. |
|
165 | + $user['link'] .= '<a href="group_members.php?id='.$group_id.'&u='.$user['id'].'&action=delete_moderator">'. |
|
166 | 166 | Display::return_icon( |
167 | 167 | 'social_moderator_delete.png', |
168 | 168 | get_lang('DeleteModerator') |
169 | - ) . '</a>'; |
|
169 | + ).'</a>'; |
|
170 | 170 | } |
171 | 171 | break; |
172 | 172 | } |
173 | 173 | |
174 | 174 | $userPicture = UserManager::getUserPicture($user['id']); |
175 | - $user['image'] = '<img src="' . $userPicture . '" width="50px" height="50px" />'; |
|
175 | + $user['image'] = '<img src="'.$userPicture.'" width="50px" height="50px" />'; |
|
176 | 176 | $new_member_list[] = $user; |
177 | 177 | } |
178 | 178 | if (count($new_member_list) > 0) { |
@@ -6,12 +6,12 @@ discard block |
||
6 | 6 | * @author Julio Montoya <[email protected]> |
7 | 7 | */ |
8 | 8 | |
9 | -$language_file= 'userInfo'; |
|
9 | +$language_file = 'userInfo'; |
|
10 | 10 | $cidReset = true; |
11 | 11 | require_once '../inc/global.inc.php'; |
12 | 12 | |
13 | 13 | api_block_anonymous_users(); |
14 | -if (api_get_setting('allow_social_tool') !='true') { |
|
14 | +if (api_get_setting('allow_social_tool') != 'true') { |
|
15 | 15 | api_not_allowed(); |
16 | 16 | } |
17 | 17 | |
@@ -38,9 +38,9 @@ discard block |
||
38 | 38 | $nameTools = get_lang('AddGroup'); |
39 | 39 | $this_section = SECTION_SOCIAL; |
40 | 40 | |
41 | -$interbreadcrumb[]= array ('url' =>'home.php','name' => get_lang('Social')); |
|
42 | -$interbreadcrumb[]= array ('url' =>'groups.php','name' => get_lang('Groups')); |
|
43 | -$interbreadcrumb[]= array ('url' =>'#','name' => $nameTools); |
|
41 | +$interbreadcrumb[] = array('url' =>'home.php', 'name' => get_lang('Social')); |
|
42 | +$interbreadcrumb[] = array('url' =>'groups.php', 'name' => get_lang('Groups')); |
|
43 | +$interbreadcrumb[] = array('url' =>'#', 'name' => $nameTools); |
|
44 | 44 | |
45 | 45 | $social_avatar_block = SocialManager::show_social_avatar_block('group_add'); |
46 | 46 | $social_menu_block = SocialManager::show_social_menu('group_add'); |
@@ -11,13 +11,13 @@ discard block |
||
11 | 11 | require_once '../inc/global.inc.php'; |
12 | 12 | |
13 | 13 | api_block_anonymous_users(); |
14 | -if (api_get_setting('allow_social_tool') !='true') { |
|
14 | +if (api_get_setting('allow_social_tool') != 'true') { |
|
15 | 15 | api_not_allowed(); |
16 | 16 | } |
17 | 17 | |
18 | 18 | $this_section = SECTION_SOCIAL; |
19 | 19 | |
20 | -$group_id= intval($_GET['id']); |
|
20 | +$group_id = intval($_GET['id']); |
|
21 | 21 | $usergroup = new UserGroup(); |
22 | 22 | |
23 | 23 | //todo @this validation could be in a function in group_portal_manager |
@@ -35,9 +35,9 @@ discard block |
||
35 | 35 | } |
36 | 36 | } |
37 | 37 | |
38 | -$interbreadcrumb[]= array ('url' =>'groups.php','name' => get_lang('Groups')); |
|
38 | +$interbreadcrumb[] = array('url' =>'groups.php', 'name' => get_lang('Groups')); |
|
39 | 39 | $interbreadcrumb[] = array('url' => 'group_view.php?id='.$group_id, 'name' => $group_info['name']); |
40 | -$interbreadcrumb[]= array ('url' =>'#','name' => get_lang('WaitingList')); |
|
40 | +$interbreadcrumb[] = array('url' =>'#', 'name' => get_lang('WaitingList')); |
|
41 | 41 | |
42 | 42 | // Group information |
43 | 43 | $admins = $usergroup->get_users_by_group( |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | ); |
50 | 50 | $show_message = ''; |
51 | 51 | |
52 | -if (isset($_GET['action']) && $_GET['action']=='accept') { |
|
52 | +if (isset($_GET['action']) && $_GET['action'] == 'accept') { |
|
53 | 53 | // we add a user only if is a open group |
54 | 54 | $user_join = intval($_GET['u']); |
55 | 55 | //if i'm a moderator |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | } |
60 | 60 | } |
61 | 61 | |
62 | -if (isset($_GET['action']) && $_GET['action']=='deny') { |
|
62 | +if (isset($_GET['action']) && $_GET['action'] == 'deny') { |
|
63 | 63 | // we add a user only if is a open group |
64 | 64 | $user_join = intval($_GET['u']); |
65 | 65 | //if i'm a moderator |
@@ -69,9 +69,9 @@ discard block |
||
69 | 69 | } |
70 | 70 | } |
71 | 71 | |
72 | -if (isset($_GET['action']) && $_GET['action']=='set_moderator') { |
|
72 | +if (isset($_GET['action']) && $_GET['action'] == 'set_moderator') { |
|
73 | 73 | // we add a user only if is a open group |
74 | - $user_moderator= intval($_GET['u']); |
|
74 | + $user_moderator = intval($_GET['u']); |
|
75 | 75 | //if i'm the admin |
76 | 76 | if ($usergroup->is_group_admin($group_id)) { |
77 | 77 | $usergroup->update_user_role($user_moderator, $group_id, GROUP_USER_PERMISSION_MODERATOR); |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | $social_left_content = SocialManager::show_social_menu('waiting_list', $group_id); |
92 | 92 | |
93 | 93 | // Display form |
94 | -foreach($users as $user) { |
|
94 | +foreach ($users as $user) { |
|
95 | 95 | switch ($user['relation_type']) { |
96 | 96 | case GROUP_USER_PERMISSION_PENDING_INVITATION_SENT_BY_USER: |
97 | 97 | $user['link'] = '<a href="group_waiting_list.php?id='.$group_id.'&u='.$user['user_id'].'&action=accept">'. |
@@ -132,15 +132,15 @@ |
||
132 | 132 | |
133 | 133 | $friend_html .= ' |
134 | 134 | <div class="col-md-3"> |
135 | - <div class="thumbnail text-center" id="div_' . $friends[$j]['friend_user_id'] . '"> |
|
136 | - <img src="' . $userPicture . '" class="img-responsive" id="imgfriend_' . $friend['friend_user_id'] . '" title="'.$user_name.'"> |
|
135 | + <div class="thumbnail text-center" id="div_' . $friends[$j]['friend_user_id'].'"> |
|
136 | + <img src="' . $userPicture.'" class="img-responsive" id="imgfriend_'.$friend['friend_user_id'].'" title="'.$user_name.'"> |
|
137 | 137 | <div class="caption"> |
138 | 138 | <h3> |
139 | - <a href="profile.php?u=' . $friend['friend_user_id'] . '">' . $user_name . '</a> |
|
139 | + <a href="profile.php?u=' . $friend['friend_user_id'].'">'.$user_name.'</a> |
|
140 | 140 | </h3> |
141 | 141 | <p> |
142 | - <button class="btn btn-danger" onclick="delete_friend(this)" id=img_' . $friend['friend_user_id'] . '> |
|
143 | - ' . get_lang('Delete') . ' |
|
142 | + <button class="btn btn-danger" onclick="delete_friend(this)" id=img_' . $friend['friend_user_id'].'> |
|
143 | + ' . get_lang('Delete').' |
|
144 | 144 | </button> |
145 | 145 | </p> |
146 | 146 | </div> |
@@ -13,9 +13,9 @@ discard block |
||
13 | 13 | // --------------------------------------------------- |
14 | 14 | // ACTIONS |
15 | 15 | // --------------------------------------------------- |
16 | -if ($_POST['StoreGroupPermissions'] and $setting_visualisation=='checkbox') |
|
16 | +if ($_POST['StoreGroupPermissions'] and $setting_visualisation == 'checkbox') |
|
17 | 17 | { |
18 | - $result_message=store_permissions('group', $group_id); |
|
18 | + $result_message = store_permissions('group', $group_id); |
|
19 | 19 | if ($result_message) |
20 | 20 | { |
21 | 21 | Display::display_normal_message($result_message); |
@@ -23,13 +23,13 @@ discard block |
||
23 | 23 | } |
24 | 24 | if (isset($_GET['action'])) |
25 | 25 | { |
26 | - if (($_GET['action']=='grant' OR $_GET['action']=='revoke') AND isset($_GET['permission']) AND isset($_GET['tool'])) |
|
26 | + if (($_GET['action'] == 'grant' OR $_GET['action'] == 'revoke') AND isset($_GET['permission']) AND isset($_GET['tool'])) |
|
27 | 27 | { |
28 | - $result_message=store_one_permission('group', $_GET['action'], $group_id, $_GET['tool'], $_GET['permission']); |
|
28 | + $result_message = store_one_permission('group', $_GET['action'], $group_id, $_GET['tool'], $_GET['permission']); |
|
29 | 29 | } |
30 | - if (isset($_GET['role']) AND ($_GET['action']=='grant' OR $_GET['action']=='revoke')) |
|
30 | + if (isset($_GET['role']) AND ($_GET['action'] == 'grant' OR $_GET['action'] == 'revoke')) |
|
31 | 31 | { |
32 | - $result_message=assign_role('group', $_GET['action'], $group_id, $_GET['role'], $_GET['scope']); |
|
32 | + $result_message = assign_role('group', $_GET['action'], $group_id, $_GET['role'], $_GET['scope']); |
|
33 | 33 | echo 'hier'; |
34 | 34 | } |
35 | 35 | } |
@@ -41,41 +41,41 @@ discard block |
||
41 | 41 | // --------------------------------------------------- |
42 | 42 | // RETRIEVING THE PERMISSIONS |
43 | 43 | // --------------------------------------------------- |
44 | -$current_group_permissions=array(); |
|
45 | -$current_group_permissions=get_permissions('group',$group_id); |
|
44 | +$current_group_permissions = array(); |
|
45 | +$current_group_permissions = get_permissions('group', $group_id); |
|
46 | 46 | // @todo current group permissions and current role permissions |
47 | 47 | |
48 | 48 | // --------------------------------------------------- |
49 | 49 | // INHERITED PERMISSIONS (group roles) |
50 | 50 | // --------------------------------------------------- |
51 | -$group_course_roles_permissions=get_roles_permissions('group',$group_id, 'course'); |
|
52 | -$group_platform_roles_permissions=get_roles_permissions('group',$group_id, 'platform'); |
|
53 | -$inherited_permissions=permission_array_merge($group_course_roles_permissions,$group_platform_roles_permissions); |
|
51 | +$group_course_roles_permissions = get_roles_permissions('group', $group_id, 'course'); |
|
52 | +$group_platform_roles_permissions = get_roles_permissions('group', $group_id, 'platform'); |
|
53 | +$inherited_permissions = permission_array_merge($group_course_roles_permissions, $group_platform_roles_permissions); |
|
54 | 54 | |
55 | 55 | // --------------------------------------------------- |
56 | 56 | // LIMITED OR FULL |
57 | 57 | // --------------------------------------------------- |
58 | -$current_group_permissions=limited_or_full($current_group_permissions); |
|
59 | -$inherited_permissions=limited_or_full($inherited_permissions); |
|
60 | -if (api_get_setting('permissions')=='limited') |
|
58 | +$current_group_permissions = limited_or_full($current_group_permissions); |
|
59 | +$inherited_permissions = limited_or_full($inherited_permissions); |
|
60 | +if (api_get_setting('permissions') == 'limited') |
|
61 | 61 | { |
62 | - $header_array=$rights_limited; |
|
62 | + $header_array = $rights_limited; |
|
63 | 63 | } |
64 | -if (api_get_setting('permissions')=='full') |
|
64 | +if (api_get_setting('permissions') == 'full') |
|
65 | 65 | { |
66 | - $header_array=$rights_full; |
|
66 | + $header_array = $rights_full; |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | echo "<form method=\"post\" action=\"".str_replace('&', '&', $_SERVER['REQUEST_URI'])."\">"; |
70 | 70 | // --------------------------------------------------- |
71 | 71 | // DISPLAYING THE ROLES LIST |
72 | 72 | // --------------------------------------------------- |
73 | -if (api_get_setting('group_roles')=='true') |
|
73 | +if (api_get_setting('group_roles') == 'true') |
|
74 | 74 | { |
75 | 75 | // the list of the roles for the user |
76 | 76 | echo '<strong>'.get_lang('GroupRoles').'</strong><br />'; |
77 | - $current_group_course_roles=get_roles('group',$group_id); |
|
78 | - $current_group_platform_roles=get_roles('group',$group_id, 'platform'); |
|
77 | + $current_group_course_roles = get_roles('group', $group_id); |
|
78 | + $current_group_platform_roles = get_roles('group', $group_id, 'platform'); |
|
79 | 79 | display_role_list($current_group_course_roles, $current_group_platform_roles); |
80 | 80 | echo '<br />'; |
81 | 81 | } |
@@ -107,17 +107,17 @@ discard block |
||
107 | 107 | foreach ($header_array as $key=>$value) |
108 | 108 | { |
109 | 109 | echo "\t\t<td align='center'>\n"; |
110 | - if (in_array($value,$rights)) |
|
110 | + if (in_array($value, $rights)) |
|
111 | 111 | { |
112 | - if ($setting_visualisation=='checkbox') |
|
112 | + if ($setting_visualisation == 'checkbox') |
|
113 | 113 | { |
114 | 114 | //display_checkbox_matrix($current_group_permissions, $tool, $value); |
115 | - display_checkbox_matrix($current_group_permissions, $tool, $value, $inherited_permissions,$course_admin); |
|
115 | + display_checkbox_matrix($current_group_permissions, $tool, $value, $inherited_permissions, $course_admin); |
|
116 | 116 | } |
117 | - if ($setting_visualisation=='image') |
|
117 | + if ($setting_visualisation == 'image') |
|
118 | 118 | { |
119 | 119 | //display_image_matrix($current_group_permissions, $tool, $value); |
120 | - display_image_matrix($current_group_permissions, $tool, $value,$inherited_permissions, $course_admin); |
|
120 | + display_image_matrix($current_group_permissions, $tool, $value, $inherited_permissions, $course_admin); |
|
121 | 121 | } |
122 | 122 | } |
123 | 123 | // note: in a later stage this part will be replaced by a function |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | } |
131 | 131 | |
132 | 132 | echo "</table>\n"; |
133 | -if ($setting_visualisation=='checkbox') |
|
133 | +if ($setting_visualisation == 'checkbox') |
|
134 | 134 | { |
135 | 135 | echo "<input type=\"Submit\" name=\"StoreGroupPermissions\" value=\"".get_lang('StorePermissions')."\">"; |
136 | 136 | } |