function manage_form($default, $select_from_user_list = null, $sent_to = null) { $group_id = isset($_REQUEST['group_id']) ? intval($_REQUEST['group_id']) : null; $message_id = isset($_GET['message_id']) ? intval($_GET['message_id']) : null; $param_f = isset($_GET['f']) && $_GET['f'] == 'social' ? 'social' : null; $form = new FormValidator('compose_message', null, api_get_self() . '?f=' . $param_f, null, array('enctype' => 'multipart/form-data')); if (empty($group_id)) { if (isset($select_from_user_list)) { $form->addText('id_text_name', get_lang('SendMessageTo'), true, array('id' => 'id_text_name', 'onkeyup' => 'send_request_and_search()', 'autocomplete' => 'off')); $form->addRule('id_text_name', get_lang('ThisFieldIsRequired'), 'required'); $form->addElement('html', '<div id="id_div_search" style="padding:0px" class="message-select-box" > </div>'); $form->addElement('hidden', 'user_list', 0, array('id' => 'user_list')); } else { if (!empty($sent_to)) { $form->addLabel(get_lang('SendMessageTo'), $sent_to); } if (empty($default['users'])) { //fb select $form->addElement('select_ajax', 'users', get_lang('SendMessageTo'), array(), ['multiple' => 'multiple', 'url' => api_get_path(WEB_AJAX_PATH) . 'message.ajax.php?a=find_users']); } else { $form->addElement('hidden', 'hidden_user', $default['users'][0], array('id' => 'hidden_user')); } } } else { $userGroup = new UserGroup(); $group_info = $userGroup->get($group_id); $form->addElement('label', get_lang('ToGroup'), api_xml_http_response_encode($group_info['name'])); $form->addElement('hidden', 'group_id', $group_id); $form->addElement('hidden', 'parent_id', $message_id); } $form->addText('title', get_lang('Subject'), true); $form->addHtmlEditor('content', get_lang('Message'), false, false, array('ToolbarSet' => 'Messages', 'Width' => '100%', 'Height' => '250')); if (isset($_GET['re_id'])) { $message_reply_info = MessageManager::get_message_by_id($_GET['re_id']); $default['title'] = get_lang('MailSubjectReplyShort') . " " . $message_reply_info['title']; $form->addElement('hidden', 're_id', intval($_GET['re_id'])); $form->addElement('hidden', 'save_form', 'save_form'); //adding reply mail $user_reply_info = api_get_user_info($message_reply_info['user_sender_id']); $default['content'] = '<p><br/></p>' . sprintf(get_lang('XWroteY'), $user_reply_info['complete_name'], Security::filter_terms($message_reply_info['content'])); } if (empty($group_id)) { $form->addElement('label', '', '<div id="filepaths" class="form-group"> <div id="filepath_1"> <label>' . get_lang('FilesAttachment') . '</label> <input type="file" name="attach_1"/> <label>' . get_lang('Description') . '</label> <input id="file-descrtiption" type="text" name="legend[]" class="form-control"/> </div> </div>'); $form->addElement('label', '', '<span id="link-more-attach"><a href="javascript://" onclick="return add_image_form()">' . get_lang('AddOneMoreFile') . '</a></span> (' . sprintf(get_lang('MaximunFileSizeX'), format_file_size(api_get_setting('message.message_max_upload_filesize'))) . ')'); } $form->addButtonSend(get_lang('SendMessage'), 'compose'); $form->setRequiredNote('<span class="form_required">*</span> <small>' . get_lang('ThisFieldIsRequired') . '</small>'); if (!empty($group_id) && !empty($message_id)) { $message_info = MessageManager::get_message_by_id($message_id); $default['title'] = get_lang('MailSubjectReplyShort') . " " . $message_info['title']; } $form->setDefaults($default); $html = ''; if ($form->validate()) { $check = Security::check_token('post'); if ($check) { $user_list = $default['users']; $file_comments = $_POST['legend']; $title = $default['title']; $content = $default['content']; $group_id = isset($default['group_id']) ? $default['group_id'] : null; $parent_id = isset($default['parent_id']) ? $default['parent_id'] : null; if (is_array($user_list) && count($user_list) > 0) { //all is well, send the message foreach ($user_list as $user) { $res = MessageManager::send_message($user, $title, $content, $_FILES, $file_comments, $group_id, $parent_id); if ($res) { $html .= MessageManager::display_success_message($user); } } } else { Display::display_error_message('ErrorSendingMessage'); } } Security::clear_token(); } else { $token = Security::get_token(); $form->addElement('hidden', 'sec_token'); $form->setConstants(array('sec_token' => $token)); $html .= $form->returnForm(); } return $html; }
/** * This function returns the content of a table in a grid * Should not be use to edit information (edit/delete rows) only. * @param array options of visibility * @param bool hide navigation optionally * @param int content per page when show navigation (optional) * @param bool sort data optionally * @return string grid html */ public function display_simple_grid($visibility_options, $hide_navigation = true, $per_page = 20, $sort_data = true, $grid_class = array()) { $empty_table = false; $total = $this->get_total_number_of_items(); if ($this->get_total_number_of_items() == 0) { $cols = $this->getColCount(); //$this->setCellAttributes(1, 0, 'style="font-style: italic;text-align:center;" colspan='.$cols); $message_empty = api_xml_http_response_encode(get_lang('TheListIsEmpty')); $this->setCellContents(1, 0, $message_empty); $empty_table = true; } $html = ''; if (!$empty_table) { // If we show the pagination if (!$hide_navigation) { $form = ' '; if ($this->get_total_number_of_items() > $per_page) { if ($per_page > 10) { $form = $this->get_page_select_form(); } $nav = $this->get_navigation_html(); // This also must be moved $html = '<div class="sub-header">'; $html .= '<div class="grid_selectbox">' . $form . '</div>'; $html .= '<div class="grid_title">' . $this->get_table_title() . '</div>'; $html .= '<div class="grid_nav">' . $nav . '</div>'; $html .= '</div>'; } } $html .= '<div class="clear"></div>'; if (count($this->form_actions) > 0) { $script = '<script> /*<![CDATA[*/ function setCheckbox(value) { d = document.form_' . $this->table_name . '; for (i = 0; i < d.elements.length; i++) { if (d.elements[i].type == "checkbox") { d.elements[i].checked = value; } if (value) { $(d.elements[i]).parentsUntil("tr").parent().addClass("row_selected"); } else { $(d.elements[i]).parentsUntil("tr").parent().removeClass("row_selected"); } } } /*]]>*/ </script>'; $params = $this->get_sortable_table_param_string() . '&' . $this->get_additional_url_paramstring(); $html .= '<form method="post" action="' . api_get_self() . '?' . $params . '" name="form_' . $this->table_name . '">'; } } if ($hide_navigation) { $items = $this->table_data; // This is a faster way to get what we want } else { // The normal way $items = $this->get_clean_html($sort_data); // Getting the items of the table } // Generation of style classes must be improved. Maybe we need a a table name to create style on the fly: // i.e: .whoisonline_table_grid_container instead of .grid_container // where whoisonline is the table's name like drupal's template engine if (is_array($visibility_options)) { $filter = false; // The 2nd condition of the if will be loaded } else { $filter = $visibility_options !== false; } $item_css_class = $item_css_style = $grid_css_class = $grid_css_style = ''; if (!empty($grid_class)) { $grid_css_class = $grid_class['main']['class']; $item_css_class = $grid_class['item']['class']; $grid_css_style = isset($grid_class['main']['style']) ? $grid_class['main']['style'] : null; $item_css_style = isset($grid_class['item']['style']) ? $grid_class['item']['style'] : null; } $div = ''; if (is_array($items) && count($items) > 0) { foreach ($items as &$row) { $i = 0; $rows = ''; foreach ($row as &$element) { if ($filter || $visibility_options[$i]) { $rows .= '<div class="' . $this->table_name . '_grid_element_' . $i . '">' . $element . '</div>'; } $i++; } $div .= Display::div($rows, array('class' => $item_css_class . ' ' . $this->table_name . '_grid_item', 'style' => $item_css_style)); } } $html .= Display::div($div, array('class' => $grid_css_class . ' ' . $this->table_name . '_grid_container', 'style' => $grid_css_style)); $html .= '<div class="clear"></div>'; return $html; }
/** * @return string */ static function outbox_display() { $social_link = false; if (isset($_REQUEST['f']) && $_REQUEST['f'] == 'social') { $social_link = 'f=social'; } $success = get_lang('SelectedMessagesDeleted') . ' </b><br /><a href="outbox.php?' . $social_link . '">' . get_lang('BackToOutbox') . '</a>'; $html = null; if (isset($_REQUEST['action'])) { switch ($_REQUEST['action']) { case 'delete': $number_of_selected_messages = count($_POST['id']); if ($number_of_selected_messages != 0) { foreach ($_POST['id'] as $index => $message_id) { MessageManager::delete_message_by_user_receiver(api_get_user_id(), $message_id); } } $html .= Display::return_message(api_xml_http_response_encode($success), 'normal', false); break; case 'deleteone': MessageManager::delete_message_by_user_receiver(api_get_user_id(), $_GET['id']); $html .= Display::return_message(api_xml_http_response_encode($success), 'normal', false); $html .= '<br/>'; break; } } // display sortable table with messages of the current user $table = new SortableTable('message_outbox', array('MessageManager', 'get_number_of_messages_sent'), array('MessageManager', 'get_message_data_sent'), 3, 20, 'DESC'); $parameters['f'] = isset($_GET['f']) && $_GET['f'] == 'social' ? 'social' : null; $table->set_additional_parameters($parameters); $table->set_header(0, '', false, array('style' => 'width:15px;')); $table->set_header(1, get_lang('Messages'), false); $table->set_header(2, get_lang('Date'), true, array('style' => 'width:160px;')); $table->set_header(3, get_lang('Modify'), false, array('style' => 'width:70px;')); $table->set_form_actions(array('delete' => get_lang('DeleteSelectedMessages'))); $html .= $table->return_table(); return $html; }
$actions .= '<a href="' . api_get_path(WEB_PATH) . 'main/messages/new_message.php">' . Display::return_icon('message_new.png', get_lang('ComposeMessage')) . '</a>'; $actions .= '<a href="' . api_get_path(WEB_PATH) . 'main/messages/inbox.php">' . Display::return_icon('inbox.png', get_lang('Inbox')) . '</a>'; $actions .= '<a href="' . api_get_path(WEB_PATH) . 'main/messages/outbox.php">' . Display::return_icon('outbox.png', get_lang('Outbox')) . '</a>'; } } } $info_delete_outbox = array(); $info_delete_outbox = explode(',', $_GET['form_delete_outbox']); $count_delete_outbox = count($info_delete_outbox) - 1; if (trim($info_delete_outbox[0]) == 'delete') { for ($i = 1; $i <= $count_delete_outbox; $i++) { MessageManager::delete_message_by_user_sender(api_get_user_id(), $info_delete_outbox[$i]); } $message_box = get_lang('SelectedMessagesDeleted') . '  <br><a href="../social/index.php?#remote-tab-3">' . get_lang('BackToOutbox') . '</a>'; Display::display_normal_message(api_xml_http_response_encode($message_box), false); exit; } $action = null; if (isset($_REQUEST['action'])) { $action = $_REQUEST['action']; } if (api_get_setting('allow_social_tool') == 'true') { $social_left_content = SocialManager::show_social_menu('messages'); $social_right_content .= '<div class="span9">'; $social_right_content .= '<div class="actions">'; $social_right_content .= '<a href="' . api_get_path(WEB_PATH) . 'main/messages/inbox.php?f=social">' . Display::return_icon('back.png', get_lang('Back'), array(), 32) . '</a>'; $social_right_content .= '</div>'; $social_right_content .= '</div>'; $social_right_content .= '<div class="span9">'; }
MessageManager::send_message($user_id_by_email, $title, $content); Display::addFlash(MessageManager::return_message($user_id_by_email, 'confirmation')); $social_right_content .= MessageManager::inbox_display(); exit; } elseif (is_null($user_id_by_email)) { $message_box = get_lang('ErrorSendingMessage'); Display::return_message(api_xml_http_response_encode($message_box), 'error'); $social_right_content .= MessageManager::inbox_display(); exit; } } elseif (trim($info_delete[0]) == 'delete') { for ($i = 1; $i <= $count_delete; $i++) { MessageManager::delete_message_by_user_receiver(api_get_user_id(), $info_delete[$i]); } $message_box = get_lang('SelectedMessagesDeleted'); Display::return_message(api_xml_http_response_encode($message_box)); $social_right_content .= MessageManager::inbox_display(); exit; } } if (isset($_GET['f']) && $_GET['f'] == 'social') { $this_section = SECTION_SOCIAL; $interbreadcrumb[] = array('url' => api_get_path(WEB_PATH) . 'main/social/home.php', 'name' => get_lang('SocialNetwork')); $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Inbox')); } else { $this_section = SECTION_MYPROFILE; $interbreadcrumb[] = array('url' => Container::getRouter()->generate('fos_user_profile_edit'), 'name' => get_lang('Profile')); } $social_parameter = ''; if (isset($_GET['f']) && $_GET['f'] == 'social' && api_get_setting('social.allow_social_tool') == 'true') { $social_parameter = '?f=social';
if (isset($_POST['glossary_id']) && $_POST['glossary_id'] == strval(intval($_POST['glossary_id']))) { $glossary_id = Security::remove_XSS($_POST['glossary_id']); $glossary_description_by_id = GlossaryManager::get_glossary_term_by_glossary_id($glossary_id); $glossary_description_by_id = str_replace($path_image_search, $path_image, $glossary_description_by_id); echo api_xml_http_response_encode($glossary_description_by_id); } elseif (isset($_POST['glossary_data']) && $_POST['glossary_data'] == 'true') { //get_glossary_terms $glossary_data = GlossaryManager::get_glossary_terms(); $glossary_all_data = array(); if (count($glossary_data) > 0) { foreach ($glossary_data as $glossary_index => $glossary_value) { $glossary_all_data[] = $glossary_value['id'] . '__|__|' . $glossary_value['name']; } $glossary_all_data = implode('[|.|_|.|-|.|]', $glossary_all_data); echo api_xml_http_response_encode($glossary_all_data); } } elseif (isset($_POST['glossary_name'])) { $my_glossary_name = Security::remove_XSS($_POST['glossary_name']); $my_glossary_name = api_convert_encoding($my_glossary_name, $charset, 'UTF-8'); $my_glossary_name = trim($my_glossary_name); $glossary_description = GlossaryManager::get_glossary_term_by_glossary_name($my_glossary_name); $glossary_description = str_replace($path_image_search, $path_image, $glossary_description); if (is_null($glossary_description) || strlen(trim($glossary_description)) == 0) { echo api_xml_http_response_encode(get_lang('NoResults')); } else { echo api_xml_http_response_encode($glossary_description); } } else { echo api_xml_http_response_encode(get_lang('NoResults')); } Container::$legacyTemplate = 'layout_empty.html.twig';
$usergroup = new UserGroup(); if (!empty($group_id) && $allowed_action) { $group_info = $usergroup->get($group_id); $is_member = $usergroup->is_group_member($group_id); if ($group_info['visibility'] == GROUP_PERMISSION_CLOSED && !$is_member) { api_not_allowed(true); } $to_group = $group_info['name']; if (!empty($message_id)) { $message_info = MessageManager::get_message_by_id($message_id); if ($allowed_action == 'reply_message_group') { $subject = get_lang('Reply') . ': ' . api_xml_http_response_encode($message_info['title']); //$message = api_xml_http_response_encode($message_info['content']); } else { $subject = api_xml_http_response_encode($message_info['title']); $message = api_xml_http_response_encode($message_info['content']); } } } $page_item = !empty($_GET['topics_page_nr']) ? intval($_GET['topics_page_nr']) : 1; $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) : ''; if (isset($_GET['topic_id'])) { $param_item_page .= '&topic_id=' . intval($_GET['topic_id']); } $page_topic = isset($_GET['topics_page_nr']) ? intval($_GET['topics_page_nr']) : 1; $anchor_topic = isset($_GET['anchor_topic']) ? Security::remove_XSS($_GET['anchor_topic']) : null; $url = api_get_path(WEB_PUBLIC_PATH) . 'main/social/group_topics.php?id=' . $group_id . '&anchor_topic=' . $anchor_topic . '&topics_page_nr=' . $page_topic . $param_item_page; $form = new FormValidator('form', 'post', $url, null, array('enctype' => 'multipart/form-data')); $form->addElement('hidden', 'action', $allowed_action); $form->addElement('hidden', 'group_id', $group_id); $form->addElement('hidden', 'parent_id', $message_id);
if ($result['relation_type'] == GROUP_USER_PERMISSION_ADMIN) { $icon = Display::return_icon('social_group_admin.png', get_lang('Admin'), array('style' => 'vertical-align:middle;width:16px;height:16px;')); } elseif ($result['relation_type'] == GROUP_USER_PERMISSION_MODERATOR) { $icon = Display::return_icon('social_group_moderator.png', get_lang('Moderator'), array('style' => 'vertical-align:middle;width:16px;height:16px;')); } $count_users_group = count($usergroup->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'); } $picture = $usergroup->get_picture_group($result['id'], $result['picture'], 80); $item_name = '<div class="box_shared_profile_group_title">' . $url_open . api_xml_http_response_encode($name) . $icon . $url_close . '</div>'; $item_description = ''; if (!empty($result['description'])) { $item_description = '<div class="box_shared_profile_group_description"><span class="social-groups-text2">' . api_xml_http_response_encode(get_lang('Description')) . '</span><p class="social-groups-text4">' . Text::cut(api_xml_http_response_encode($result['description']), 120, true) . '</p></div>'; } $result['picture_uri'] = '<div class="box_shared_profile_group_image"><img class="social-groups-image" src="' . $picture['file'] . '" hspace="4" height="50" border="2" align="left" width="50" /></div>'; $item_actions = ''; if (api_get_user_id() == $user_id) { $item_actions = '<div class="box_shared_profile_group_actions"><a href="groups.php?id=' . $id . '">' . get_lang('SeeMore') . $url_close . '</div>'; } $grid_my_groups[] = array($item_name, $url_open . $result['picture_uri'] . $url_close, $item_description . $item_actions); $i++; } } if (count($grid_my_groups) > 0) { echo '<div style="margin-top:20px">'; echo '<div><h3>' . get_lang('MyGroups') . '</h3></div>'; $count_groups = 0; if (count($results) == 1) {
if (!empty($result)) { echo '<div style="background:#FAF9F6; padding-left:10px;">'; api_display_tool_title(api_xml_http_response_encode(get_lang('BlogComments'))); echo api_xml_http_response_encode($result); echo '</div>'; echo '<br />'; $all_result_data++; } if ($all_result_data == 0) { echo api_xml_http_response_encode(get_lang('NoDataAvailable')); } } else { echo '<div class="clear"></div><br />'; api_display_tool_title(api_xml_http_response_encode(get_lang('Details'))); echo '<div style="background:#FAF9F6; padding:0px;">'; echo api_xml_http_response_encode(get_lang('UserNonRegisteredAtTheCourse')); echo '<div class="clear"></div><br />'; echo '</div>'; echo '<div class="clear"></div><br />'; } break; case 'unload_course': break; default: break; } break; case 'listWallMessage': $start = isset($_REQUEST['start']) ? intval($_REQUEST['start']) - 1 : 0; $length = isset($_REQUEST['length']) ? intval($_REQUEST['length']) : 10; $userId = isset($_REQUEST['u']) ? intval($_REQUEST['u']) : api_get_user_id();
) ) ?>) <br/> <br/> <?php if ($allowed_action == 'add_message_group') { ?> <button class="btn save" onclick="if(validate_text_empty(this.form.title.value,'<?php echo get_lang( 'YouShouldWriteASubject' ) ?>')){return false;}" type="submit" value="<?php echo api_xml_http_response_encode( get_lang('SendMessage') ); ?>"><?php echo api_xml_http_response_encode( get_lang('SendMessage') ) ?></button> <?php } else { ?> <button class="btn save" type="submit" value="<?php echo api_xml_http_response_encode( get_lang('SendMessage') ); ?>"><?php echo api_xml_http_response_encode( get_lang('SendMessage') ) ?></button> <?php } ?> <?php } ?> </dl> </td> </tr> </div> </table> </form>
num_characters = document.forms[0].description.value.length; if (num_characters > num_characters_permited){ document.forms[0].description.value = textarea; } else { textarea = document.forms[0].description.value; } } </script>'; $table_message = Database::get_main_table(TABLE_MESSAGE); $form = new FormValidator('add_group'); $form = GroupPortalManager::setGroupForm($form); $form->addElement('style_submit_button', 'add_group', get_lang('AddGroup'), 'class="save"'); $form->setRequiredNote(api_xml_http_response_encode('<span class="form_required">*</span> <small>'.get_lang('ThisFieldIsRequired').'</small>')); if ($form->validate()) { $values = $form->exportValues(); $picture_element = $form->getElement('picture'); $picture = $picture_element->getValue(); $picture_uri = ''; $name = $values['name']; $description = $values['description']; $url = $values['url']; $status = intval($values['visibility']); $picture = $_FILES['picture']; $group_id = GroupPortalManager::add($name, $description, $url, $status); GroupPortalManager::add_user_to_group(api_get_user_id(), $group_id, GROUP_USER_PERMISSION_ADMIN);
$social_right_content .= get_lang('NoFriendsInYourContactList') . '<br /><br />'; $social_right_content .= '<a class="btn" href="search.php">' . get_lang('TryAndFindSomeFriends') . '</a>'; } else { $social_right_content .= get_lang('Search') . ' : '; $social_right_content .= '<input class="social-search-image" type="text" id="id_search_image" name="id_search_image" onkeyup="search_image_social()" />'; $friend_html = '<div id="friends">'; $number_friends = count($friends); $j = 0; $friend_html .= '<ul class="thumbnails">'; for ($k = 0; $k < $number_friends; $k++) { while ($j < $number_friends) { if (isset($friends[$j])) { $friend_html .= '<li class="span2">'; $userInfo = $friends[$j]['user_info']; $friend = $friends[$j]; $user_name = api_xml_http_response_encode($friend['firstName'] . ' ' . $friend['lastName']); $friends_profile = SocialManager::get_picture_user($friend['friend_user_id'], $friend['image'], 92); $friend_html .= '<div class="thumbnail" onMouseover="show_icon_delete(this)" onMouseout="hide_icon_delete(this)" class="image-social-content" id=div_' . $friends[$j]['friend_user_id'] . '>'; $friend_html .= '<img src="' . $friends_profile['file'] . '" id="imgfriend_' . $friend['friend_user_id'] . '" title="' . $user_name . '" /> '; $friend_html .= '<div class="caption"> <a href="' . $userInfo['profile_url'] . '"><h5>' . $user_name . '</h5></a>'; $friend_html .= '<p><button onclick="delete_friend(this)" id=img_' . $friend['friend_user_id'] . ' />' . get_lang('Delete') . '</button></p> </div>'; $friend_html .= '</li>'; } $j++; } } $friend_html .= '</ul>'; $friend_html .= '</div>'; $social_right_content .= $friend_html;
} $picture = GroupPortalManager::get_picture_group( $result['id'], $result['picture_uri'], 80 ); $item_name = '<div class="box_shared_profile_group_title">' . $url_open . api_xml_http_response_encode( $name ) . $icon . $url_close . '</div>'; $item_description = ''; if (!empty($result['description'])) { $item_description = '<div class="box_shared_profile_group_description"><span class="social-groups-text2">' . api_xml_http_response_encode( get_lang('Description') ) . '</span><p class="social-groups-text4">' . cut( api_xml_http_response_encode( $result['description'] ), 120, true ) . '</p></div>'; } $result['picture_uri'] = '<div class="box_shared_profile_group_image"><img class="social-groups-image" src="' . $picture['file'] . '" hspace="4" height="50" border="2" align="left" width="50" /></div>'; $item_actions = ''; if (api_get_user_id() == $user_id) { $item_actions = '<div class="box_shared_profile_group_actions"><a href="groups.php?id=' . $id . '">' . get_lang( 'SeeMore' ) . $url_close . '</div>'; } $grid_my_groups[] = array( $item_name,
$icon = Display::return_icon('social_group_admin.png', get_lang('Admin'), array('style' => 'vertical-align:middle;width:16px;height:16px;')); } elseif ($result['relation_type'] == GROUP_USER_PERMISSION_MODERATOR) { $icon = Display::return_icon('social_group_moderator.png', get_lang('Moderator'), array('style' => 'vertical-align:middle;width:16px;height:16px;')); } $count_users_group = count($userGroup->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'); } $picture = $userGroup->get_picture_group($result['id'], $result['picture_uri'], 80); $item_name = '<div class="box_shared_profile_group_title">' . $url_open . api_xml_http_response_encode($name) . $icon . $url_close . '</div>'; $item_description = ''; if (!empty($result['description'])) { $item_description = '<div class="box_shared_profile_group_description"> <span class="social-groups-text2">' . api_xml_http_response_encode(get_lang('Description')) . '</span><p class="social-groups-text4">' . cut(api_xml_http_response_encode($result['description']), 120, true) . '</p></div>'; } $result['picture_uri'] = '<div class="box_shared_profile_group_image"> <img class="social-groups-image" src="' . $picture['file'] . '" /></div>'; $item_actions = ''; if (api_get_user_id() == $user_id) { $item_actions = '<div class="box_shared_profile_group_actions"><a href="group_view.php?id=' . $id . '">' . get_lang('SeeMore') . $url_close . '</div>'; } $grid_my_groups[] = array($item_name, $url_open . $result['picture_uri'] . $url_close, $item_description . $item_actions); $i++; } } if (count($grid_my_groups) > 0) { echo '<div style="margin-top:20px">'; echo '<div><h3>' . get_lang('MyGroups') . '</h3></div>'; $count_groups = 0;