Exemple #1
0
     $name = api_get_person_name($forum['last_poster_firstname'], $forum['last_poster_lastname']);
     $poster_id = $forum['last_poster_id'];
     $userinfo = api_get_user_info($poster_id);
     $username = sprintf(get_lang('LoginX'), $userinfo['username']);
 }
 if (!empty($forum['last_post_id'])) {
     $html .= Display::return_icon('post-item.png', null, null, ICON_SIZE_TINY) . ' ' . api_convert_and_format_date($forum['last_post_date']) . '<br /> ' . get_lang('By') . ' ' . display_user_link($poster_id, $name, '', $username);
 }
 $html .= '</div>';
 $html .= '<div class="col-md-4">';
 if (api_is_allowed_to_edit(false, true) && !($forum['session_id'] == 0 && intval($sessionId) != 0)) {
     $html .= '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&action=edit&content=forum&id=' . $forum['forum_id'] . '">' . Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL) . '</a>';
     $html .= '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&action=delete&content=forum&id=' . $forum['forum_id'] . "\" onclick=\"javascript:if(!confirm('" . addslashes(api_htmlentities(get_lang('DeleteForum'), ENT_QUOTES)) . "')) return false;\">" . Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
     $html .= return_visible_invisible_icon('forum', $forum['forum_id'], $forum['visibility']);
     $html .= return_lock_unlock_icon('forum', $forum['forum_id'], $forum['locked']);
     $html .= return_up_down_icon('forum', $forum['forum_id'], $forumsInCategory);
 }
 $iconnotify = 'notification_mail_na.png';
 $session_forum_notification = isset($_SESSION['forum_notification']['forum']) ? $_SESSION['forum_notification']['forum'] : false;
 if (is_array($session_forum_notification)) {
     if (in_array($forum['forum_id'], $session_forum_notification)) {
         $iconnotify = 'notification_mail.png';
     }
 }
 if (!api_is_anonymous() && api_is_allowed_to_session_edit(false, true)) {
     $html .= '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&action=notify&content=forum&id=' . $forum['forum_id'] . '">' . Display::return_icon($iconnotify, get_lang('NotifyMe'), null, ICON_SIZE_SMALL) . '</a>';
 }
 $html .= '</div>';
 $html .= '</div>';
 $html .= '</div>';
 $html .= '</div>';
/**
 * This function takes care of the display of the up and down icon
 *
 * @param $content what is it that we want to make (in)visible: forum category, forum, thread, post
 * @param $id is the id of the item we want to display the icons for
 * @param $list is an array of all the items. All items in this list should have an up and down icon except for the first (no up icon) and the last (no down icon)
 *          The key of this $list array is the id of the item.
 *
 * @return void HTML
 *
 * @author Patrick Cool <*****@*****.**>, Ghent University
 * @version february 2006, dokeos 1.8
 */
function display_up_down_icon($content, $id, $list)
{
    echo return_up_down_icon($content, $id, $list);
}