(no commit message)

skala
Cristian Fasanando 16 years ago
parent fe932f5723
commit acdb0e295b
  1. 231
      main/css/blue_lagoon/default.css
  2. BIN
      main/img/boxmygroups.jpg
  3. BIN
      main/img/boxmygroupscontent.jpg
  4. BIN
      main/img/line-social.jpg
  5. BIN
      main/img/linegroups.jpg
  6. 21
      main/inc/lib/group_portal_manager.lib.php
  7. 57
      main/inc/lib/message.lib.php
  8. 44
      main/inc/lib/social.lib.php
  9. 176
      main/social/groups.php
  10. 5
      main/social/message_for_group_form.inc.php

@ -2156,6 +2156,21 @@ div.comments {
font-weight:bolder;
vertical-align:middle;
}
.actions-title-groups {
//background:#efefef;
//border-bottom:1px dotted #999999;
//border-top:1px dotted #999999;
padding-left:0px;
padding-right:0px;
padding-top: 4px;
padding-bottom: 4px;
margin-bottom: 5px;
font-size:14px;
font-weight:bolder;
vertical-align:middle;
}
/**********************************************
* MESSAGE TOOL *
**********************************************/
@ -2352,6 +2367,27 @@ div.image-social-content center.friend {
width:30%;
margin-left: 4px;
}
#socialContent{
width:100%;
height:auto;
overflow:hidden;
margin-left:auto;
margin-right:auto;
}
#socialContentRigth{
height:auto;
float:rigth;
overflow:hidden;
}
#socialContentLeft {
float:left;
height:auto;
margin-right:16px;
min-height:300px;
width:160px;
overflow:hidden;
}
/*****************************************************
* BUTTONS *
*****************************************************/
@ -2847,47 +2883,74 @@ a.unread {
.groups_grid_element_2 { width:150px; float:left;}
/*POPULAR GROUP*/
.popular_grid_container { width:100%;}
.popular_grid_item {
border:1px dotted #CCCCCC;
float:left;
height:90px;
margin:5px;
padding:5px;
width:500px;
width:350px;
height:165px;
margin-top:20px;
}
.popular_grid_element_1 {
width:330px;
height:165px;
padding-left:10px;
padding-right:10px;
background-image:url(../../img/boxmygroupscontent.jpg);
background-repeat:repeat-y;
overflow:hidden;
}
.popular_grid_element_0 { width:100px; float:left; text-align:center; margin-bottom:5px;}
.popular_grid_element_1 { width:350px; float:left; text-align:left; margin-bottom:1px; padding:1px;}
.popular_grid_element_2 { width:200px; float:left;}
.popular_grid_element_3 { width:200px; float:left; text-align:justify;}
/*NEWEST GROUP*/
.newest_grid_container { width:100%;}
.newest_grid_item {
border:1px dotted #CCCCCC;
float:left;
height:90px;
margin:5px;
padding:5px;
width:500px;
width:350px;
height:165px;
margin-top:20px;
}
.newest_grid_element_1 {
width:330px;
height:165px;
padding-left:10px;
padding-right:10px;
background-image:url(../../img/boxmygroupscontent.jpg);
background-repeat:repeat-y;
overflow:hidden;
}
.newest_grid_element_0 { width:100px; float:left; text-align:center; margin-bottom:5px;}
.newest_grid_element_1 { width:350px; float:left; text-align:left; margin-bottom:1px; padding:1px;}
.newest_grid_element_2 { width:400px; float:left; text-align:justify;}
/*MY GROUPS*/
.mygroups_grid_container { width:100%;}
.mygroups_grid_item {
border:1px dotted #CCCCCC;
float:left;
height:90px;
margin:5px;
padding:5px;
width:500px;
width:350px;
height:165px;
margin-top:20px;
}
.mygroups_grid_element_0 { width:100px; float:left; text-align:center; margin-bottom:5px;}
.mygroups_grid_element_1 { width:350px; float:left; text-align:left; margin-bottom:1px; padding:1px;}
.mygroups_grid_element_2 { width:400px; float:left; text-align:justify;}
.mygroups_grid_element_1 {
width:330px;
height:165px;
padding-left:10px;
padding-right:10px;
background-image:url(../../img/boxmygroupscontent.jpg);
background-repeat:repeat-y;
overflow:hidden;
}
.box_description_group_title {
float:right;width:80%;
}
.box_description_group_content {
float:right;width:80%;height:40px;
}
.box_description_group_actions {
float:right;width:80%;text-align:right;margin-top:4px;
}
//.mygroups_grid_element_2 { width:400px; float:left; text-align:justify;}
/*PROFILE*/
.profile_grid_container { width:100%;}
@ -3022,6 +3085,118 @@ a.unread {
float:right;
}
/* SOCIAL MENU VERTICAL */
.socialMenu {
width:150px;
height:auto;
}
.socialMenu ul {
list-style-image:none;
list-style-position:outside;
list-style-type:none;
margin:0;
padding:0px;
}
.socialMenu li {
margin-bottom:8px;
padding-bottom:4px;
background-image:url(../../img/line-social.jpg);
background-position:bottom;
background-repeat:repeat-x;
}
.socialMenu ul li a{
padding:2px 0px;
}
.socialMenuSubLevel {
margin-left:20px;}
.menuTitle{
width:150px;
float:left;
height:20px;
background-color:#32578b;
margin-bottom:10px;
}
.TitleRigth{
width:88%;
float:right;
height:20px;
background-color:#32578b;
margin-bottom:10px;
}
.menuTex1{
color:#fff;
font-size:14px;
font-weight:normal;
}
.menuTex2{
color:#000;
font-weight:normal;
font-size:12px;
}
.menuTex3{
color:#94cdf9;
font-weight:normal;
font-size:12px;
font-weight:bold;
}
/*BOX MY GROPUPS*/
#boxmyGroups{
height:auto;
overflow:hidden;
}
#boxmyGroupsLeft{
width:100%;
//float:left;
height:auto;
}
#boxmyGroupsRigth{
width:350px;
float:left;
height:auto;
}
.boxMygroupsContent {
width:350px;
height:auto;
margin-top:20px;
}
.myGroupsContent{
width:330px;
height:auto;
overflow:hidden;
padding-left:10px;
padding-right:10px;
background-image:url(../../img/boxmygroupscontent.jpg);
background-repeat:repeat-y;
overflow:hidden;
}
.imageGroups{
border: 2px solid #cac9c9;
}
.groupTex1{
font-family:Verdana, Geneva, sans-serif;
font-size:12px;
color:#686868;
}
.groupText2{
font-family:Verdana, Geneva, sans-serif;
font-size:12px;
color:#666699;
}
/* INVITATIONS */
.invitation_confirm {

Binary file not shown.

After

Width:  |  Height:  |  Size: 930 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 503 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 313 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

@ -206,8 +206,8 @@ class GroupPortalManager
while ($row = Database::fetch_array($result, 'ASSOC')) {
if ($with_image == true) {
$picture = self::get_picture_group($row['id'], $row['picture_uri'],80);
$img = '<img src="'.$picture['file'].'" />';
$row['picture_uri'] = $img;
//$img = '<img class="imageGroups" src="'.$picture['file'].'" hspace="4" height="44" border="2" align="left" width="44" />';
$row['picture_uri'] = $picture['file'];
}
$array[$row['id']] = $row;
}
@ -233,7 +233,6 @@ class GroupPortalManager
}
// only show admins and readers
$where_relation_condition = " WHERE gu.relation_type IN ('".GROUP_USER_PERMISSION_ADMIN."' , '".GROUP_USER_PERMISSION_READER."') ";
$sql = "SELECT count(user_id) as count, g.picture_uri, g.name, g.description, g.id
FROM $tbl_group g
INNER JOIN $table_group_rel_user gu
@ -244,8 +243,8 @@ class GroupPortalManager
while ($row = Database::fetch_array($result, 'ASSOC')) {
if ($with_image == true) {
$picture = self::get_picture_group($row['id'], $row['picture_uri'],80);
$img = '<img src="'.$picture['file'].'" />';
$row['picture_uri'] = $img;
//$img = '<img src="'.$picture['file'].'" />';
$row['picture_uri'] = $picture['file'];
}
$array[$row['id']] = $row;
}
@ -276,12 +275,12 @@ class GroupPortalManager
$result=Database::query($sql,__FILE__,__LINE__);
$array = array();
while ($row = Database::fetch_array($result, 'ASSOC')) {
if ($with_image == true) {
$picture = self::get_picture_group($row['id'], $row['picture_uri'],80);
$img = '<img src="'.$picture['file'].'" />';
$row['picture_uri'] = $img;
}
$array[$row['id']] = $row;
if ($with_image == true) {
$picture = self::get_picture_group($row['id'], $row['picture_uri'],80);
//$img = '<img src="'.$picture['file'].'" />';
$row['picture_uri'] = $picture['file'];
}
$array[$row['id']] = $row;
}
return $array;
}

@ -877,7 +877,8 @@ class MessageManager
$name = api_get_person_name($user_sender_info['firstname'], $user_sender_info['lastname']);
$html .= '<div class="message-topic" >';
$html .= '<a href="#" class="head" id="head_'.$topic['id'].'">
'.Display::return_icon('div_show.gif',get_lang('Show'),array('style'=>'vertical-align: middle')).'
'.((isset($_GET['div_id']) && $_GET['div_id'] == 'content_'.$topic['id'])?Display::return_icon('div_hide.gif',get_lang('Hide'),array('style'=>'vertical-align: middle')):
Display::return_icon('div_show.gif',get_lang('Show'),array('style'=>'vertical-align: middle'))).'
<span class="message-group-title-topic">'.$topic['title'].'</span>';
//$html .= '<span class="message-group-date">('.get_lang('PostIn').' '.date_to_str_ago($topic['send_date']).($topic['send_date']!=$topic['update_date']?' - '.get_lang('LastUpdate').' '.date_to_str_ago($topic['send_date']):'').')</span>';
$html .= '</a>';
@ -891,13 +892,14 @@ class MessageManager
}
$html .= '<div>';
$html .= '<div id="content_'.$topic['id'].'">';
$html .= '<a name="content_'.$topic['id'].'"></a>';
$html.= '<div style="margin-left: '.$indent.'px;margin-bottom:10px">';
$html.= '<div id="message-reply-link" style="margin-right:10px">
<a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?view_panel=1&height=390&width=610&&user_friend='.$current_user_id.'&group_id='.$group_id.'&message_id='.$topic['id'].'&action=reply_message_group" class="thickbox" title="'.get_lang('Reply').'">'.Display :: return_icon('forumthread_new.gif', get_lang('Reply')).'</a>';
<a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?view_panel=1&height=390&width=610&&user_friend='.$current_user_id.'&group_id='.$group_id.'&message_id='.$topic['id'].'&action=reply_message_group&div_id=content_'.$topic['id'].'&page_nr='.Security::remove_XSS($_GET['page_nr']).'&page_item_nr='.Security::remove_XSS($_GET['page_item_nr']).'" class="thickbox" title="'.get_lang('Reply').'">'.Display :: return_icon('forumthread_new.gif', get_lang('Reply')).'</a>';
if ($topic['user_sender_id'] == $current_user_id) {
$html.= '&nbsp;&nbsp;<a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?view_panel=1&height=390&width=610&&user_friend='.$current_user_id.'&group_id='.$group_id.'&message_id='.$topic['id'].'&action=edit_message_group" class="thickbox" title="'.get_lang('Edit').'">'.Display :: return_icon('edit.gif', get_lang('Edit')).'</a>';
$html.= '&nbsp;&nbsp;<a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?view_panel=1&height=390&width=610&&user_friend='.$current_user_id.'&group_id='.$group_id.'&message_id='.$topic['id'].'&action=edit_message_group&div_id=content_'.$topic['id'].'&page_nr='.Security::remove_XSS($_GET['page_nr']).'&page_item_nr='.Security::remove_XSS($_GET['page_item_nr']).'" class="thickbox" title="'.get_lang('Edit').'">'.Display :: return_icon('edit.gif', get_lang('Edit')).'</a>';
}
$html.= '</div>';
@ -907,18 +909,33 @@ class MessageManager
//$html.= '<div class="message-group-date">'.get_lang('PostIn').' '.date_to_str_ago($topic['send_date']).'</div>';
$html.= '<div class="message-attach">'.(!empty($files_attachments)?implode('&nbsp;|&nbsp;',$files_attachments):'').'</div>';
$html.= '</div>';
// items
if (is_array($topic['items'])) {
foreach ($topic['items'] as $item) {
// pager items
$page_item = isset($_GET['page_item_nr'])?intval($_GET['page_item_nr']):1;
$total_items = count($topic['items']);
$items_per_page = 3;
$div_content = 'content_'.$topic['id'];
$pager_items = self::get_pager_for_message_group($group_id,$page_item,$total_items,$items_per_page,true,$div_content);
$html .= ' <div class="pager">
<table width="100%">
<tr><td style="width:25%">&nbsp;</td><td style="text-align:center">'.$pager_items['details'].'</td><td style="text-align:right;width:25%">'.$pager_items['links'].'</td></tr></table></div>';
$topic_slice['items'] = array_slice($topic['items'],($page_item-1)*($items_per_page),$items_per_page);
foreach ($topic_slice['items'] as $item) {
$indent = $item['indent_cnt']*'15';
$user_sender_info = UserManager::get_user_info_by_id($item['user_sender_id']);
$files_attachments = self::get_links_message_attachment_files($item['id']);
$name = api_get_person_name($user_sender_info['firstname'], $user_sender_info['lastname']);
$html.= '<div class="message-item" style="margin-left: '.$indent.'px;">';
$html.= '<div id="message-reply-link">
<a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?view_panel=1&height=390&width=610&&user_friend='.api_get_user_id().'&group_id='.$group_id.'&message_id='.$item['id'].'&action=reply_message_group" class="thickbox" title="'.get_lang('Reply').'">'.Display :: return_icon('forumthread_new.gif', get_lang('Reply')).'</a>';
<a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?view_panel=1&height=390&width=610&&user_friend='.api_get_user_id().'&group_id='.$group_id.'&message_id='.$item['id'].'&action=reply_message_group&div_id=content_'.$topic['id'].'&page_nr='.Security::remove_XSS($_GET['page_nr']).'&page_item_nr='.Security::remove_XSS($_GET['page_item_nr']).'" class="thickbox" title="'.get_lang('Reply').'">'.Display :: return_icon('forumthread_new.gif', get_lang('Reply')).'</a>';
if ($item['user_sender_id'] == $current_user_id) {
$html.= '&nbsp;&nbsp;<a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?view_panel=1&height=390&width=610&&user_friend='.$current_user_id.'&group_id='.$group_id.'&message_id='.$item['id'].'&action=edit_message_group" class="thickbox" title="'.get_lang('Edit').'">'.Display :: return_icon('edit.gif', get_lang('Edit')).'</a>';
$html.= '&nbsp;&nbsp;<a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?view_panel=1&height=390&width=610&&user_friend='.$current_user_id.'&group_id='.$group_id.'&message_id='.$item['id'].'&action=edit_message_group&div_id=content_'.$topic['id'].'&page_nr='.Security::remove_XSS($_GET['page_nr']).'&page_item_nr='.Security::remove_XSS($_GET['page_item_nr']).'" class="thickbox" title="'.get_lang('Edit').'">'.Display :: return_icon('edit.gif', get_lang('Edit')).'</a>';
}
$html.= '</div>';
$html.= '<div class="message-group-title">'.$item['title'].'&nbsp;</div>';
@ -938,6 +955,12 @@ class MessageManager
$html.= '<div class="message-attach">'.(!empty($files_attachments)?implode('&nbsp;|&nbsp;',$files_attachments):'').'</div>';
$html.= '</div>';
}
// pager items
$html .= ' <div class="pager">
<table width="100%">
<tr><td style="width:25%">&nbsp;</td><td>&nbsp;</td><td style="text-align:right;width:25%">'.$pager_items['links'].'</td></tr></table></div>';
}
$html .= '</div>';
$html .= '</div>';
@ -960,7 +983,7 @@ class MessageManager
* @param int rows per page
* @return array pager with details and links
*/
public static function get_pager_for_message_group($group_id,$page,$num_rows,$rows_per_page) {
public static function get_pager_for_message_group($group_id,$page,$num_rows,$rows_per_page,$pager_items = false,$div_content='') {
$link = '';
$details = '';
@ -984,25 +1007,33 @@ class MessageManager
// get links for pager
$href = api_get_path(WEB_CODE_PATH).'social/groups.php?id='.$group_id;
if ($pager_items) {
$page_topic = isset($_GET['page_nr'])?intval($_GET['page_nr']):1;
$param_name_page_nr = '&page_nr='.$page_topic.'&div_id='.$div_content.'&page_item_nr=';
} else {
$param_name_page_nr = '&page_nr=';
}
if ($page > 1) {
$link .= '<a title="'.get_lang('FirstPage').'" href="'.$href.'&page_nr='.$first_page.'">';
$link .= '<a title="'.get_lang('FirstPage').'" href="'.$href.$param_name_page_nr.$first_page.'">';
$link .= Display::return_icon('first.png',get_lang('FirstPage'),array('style'=>'vertical-align: middle'));
$link .= '</a>';
$link .= '<a title="'.get_lang('PreviousPage').'" href="'.$href.'&page_nr='.($page-1).'">';
$link .= '<a title="'.get_lang('PreviousPage').'" href="'.$href.$param_name_page_nr.($page-1).'">';
$link .= Display::return_icon('prev.png',get_lang('PreviousPage'),array('style'=>'vertical-align: middle'));
$link .= '</a>';
}
$link .= $page.'/'.$last_page;
if ($page < $last_page) {
$link .= '<a title="'.get_lang('NextPage').'" href="'.$href.'&page_nr='.($page+1).'">';
$link .= '<a title="'.get_lang('NextPage').'" href="'.$href.$param_name_page_nr.($page+1).'">';
$link .= Display::return_icon('next.png',get_lang('NextPage'),array('style'=>'vertical-align: middle'));
$link .= '</a>';
$link .= '<a title="'.get_lang('LastPage').'" href="'.$href.'&page_nr='.$last_page.'">';
$link .= '<a title="'.get_lang('LastPage').'" href="'.$href.$param_name_page_nr.$last_page.'">';
$link .= Display::return_icon('last.png',get_lang('PreviousPage'),array('style'=>'vertical-align: middle'));
$link .= '</a>';
}
$pager['links'] = $link;
return $pager;
}

@ -653,7 +653,9 @@ class SocialManager extends UserManager {
}
public static function show_social_menu($show = '' ) {
echo '<div class="social_menu">';
/*
echo '<div class="socialMenu">';
echo '<ul>';
echo '<li>'.get_lang('Menu').'</li>';
echo '<li><a href="'.api_get_path(WEB_PATH).'main/social/home.php">'.Display::return_icon('home.gif').' '.get_lang('Home').'</a></li>';
@ -683,12 +685,42 @@ class SocialManager extends UserManager {
echo '<li><a href="'.api_get_path(WEB_PATH).'main/social/search.php">'.Display::return_icon('search.gif').' '.get_lang('Search').'</a></li>';
//echo '<a href="'.api_get_path(WEB_PATH).'main/auth/profile.php?show=1">'.Display::return_icon('edit.gif').' '.get_lang('EditProfile').'</a>';
/*
echo '<span style="float:right; padding-top:7px;">'.
'<a href="/main/auth/profile.php?show=1">'.Display::return_icon('edit.gif').' '.get_lang('Configuration').'</a>';
'</span>';
*/
//echo '<span style="float:right; padding-top:7px;">'.
// '<a href="/main/auth/profile.php?show=1">'.Display::return_icon('edit.gif').' '.get_lang('Configuration').'</a>';
//'</span>';
echo '</div>';
*/
// Everybody can create groups
if (api_get_setting('allow_students_to_create_groups_in_social') == 'true') {
$create_group_item = '<li class="socialMenuSubLevel"><a href="'.api_get_path(WEB_PATH).'main/social/group_add.php">'.Display::return_icon('edit.gif',get_lang('CreateAgroup'),array('hspace'=>'6')).get_lang('CreateAgroup').'</a></li>';
} else {
// Only admins and teachers can create groups
if (api_is_allowed_to_edit(null,true)) {
$create_group_item = '<li class="socialMenuSubLevel"><a href="'.api_get_path(WEB_PATH).'main/social/group_add.php">'.Display::return_icon('edit.gif',get_lang('CreateAgroup'),array('hspace'=>'6')).get_lang('CreateAgroup').'</a></li>';
}
}
echo '<div class="socialMenu" >
<div>
<ul>
<li><a href="'.api_get_path(WEB_PATH).'main/social/home.php">'.Display::return_icon('home.gif',get_lang('Home'),array('hspace'=>'6')).' '.get_lang('Home').'</a></li>
<li><a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php?f=social">'.Display::return_icon('inbox.png',get_lang('Messages'),array('hspace'=>'6')).' '.get_lang('Messages').'</a></li>
<li><a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'.Display::return_icon('shared_profile.png',get_lang('ViewMySharedProfile'),array('hspace'=>'6')).' '.get_lang('ViewMySharedProfile').'</a></li>
<li><a href="'.api_get_path(WEB_PATH).'main/social/friends.php">'.Display::return_icon('lp_users.png',get_lang('Friends'),array('hspace'=>'6')).' '.get_lang('Friends').'</a></li>
<li><a href="'.api_get_path(WEB_PATH).'main/social/groups.php">'.Display::return_icon('group.gif',get_lang('Groups'),array('hspace'=>'6')).' '.get_lang('Groups').'</a></li>
<ul >
'.$create_group_item.'
<li class="socialMenuSubLevel"><a href="'.api_get_path(WEB_PATH).'main/social/groups.php">'.Display::return_icon('group.gif',get_lang('MyGroups'),array('hspace'=>'6')).get_lang('MyGroups').'</a></li>
</ul>
<li><a href="'.api_get_path(WEB_PATH).'main/social/search.php">'.Display::return_icon('search.gif',get_lang('Search'),array('hspace'=>'6')).' '.get_lang('Search').'</a></li>
</ul>
</div>
</div>';
}

@ -69,26 +69,32 @@ function validate_text_empty (str,msg) {
}
jQuery(document).ready(function() {
$(".head").click(function() {
$(this).next().next().slideToggle("fast");
image_clicked = $("#" + this.id + " img").attr("src");
var valor = "'.Security::remove_XSS($_GET['div_id']).'";
image_clicked_info = image_clicked.split("/");
image_real_clicked = image_clicked_info[image_clicked_info.length-1];
image_path = image_clicked.split("img");
current_path = image_path[0]+"img/";
$(".head").click(function() {
$(this).next().next().slideToggle("fast");
image_clicked = $("#" + this.id + " img").attr("src");
image_clicked_info = image_clicked.split("/");
image_real_clicked = image_clicked_info[image_clicked_info.length-1];
image_path = image_clicked.split("img");
current_path = image_path[0]+"img/";
if (image_real_clicked == "div_show.gif") {
current_path = current_path+"div_hide.gif";
$("#" + this.id + " img").attr("src", current_path);
} else {
current_path = current_path+"div_show.gif";
$("#" + this.id + " img").attr("src", current_path)
}
return false;
}).next().next().hide();
if (image_real_clicked == "div_show.gif") {
current_path = current_path+"div_hide.gif";
$("#" + this.id + " img").attr("src", current_path);
} else {
current_path = current_path+"div_show.gif";
$("#" + this.id + " img").attr("src", current_path)
}
// anchor for current topic
if (valor) {
$("#"+valor).show();
window.location = document.URL+"#"+valor;
}
return false;
}).next().next().hide();
});
</script>';
@ -96,9 +102,9 @@ $interbreadcrumb[]= array ('url' =>'profile.php','name' => get_lang('Social'));
$interbreadcrumb[]= array ('url' =>'#','name' => get_lang('Groups'));
Display :: display_header($tool_name, 'Groups');
echo '<div class="actions-title">';
echo get_lang('Groups');
echo '</div>';
// save message group
if (isset($_POST['token']) && $_POST['token'] === $_SESSION['sec_token']) {
@ -128,13 +134,25 @@ if (isset($_POST['token']) && $_POST['token'] === $_SESSION['sec_token']) {
// getting group information
$group_id = intval($_GET['id']);
echo '<div id="social_wrapper">';
$who_is_on_line = get_lang('UsersOnline').' '.count(WhoIsOnline(api_get_user_id(), $statistics_database, api_get_setting('time_limit_whosonline')));
echo '<div class="actions-title-groups">';
//echo get_lang('Groups');
echo '<div class="menuTitle" align="center"><span class="menuTex1">'.get_lang('Menu').'</span></div>';
echo '<div class="TitleRigth">'.Display::return_icon('whoisonline.png','',array('hspace'=>'6')).'<a href="#" ><span class="menuTex1">'.$who_is_on_line.'</span></a></div>';
echo '</div>';
echo '<div id="socialContent">';
echo '<div id="socialContentLeft">';
//this include the social menu div
SocialManager::show_social_menu('groups');
echo '</div>';
echo '<div id="social_main">';
echo '<div id="socialContentRigth">';
if ($group_id != 0 ) {
@ -165,7 +183,6 @@ if ($group_id != 0 ) {
}
}
//-- Shows left column
echo GroupPortalManager::show_group_column_information($group_id, api_get_user_id());
//---
@ -189,88 +206,109 @@ if ($group_id != 0 ) {
} else {
// My groups -----
$results = GroupPortalManager::get_groups_by_user(api_get_user_id(), 0, true);
$groups = array();
$grid_my_groups = array();
if (is_array($results) && count($results) > 0) {
foreach ($results as $result) {
//cutting text
//$result['name'] = cut($result['name'],150);
//$result['description'] = cut($result['description'],180);
$id = $result['id'];
$url_open = '<a href="groups.php?id='.$id.'">';
$url_close = '</a>';
$name = cut($result['name'],30,true);
if ($result['relation_type'] == GROUP_USER_PERMISSION_ADMIN) {
$result['name'] .= Display::return_icon('admin_star.png', get_lang('Admin'));
$name .= Display::return_icon('admin_star.png', get_lang('Admin'));
} elseif ($result['relation_type'] == GROUP_USER_PERMISSION_MODERATOR) {
$result['name'] .= Display::return_icon('moderator_star.png', get_lang('Moderator'));
$name .= Display::return_icon('moderator_star.png', get_lang('Moderator'));
}
$count_users_group = count(GroupPortalManager::get_all_users_by_group($id));
if ($count_users_group == 1 ) {
$count_users_group = $count_users_group.' '.get_lang('Member');
} else {
$count_users_group = $count_users_group.' '.get_lang('Members');
}
$groups[]= array($url_open.$result['picture_uri'].$url_close, $url_open.$result['name'].$url_close, cut($result['description'],180,true));
}
}
echo '<br/>';
// Everybody can create groups
if (api_get_setting('allow_students_to_create_groups_in_social') == 'true') {
echo '<a href="group_add.php">'.get_lang('CreateAgroup').'</a>';
} else {
// Only admins and teachers can create groups
if (api_is_allowed_to_edit(null,true)) {
echo '<a href="group_add.php">'.get_lang('CreateAgroup').'</a>';
}
}
echo '<h1>'.get_lang('MyGroups').'</h1>';
if (count($groups) > 0) {
Display::display_sortable_grid('mygroups', array(), $groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true,false));
$result['picture_uri'] = '<img class="imageGroups" src="'.$result['picture_uri'].'" hspace="4" height="50" border="2" align="left" width="50" />';
$grid_item_1 = Display::return_icon('boxmygroups.jpg');
$item_1 = '<div>'.$url_open.$result['picture_uri'].'<p class="groupTex1"><strong>'.$name.'<br />('.$count_users_group.')</strong></p>'.$url_close.Display::return_icon('linegroups.jpg').'</div>';
$item_2 = '<div class="box_description_group_title" ><span class="groupText2">'.get_lang('DescriptionGroup').'</span></div>';
$item_3 = '<div class="box_description_group_content" >'.cut($result['description'],120,true).'</div>';
$item_4 = '<div class="box_description_group_actions" >'.$url_open.get_lang('SeeMore').$url_close.'</div>';
$grid_item_2 = $item_1.$item_2.$item_3.$item_4;
$grid_my_groups[]= array($grid_item_1,$grid_item_2);
}
}
// Newest groups --------
$results = GroupPortalManager::get_groups_by_age();
$groups = array();
$grid_newest_groups = array();
foreach ($results as $result) {
$id = $result['id'];
$url_open = '<a href="groups.php?id='.$id.'">';
$url_close = '</a>';
$groups[]= array($url_open.$result['picture_uri'].$url_close, $url_open.$result['name'].$url_close, cut($result['description'],180,true));
}
if (count($groups) > 0) {
echo '<h1>'.get_lang('Newest').'</h1>';
Display::display_sortable_grid('newest', array(), $groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true,false));
$count_users_group = count(GroupPortalManager::get_all_users_by_group($id));
if ($count_users_group == 1 ) {
$count_users_group = $count_users_group.' '.get_lang('Member');
} else {
$count_users_group = $count_users_group.' '.get_lang('Members');
}
$name = cut($result['name'],30,true);
$result['picture_uri'] = '<img class="imageGroups" src="'.$result['picture_uri'].'" hspace="4" height="50" border="2" align="left" width="50" />';
$grid_item_1 = Display::return_icon('boxmygroups.jpg');
$item_1 = '<div>'.$url_open.$result['picture_uri'].'<p class="groupTex1"><strong>'.$name.'<br />('.$count_users_group.')</strong></p>'.$url_close.Display::return_icon('linegroups.jpg').'</div>';
$item_2 = '<div class="box_description_group_title" ><span class="groupText2">'.get_lang('DescriptionGroup').'</span></div>';
$item_3 = '<div class="box_description_group_content" >'.cut($result['description'],120,true).'</div>';
$item_4 = '<div class="box_description_group_actions" >'.$url_open.get_lang('SeeMore').$url_close.'</div>';
$grid_item_2 = $item_1.$item_2.$item_3.$item_4;
$grid_newest_groups[]= array($grid_item_1,$grid_item_2);
}
// Pop groups -----
$results = GroupPortalManager::get_groups_by_popularity();
$groups = array();
$grid_pop_groups = array();
foreach ($results as $result) {
$id = $result['id'];
$url_open = '<a href="groups.php?id='.$id.'">';
$url_close = '</a>';
if ($result['count'] == 1 ) {
$result['count'] = $result['count'].' '.get_lang('Member');
} else {
$result['count'] = $result['count'].' '.get_lang('Members');
}
$count_users_group = $result['count'];
$groups[]= array($url_open.$result['picture_uri'].$url_close, $url_open.$result['name'].$url_close,$result['count'],cut($result['description'],120,true));
}
if (count($groups) > 0) {
echo '<h1>'.get_lang('Popular').'</h1>';
Display::display_sortable_grid('popular', array(), $groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true,true,true));
}
$name = cut($result['name'],30,true);
$result['picture_uri'] = '<img class="imageGroups" src="'.$result['picture_uri'].'" hspace="4" height="50" border="2" align="left" width="50" />';
$grid_item_1 = Display::return_icon('boxmygroups.jpg');
$item_1 = '<div>'.$url_open.$result['picture_uri'].'<p class="groupTex1"><strong>'.$name.'<br />('.$count_users_group.')</strong></p>'.$url_close.Display::return_icon('linegroups.jpg').'</div>';
$item_2 = '<div class="box_description_group_title" ><span class="groupText2">'.get_lang('DescriptionGroup').'</span></div>';
$item_3 = '<div class="box_description_group_content" >'.cut($result['description'],120,true).'</div>';
$item_4 = '<div class="box_description_group_actions" >'.$url_open.get_lang('SeeMore').$url_close.'</div>';
$grid_item_2 = $item_1.$item_2.$item_3.$item_4;
echo '</div>';
$grid_pop_groups[]= array($grid_item_1,$grid_item_2);
echo '</div>';
}
echo '<div id="boxmyGroups">';
echo '<h1>'.get_lang('MyGroups').'</h1>';
if (count($grid_my_groups) > 0) {
Display::display_sortable_grid('mygroups', array(), $grid_my_groups, array('hide_navigation'=>true, 'per_page' => 2), $query_vars, false, array(true, true, true,false));
}
if (count($grid_newest_groups) > 0) {
echo '<h1>'.get_lang('Newest').'</h1>';
Display::display_sortable_grid('newest', array(), $grid_newest_groups, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, true, true,false));
}
if (count($grid_pop_groups) > 0) {
echo '<h1>'.get_lang('Popular').'</h1>';
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));
}
echo '</div>';
}
echo '</div>';
echo '</div>';
Display :: display_footer();
?>

@ -53,9 +53,12 @@ if (!empty($group_id) && $allowed_action) {
}
}
$page_item = !empty($_GET['page_item_nr'])?intval($_GET['page_item_nr']):1;
$page_topic = !empty($_GET['page_nr'])?intval($_GET['page_nr']):1;
?>
<form name="form" action="groups.php?id=<?php echo $group_id ?>" method="POST" enctype="multipart/form-data">
<form name="form" action="groups.php?id=<?php echo $group_id ?>&div_id=<?php echo Security::remove_XSS($_GET['div_id']) ?>&page_nr=<?php echo $page_topic ?>&page_item_nr=<?php echo $page_item ?>" method="POST" enctype="multipart/form-data">
<input type="hidden" name="action" value="<?php echo $allowed_action ?>" />
<input type="hidden" name="group_id" value="<?php echo $group_id ?>" />
<input type="hidden" name="parent_id" value="<?php echo $message_id ?>" />

Loading…
Cancel
Save