// show attachment list $attachment_list = array(); $attachment_list = AnnouncementManager::get_attachment($myrow['id']); $attachment_icon = ''; if (count($attachment_list) > 0) { $attachment_icon = ' ' . Display::return_icon('attachment.gif', get_lang('Attachment')); } /* TITLE */ $title = Display::url($title . $attachment_icon, api_get_self() . '?' . api_get_cidreq() . '&action=view&id=' . $myrow['id']); echo Display::tag('td', Security::remove_XSS($title), array('class' => 'announcements-list-line-title ' . $style)); $user_info = api_get_user_info($myrow['insert_user_id']); $username = sprintf(get_lang("LoginX"), $user_info['username']); $username_span = Display::tag('span', api_get_person_name($user_info['firstName'], $user_info['lastName']), array('title' => $username)); echo Display::tag('td', $username_span, array('class' => 'announcements-list-line-by-user')); $sent_to_list = array(); $sent_to_list = AnnouncementManager::sent_to('announcement', $myrow['id']); $sent_to_form = AnnouncementManager::sent_to_form($sent_to_list); echo '<td class="announcements-list-line-by-user">' . substr($sent_to_form, 0, 45) . ' '; if (strlen($sent_to_form) > 45) { echo '...'; } '</td>'; echo Display::tag('td', api_convert_and_format_date($myrow['insert_date'], DATE_TIME_FORMAT_SHORT), array('class' => 'announcements-list-line-datetime')); // we can edit if : we are the teacher OR the element belongs to the session we are coaching OR the option to allow users to edit is on $modify_icons = ''; if (api_is_allowed_to_edit(false, true) or api_is_course_coach() && api_is_element_in_the_session(TOOL_ANNOUNCEMENT, $myrow['id']) or api_get_course_setting('allow_user_edit_announcement') && !api_is_anonymous()) { $modify_icons = "<a href=\"" . api_get_self() . "?" . api_get_cidreq() . "&action=modify&id=" . $myrow['id'] . "\">" . Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL) . "</a>"; if ($myrow['visibility'] == 1) { $image_visibility = "visible"; $alt_visibility = get_lang('Hide'); } else {