groups.php 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479
  1. <?php
  2. /* For licensing terms, see /chamilo_license.txt */
  3. /**
  4. * @package dokeos.social
  5. * @author Julio Montoya <gugli100@gmail.com>
  6. */
  7. $cidReset=true;
  8. $language_file = array('userInfo');
  9. require_once '../inc/global.inc.php';
  10. require_once api_get_path(LIBRARY_PATH).'usermanager.lib.php';
  11. require_once api_get_path(LIBRARY_PATH).'group_portal_manager.lib.php';
  12. require_once api_get_path(LIBRARY_PATH).'social.lib.php';
  13. require_once api_get_path(LIBRARY_PATH).'message.lib.php';
  14. require_once api_get_path(LIBRARY_PATH).'text.lib.php';
  15. require_once api_get_path(LIBRARY_PATH).'mail.lib.inc.php';
  16. api_block_anonymous_users();
  17. $this_section = SECTION_SOCIAL;
  18. $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.js" type="text/javascript" language="javascript"></script>'; //jQuery
  19. $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/thickbox.js" type="text/javascript" language="javascript"></script>';
  20. $htmlHeadXtra[] = '<link rel="stylesheet" href="'.api_get_path(WEB_LIBRARY_PATH).'javascript/thickbox.css" type="text/css" media="projection, screen">';
  21. // prepare anchor for message group topic
  22. $anchor = '';
  23. if (isset($_GET['anchor_topic'])) {
  24. $anchor = Security::remove_XSS($_GET['anchor_topic']);
  25. } else {
  26. $match = 0;
  27. $param_names = array_keys($_GET);
  28. foreach ($param_names as $param) {
  29. if (preg_match('/^items_(\d)_page_nr$/', $param, $match)) {
  30. break;
  31. }
  32. }
  33. $anchor = 'topic_'.$match[1];
  34. }
  35. $htmlHeadXtra[] = '<script type="text/javascript">
  36. var counter_image = 1;
  37. function remove_image_form(id_elem1) {
  38. var elem1 = document.getElementById(id_elem1);
  39. elem1.parentNode.removeChild(elem1);
  40. counter_image--;
  41. var filepaths = document.getElementById("filepaths");
  42. if (filepaths.childNodes.length < 3) {
  43. var link_attach = document.getElementById("link-more-attach");
  44. if (link_attach) {
  45. link_attach.innerHTML=\'<a href="javascript://" onclick="return add_image_form()">'.get_lang('AddOneMoreFile').'</a>&nbsp;('.get_lang('MaximunFileSizeXMB').')\';
  46. }
  47. }
  48. }
  49. function add_image_form() {
  50. // Multiple filepaths for image form
  51. var filepaths = document.getElementById("filepaths");
  52. if (document.getElementById("filepath_"+counter_image)) {
  53. counter_image = counter_image + 1;
  54. } else {
  55. counter_image = counter_image;
  56. }
  57. var elem1 = document.createElement("div");
  58. elem1.setAttribute("id","filepath_"+counter_image);
  59. filepaths.appendChild(elem1);
  60. id_elem1 = "filepath_"+counter_image;
  61. id_elem1 = "\'"+id_elem1+"\'";
  62. document.getElementById("filepath_"+counter_image).innerHTML = "<input type=\"file\" name=\"attach_"+counter_image+"\" size=\"20\" />&nbsp;<a href=\"javascript:remove_image_form("+id_elem1+")\"><img src=\"'.api_get_path(WEB_CODE_PATH).'img/delete.gif\"></a>";
  63. if (filepaths.childNodes.length == 3) {
  64. var link_attach = document.getElementById("link-more-attach");
  65. if (link_attach) {
  66. link_attach.innerHTML="";
  67. }
  68. }
  69. }
  70. function validate_text_empty (str,msg) {
  71. var str = str.replace(/^\s*|\s*$/g,"");
  72. if (str.length == 0) {
  73. alert(msg);
  74. return true;
  75. }
  76. }
  77. jQuery(document).ready(function() {
  78. var valor = "'.$anchor.'";
  79. $(".head").click(function() {
  80. $(this).next().next().slideToggle("fast");
  81. image_clicked = $("#" + this.id + " img").attr("src");
  82. image_clicked_info = image_clicked.split("/");
  83. image_real_clicked = image_clicked_info[image_clicked_info.length-1];
  84. image_path = image_clicked.split("img");
  85. current_path = image_path[0]+"img/";
  86. if (image_real_clicked == "div_show.gif") {
  87. current_path = current_path+"div_hide.gif";
  88. $("#" + this.id + " img").attr("src", current_path);
  89. } else {
  90. current_path = current_path+"div_show.gif";
  91. $("#" + this.id + " img").attr("src", current_path)
  92. }
  93. return false;
  94. }).next().next().hide();
  95. // anchor for current topic
  96. if (valor) {
  97. $("#"+valor).show();
  98. window.location = document.URL+"#"+valor;
  99. }
  100. });
  101. function show_icon_edit(element_html) {
  102. ident="#edit_image";
  103. $(ident).show();
  104. }
  105. function hide_icon_edit(element_html) {
  106. ident="#edit_image";
  107. $(ident).hide();
  108. }
  109. </script>';
  110. $allowed_views = array('mygroups','newest','pop');
  111. $interbreadcrumb[]= array ('url' =>'home.php','name' => get_lang('Social'));
  112. if (isset($_GET['view']) && in_array($_GET['view'],$allowed_views)) {
  113. if ($_GET['view'] == 'mygroups') {
  114. $interbreadcrumb[]= array ('url' =>'groups.php','name' => get_lang('Groups'));
  115. $interbreadcrumb[]= array ('url' =>'#','name' => get_lang('MyGroups'));
  116. } else if ( $_GET['view'] == 'newest') {
  117. $interbreadcrumb[]= array ('url' =>'groups.php','name' => get_lang('Groups'));
  118. $interbreadcrumb[]= array ('url' =>'#','name' => get_lang('Newest'));
  119. } else {
  120. $interbreadcrumb[]= array ('url' =>'groups.php','name' => get_lang('Groups'));
  121. $interbreadcrumb[]= array ('url' =>'#','name' => get_lang('Popular'));
  122. }
  123. } else {
  124. $interbreadcrumb[]= array ('url' =>'groups.php','name' => get_lang('Groups'));
  125. $interbreadcrumb[]= array ('url' =>'#','name' => get_lang('MessageList'));
  126. }
  127. Display :: display_header($tool_name, 'Groups');
  128. // save message group
  129. if (isset($_POST['token']) && $_POST['token'] === $_SESSION['sec_token']) {
  130. if (isset($_POST['action'])) {
  131. $title = $_POST['title'];
  132. $content = $_POST['content'];
  133. $group_id = intval($_POST['group_id']);
  134. $parent_id = intval($_POST['parent_id']);
  135. if ($_POST['action'] == 'edit_message_group') {
  136. $edit_message_id = intval($_POST['message_id']);
  137. $res = MessageManager::send_message(0, $title, $content, $_FILES, '', $group_id, $parent_id, $edit_message_id);
  138. } else {
  139. $res = MessageManager::send_message(0, $title, $content, $_FILES, '', $group_id, $parent_id);
  140. }
  141. // display error messages
  142. if (is_string($res)) {
  143. Display::display_error_message($res);
  144. }
  145. if ($res === true) {
  146. $groups_user = GroupPortalManager::get_users_by_group($group_id);
  147. $group_info = GroupPortalManager::get_group_data($group_id);
  148. $admin_user_info = api_get_user_info(1);
  149. $sender_name = api_get_person_name($admin_user_info['firstName'], $admin_user_info['lastName'], null, PERSON_NAME_EMAIL_ADDRESS);
  150. $sender_email = $admin_user_info['mail'];
  151. $subject = sprintf(get_lang('ThereIsANewMessageInTheGroupX'),$group_info['name']);
  152. $link = api_get_path(WEB_PATH).'main/social/groups?'.$_SERVER['QUERY_STRING'];
  153. $text_link = '<a href="'.$link.'">'.get_lang('ClickHereToSeeMessageGroup')."</a><br />\r\n<br />\r\n".get_lang('OrCopyPasteTheFollowingUrl')." <br />\r\n ".$link;
  154. $message = sprintf(get_lang('YouHaveReceivedANewMessageInTheGroupX'),$group_info['name'])."<br />$text_link";
  155. foreach ($groups_user as $group_user) {
  156. if ($group_user == $current_user) continue;
  157. $group_user_info = api_get_user_info($group_user['user_id']);
  158. $recipient_name = api_get_person_name($group_user_info['firstName'], $group_user_info['lastName'], null, PERSON_NAME_EMAIL_ADDRESS);
  159. $recipient_email = $group_user_info['mail'];
  160. @api_mail_html($recipient_name, $recipient_email, stripslashes($subject), $message, $sender_name, $sender_email);
  161. }
  162. }
  163. Security::clear_token();
  164. }
  165. }
  166. // getting group information
  167. $group_id = intval($_GET['id']);
  168. $relation_group_title = '';
  169. $my_group_role = 0;
  170. if ($group_id != 0 ) {
  171. $user_leave_message = false;
  172. $user_added_group_message = false;
  173. $group_info = GroupPortalManager::get_group_data($group_id);
  174. if (isset($_GET['action']) && $_GET['action']=='leave') {
  175. $user_leaved = intval($_GET['u']);
  176. //I can "leave me myself"
  177. if (api_get_user_id() == $user_leaved) {
  178. GroupPortalManager::delete_user_rel_group($user_leaved, $group_id);
  179. $user_leave_message = true;
  180. }
  181. }
  182. // add a user to a group if its open
  183. if (isset($_GET['action']) && $_GET['action']=='join') {
  184. // we add a user only if is a open group
  185. $user_join = intval($_GET['u']);
  186. if (api_get_user_id() == $user_join && !empty($group_id)) {
  187. if ($group_info['visibility'] == GROUP_PERMISSION_OPEN) {
  188. GroupPortalManager::add_user_to_group($user_join, $group_id);
  189. $user_added_group_message = true;
  190. } else {
  191. GroupPortalManager::add_user_to_group($user_join, $group_id, GROUP_USER_PERMISSION_PENDING_INVITATION_SENT_BY_USER);
  192. $user_added_group_message = true;
  193. }
  194. }
  195. }
  196. }
  197. echo '<div id="social-content">';
  198. echo '<div id="social-content-left">';
  199. //this include the social menu div
  200. if ($group_id != 0 ) {
  201. SocialManager::show_social_menu('groups',$group_id);
  202. } else {
  203. $show_menu = 'groups';
  204. if (isset($_GET['view']) && $_GET['view'] == 'mygroups') {
  205. $show_menu = $_GET['view'];
  206. }
  207. SocialManager::show_social_menu($show_menu);
  208. }
  209. echo '</div>';
  210. echo '<div id="social-content-right">';
  211. if ($group_id != 0 ) {
  212. $group_info = GroupPortalManager::get_group_data($group_id);
  213. //Loading group information
  214. if (isset($_GET['status']) && $_GET['status']=='sent') {
  215. Display::display_confirmation_message(get_lang('MessageHasBeenSent'), false);
  216. }
  217. if ($user_leave_message) {
  218. Display::display_confirmation_message(get_lang('UserIsNotSubscribedToThisGroup'), false);
  219. }
  220. if ($user_added_group_message) {
  221. Display::display_confirmation_message(get_lang('UserIsSubscribedToThisGroup'), false);
  222. }
  223. // details about the current group
  224. echo '<div class="head_group">';
  225. echo '<div id="social-group-details">';
  226. //Group's title
  227. echo '<h2><a href="groups.php?id='.$group_id.'">'.$group_info['name'].'</a></h2>';
  228. //Group's description
  229. echo '<div class="social-group-details-info">'.$group_info['description'].'</div>';
  230. echo '<div class="social-group-details-info"><a target="_blank" href="'.$group_info['url'].'">'.$group_info['url'].'</a></div>';
  231. //Privacy
  232. echo '<div class="social-group-details-info">';
  233. echo '<span>'.get_lang('Privacy').' : </span>';
  234. if ($group_info['visibility']== GROUP_PERMISSION_OPEN) {
  235. echo get_lang('ThisIsAnOpenGroup');
  236. } elseif ($group_info['visibility']== GROUP_PERMISSION_CLOSED) {
  237. echo get_lang('ThisIsACloseGroup');
  238. }
  239. echo '</div>';
  240. if (!empty($relation_group_title)) {
  241. echo '<div class="social-group-details-info">';
  242. echo '<span>'.get_lang('StatusInThisGroup').' : </span>';
  243. echo $relation_group_title;
  244. echo '</div>';
  245. }
  246. //Group's tags
  247. if (!empty($tags)) {
  248. echo '<div id="social-group-details-info"><span>'.get_lang('Tags').' : </span>'.$tags.'</div>';
  249. }
  250. echo '</div>';
  251. echo '</div>';
  252. echo '<div class="clear"></div>';
  253. //-- Show message groups
  254. echo '<div class="messages">';
  255. if (GroupPortalManager::is_group_member($group_id)) {
  256. echo '<h3>'.get_lang('Topics').'</h3>';
  257. $content = MessageManager::display_messages_for_group($group_id);
  258. if (!empty($content)) {
  259. echo $content;
  260. } else {
  261. echo '<a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?view_panel=1&height=400&width=610&&user_friend='.api_get_user_id().'&group_id='.$group_id.'&action=add_message_group" class="thickbox" title="'.get_lang('ComposeMessage').'">'.Display::return_icon('compose_message.png', get_lang('NewTopic'), array('hspace'=>'6')).'<span class="social-menu-text4" >'.get_lang('YouShouldCreateATopic').'</span></a></li>';
  262. }
  263. } else {
  264. // if I already sent an invitation message
  265. if (!in_array($my_group_role, array(GROUP_USER_PERMISSION_PENDING_INVITATION_SENT_BY_USER, GROUP_USER_PERMISSION_PENDING_INVITATION))) {
  266. echo '<a href="groups.php?id='.$group_id.'&action=join&u='.api_get_user_id().'">'.Display::return_icon('group_join.png', get_lang('YouShouldJoinTheGroup'), array('hspace'=>'6')).'<span class="social-menu-text4" >'.get_lang('YouShouldJoinTheGroup').'</a></span>';
  267. } elseif ($my_group_role == GROUP_USER_PERMISSION_PENDING_INVITATION) {
  268. echo '<a href="groups.php?id='.$group_id.'&action=join&u='.api_get_user_id().'">'.Display::return_icon('group_join.png', get_lang('YouHaveBeenInvitedJoinNow'), array('hspace'=>'6')).'<span class="social-menu-text4" >'.get_lang('YouHaveBeenInvitedJoinNow').'</span></a>';
  269. }
  270. }
  271. echo '</div>'; // end layout messages
  272. } else {
  273. // My groups -----
  274. $results = GroupPortalManager::get_groups_by_user(api_get_user_id(), 0);
  275. $grid_my_groups = array();
  276. if (is_array($results) && count($results) > 0) {
  277. foreach ($results as $result) {
  278. $id = $result['id'];
  279. $url_open = '<a href="groups.php?id='.$id.'">';
  280. $url_close = '</a>';
  281. $name = api_strtoupper(cut($result['name'],25,true));
  282. if ($result['relation_type'] == GROUP_USER_PERMISSION_ADMIN) {
  283. $name .= Display::return_icon('admin_star.png', get_lang('Admin'), array('style'=>'vertical-align:middle'));
  284. } elseif ($result['relation_type'] == GROUP_USER_PERMISSION_MODERATOR) {
  285. $name .= Display::return_icon('moderator_star.png', get_lang('Moderator'), array('style'=>'vertical-align:middle'));
  286. }
  287. $count_users_group = count(GroupPortalManager::get_users_by_group($id, false, array(GROUP_USER_PERMISSION_ADMIN, GROUP_USER_PERMISSION_READER, GROUP_USER_PERMISSION_MODERATOR), 0 , 1000));
  288. if ($count_users_group == 1 ) {
  289. $count_users_group = $count_users_group.' '.get_lang('Member');
  290. } else {
  291. $count_users_group = $count_users_group.' '.get_lang('Members');
  292. }
  293. $picture = GroupPortalManager::get_picture_group($result['id'], $result['picture_uri'],80);
  294. $result['picture_uri'] = '<img class="social-groups-image" src="'.$picture['file'].'" hspace="4" height="50" border="2" align="left" width="50" />';
  295. $grid_item_1 = Display::return_icon('boxmygroups.jpg');
  296. $item_1 = '<div>'.$url_open.$result['picture_uri'].'<p class="social-groups-text1"><strong>'.$name.'<br />('.$count_users_group.')</strong></p>'.$url_close.Display::return_icon('linegroups.jpg','').'</div>';
  297. $item_2 = '';
  298. $item_3 = '';
  299. if ($result['description'] != '') {
  300. $item_2 = '<div class="box_description_group_title" ><span class="social-groups-text2">'.get_lang('Description').'</span></div>';
  301. $item_3 = '<div class="box_description_group_content" >'.cut($result['description'],100,true).'</div>';
  302. } else {
  303. $item_2 = '<div class="box_description_group_title" ><span class="social-groups-text2"></span></div>';
  304. $item_3 = '<div class="box_description_group_content" ></div>';
  305. }
  306. $item_4 = '<div class="box_description_group_actions" >'.$url_open.get_lang('SeeMore').$url_close.'</div>';
  307. $grid_item_2 = $item_1.$item_2.$item_3.$item_4;
  308. $grid_my_groups[]= array($grid_item_1,$grid_item_2);
  309. }
  310. }
  311. // Newest groups --------
  312. $results = GroupPortalManager::get_groups_by_age(4,false);
  313. $grid_newest_groups = array();
  314. foreach ($results as $result) {
  315. $id = $result['id'];
  316. $url_open = '<a href="groups.php?id='.$id.'">';
  317. $url_close = '</a>';
  318. $count_users_group = count(GroupPortalManager::get_users_by_group($id, false, array(GROUP_USER_PERMISSION_ADMIN, GROUP_USER_PERMISSION_READER, GROUP_USER_PERMISSION_MODERATOR), 0 , 1000));
  319. if ($count_users_group == 1 ) {
  320. $count_users_group = $count_users_group.' '.get_lang('Member');
  321. } else {
  322. $count_users_group = $count_users_group.' '.get_lang('Members');
  323. }
  324. $name = api_strtoupper(cut($result['name'],30,true));
  325. $picture = GroupPortalManager::get_picture_group($result['id'], $result['picture_uri'],80);
  326. $result['picture_uri'] = '<img class="social-groups-image" src="'.$picture['file'].'" hspace="4" height="50" border="2" align="left" width="50" />';
  327. $grid_item_1 = Display::return_icon('boxmygroups.jpg');
  328. $item_1 = '<div>'.$url_open.$result['picture_uri'].'<p class="social-groups-text1"><strong>'.$name.'<br />('.$count_users_group.')</strong></p>'.$url_close.Display::return_icon('linegroups.jpg','').'</div>';
  329. if ($result['description'] != '') {
  330. $item_2 = '<div class="box_description_group_title" ><span class="social-groups-text2">'.get_lang('Description').'</span></div>';
  331. $item_3 = '<div class="box_description_group_content" >'.cut($result['description'],100,true).'</div>';
  332. } else {
  333. $item_2 = '<div class="box_description_group_title" ><span class="social-groups-text2"></span></div>';
  334. $item_3 = '<div class="box_description_group_content" ></div>';
  335. }
  336. $item_4 = '<div class="box_description_group_actions" >'.$url_open.get_lang('SeeMore').$url_close.'</div>';
  337. $grid_item_2 = $item_1.$item_2.$item_3.$item_4;
  338. $grid_newest_groups[]= array($grid_item_1,$grid_item_2);
  339. }
  340. // Pop groups -----
  341. $results = GroupPortalManager::get_groups_by_popularity(4,false);
  342. $grid_pop_groups = array();
  343. if (is_array($results) && count($results) > 0) {
  344. foreach ($results as $result) {
  345. $id = $result['id'];
  346. $url_open = '<a href="groups.php?id='.$id.'">';
  347. $url_close = '</a>';
  348. $count_users_group = count(GroupPortalManager::get_users_by_group($id, false, array(GROUP_USER_PERMISSION_ADMIN, GROUP_USER_PERMISSION_READER, GROUP_USER_PERMISSION_MODERATOR), 0 , 1000));
  349. if ($count_users_group == 1 ) {
  350. $count_users_group = $count_users_group.' '.get_lang('Member');
  351. } else {
  352. $count_users_group = $count_users_group.' '.get_lang('Members');
  353. }
  354. $name = api_strtoupper(cut($result['name'],30,true));
  355. $picture = GroupPortalManager::get_picture_group($result['id'], $result['picture_uri'],80);
  356. $result['picture_uri'] = '<img class="social-groups-image" src="'.$picture['file'].'" hspace="4" height="50" border="2" align="left" width="50" />';
  357. $grid_item_1 = Display::return_icon('boxmygroups.jpg');
  358. $item_1 = '<div>'.$url_open.$result['picture_uri'].'<p class="social-groups-text1"><strong>'.$name.'<br />('.$count_users_group.')</strong></p>'.$url_close.Display::return_icon('linegroups.jpg').'</div>';
  359. if ($result['description'] != '') {
  360. $item_2 = '<div class="box_description_group_title" ><span class="social-groups-text2">'.get_lang('Description').'</span></div>';
  361. $item_3 = '<div class="box_description_group_content" >'.cut($result['description'],100,true).'</div>';
  362. } else {
  363. $item_2 = '<div class="box_description_group_title" ><span class="social-groups-text2"></span></div>';
  364. $item_3 = '<div class="box_description_group_content" ></div>';
  365. }
  366. $item_4 = '<div class="box_description_group_actions" >'.$url_open.get_lang('SeeMore').$url_close.'</div>';
  367. $grid_item_2 = $item_1.$item_2.$item_3.$item_4;
  368. $grid_pop_groups[]= array($grid_item_1,$grid_item_2);
  369. }
  370. }
  371. // display groups (newest, mygroups, pop)
  372. echo '<div class="social-box-main1">';
  373. if (isset($_GET['view']) && in_array($_GET['view'],$allowed_views)) {
  374. $view_group = $_GET['view'];
  375. switch ($view_group) {
  376. case 'mygroups' :
  377. if (count($grid_my_groups) > 0) {
  378. echo '<div class="social-groups-text3">'.api_strtoupper(get_lang('MyGroups')).'</div>';
  379. Display::display_sortable_grid('mygroups', array(), $grid_my_groups, array('hide_navigation'=>true, 'per_page' => 2), $query_vars, false, array(true, true, true,false));
  380. }
  381. break;
  382. case 'newest' :
  383. if (count($grid_newest_groups) > 0) {
  384. echo '<div class="social-groups-text3">'.api_strtoupper(get_lang('Newest')).'</div>';
  385. Display::display_sortable_grid('newest', array(), $grid_newest_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true,false));
  386. }
  387. break;
  388. default :
  389. if (count($grid_pop_groups) > 0) {
  390. echo '<div class="social-groups-text3">'.api_strtoupper(get_lang('Popular')).'</div>';
  391. Display::display_sortable_grid('popular', array(), $grid_pop_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true,true,true));
  392. }
  393. break;
  394. }
  395. } else {
  396. if (count($grid_my_groups) > 0) {
  397. echo '<div class="social-groups-text3">'.api_strtoupper(get_lang('MyGroups')).'</div>';
  398. Display::display_sortable_grid('mygroups', array(), $grid_my_groups, array('hide_navigation'=>true, 'per_page' => 2), $query_vars, false, array(true, true, true,false));
  399. }
  400. if (count($grid_newest_groups) > 0) {
  401. echo '<div class="social-groups-text3">'.api_strtoupper(get_lang('Newest')).'</div>';
  402. Display::display_sortable_grid('newest', array(), $grid_newest_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true,false));
  403. }
  404. if (count($grid_pop_groups) > 0) {
  405. echo '<div class="social-groups-text3">'.api_strtoupper(get_lang('Popular')).'</div>';
  406. Display::display_sortable_grid('popular', array(), $grid_pop_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true,true,true));
  407. }
  408. }
  409. echo '</div>';
  410. }
  411. echo '</div>';
  412. echo '</div>';
  413. Display :: display_footer();