当前位置: 首页>>代码示例>>PHP>>正文


PHP message_history_link函数代码示例

本文整理汇总了PHP中message_history_link函数的典型用法代码示例。如果您正苦于以下问题:PHP message_history_link函数的具体用法?PHP message_history_link怎么用?PHP message_history_link使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了message_history_link函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: message_print_contactlist_user

/**
 * Print a row of contactlist displaying user picture, messages waiting and
 * block links etc
 * @param object $contact contact object containing all fields required for $OUTPUT->user_picture()
 * @param bool $incontactlist is the user a contact of ours?
 * @param bool $isblocked is the user blocked?
 * @param string $selectcontacturl the url to send the user to when a contact's name is clicked
 * @param bool $showactionlinks display action links next to the other users (add contact, block user etc)
 * @param object $selecteduser the user the current user is viewing (if any). They will be highlighted.
 */
function message_print_contactlist_user($contact, $incontactlist = true, $isblocked = false, $selectcontacturl = null, $showactionlinks = true, $selecteduser=null) {
    global $OUTPUT, $USER;
    $fullname  = fullname($contact);
    $fullnamelink  = $fullname;

    $linkclass = '';
    if (!empty($selecteduser) && $contact->id == $selecteduser->id) {
        $linkclass = 'messageselecteduser';
    }

    /// are there any unread messages for this contact?
    if ($contact->messagecount > 0 ){
        $fullnamelink = '<strong>'.$fullnamelink.' ('.$contact->messagecount.')</strong>';
    }

    $strcontact = $strblock = $strhistory = null;

    if ($showactionlinks) {
        $strcontact = message_get_contact_add_remove_link($incontactlist, $isblocked, $contact);
        $strblock   = message_get_contact_block_link($incontactlist, $isblocked, $contact);
        $strhistory = message_history_link($USER->id, $contact->id, true, '', '', 'icon');
    }

    echo html_writer::start_tag('tr');
    echo html_writer::start_tag('td', array('class' => 'pix'));
    echo $OUTPUT->user_picture($contact, array('size' => 20, 'courseid' => SITEID));
    echo html_writer::end_tag('td');

    echo html_writer::start_tag('td', array('class' => 'contact'));

    $popupoptions = array(
            'height' => MESSAGE_DISCUSSION_HEIGHT,
            'width' => MESSAGE_DISCUSSION_WIDTH,
            'menubar' => false,
            'location' => false,
            'status' => true,
            'scrollbars' => true,
            'resizable' => true);

    $link = $action = null;
    if (!empty($selectcontacturl)) {
        $link = new moodle_url($selectcontacturl.'&user2='.$contact->id);
    } else {
        //can $selectcontacturl be removed and maybe the be removed and hardcoded?
        $link = new moodle_url("/message/index.php?id=$contact->id");
        $action = new popup_action('click', $link, "message_$contact->id", $popupoptions);
    }
    echo $OUTPUT->action_link($link, $fullnamelink, $action, array('class' => $linkclass,'title' => get_string('sendmessageto', 'message', $fullname)));

    echo html_writer::end_tag('td');

    echo html_writer::tag('td', '&nbsp;'.$strcontact.$strblock.'&nbsp;'.$strhistory, array('class' => 'link'));

    echo html_writer::end_tag('tr');
}
开发者ID:nfreear,项目名称:moodle,代码行数:65,代码来源:lib.php

示例2: add_to_log

    add_to_log(SITEID, 'message', 'unblock contact', 'history.php?user1=' . $unblockcontact . '&amp;user2=' . $USER->id, $unblockcontact);
    message_unblock_contact($unblockcontact);
}
//$PAGE->set_title('Message History');
$PAGE->set_generaltype('popup');
echo $OUTPUT->header();
echo '<table width="100%" cellpadding="0" cellspacing="0"><tr>';
echo '<td width="100">';
$userpic = moodle_user_picture::make($user, SITEID);
$userpic->size = 48;
$userpic->link = true;
echo $OUTPUT->user_picture($userpic) . '</td>';
echo '<td valign="middle" align="center">';
echo '<div class="name">' . fullname($user) . '</div>';
echo '<div class="commands">';
if ($contact = $DB->get_record('message_contacts', array('userid' => $USER->id, 'contactid' => $user->id))) {
    if ($contact->blocked) {
        message_contact_link($user->id, 'add', false, 'user.php?id=' . $user->id, true);
        message_contact_link($user->id, 'unblock', false, 'user.php?id=' . $user->id, true);
    } else {
        message_contact_link($user->id, 'remove', false, 'user.php?id=' . $user->id, true);
        message_contact_link($user->id, 'block', false, 'user.php?id=' . $user->id, true);
    }
} else {
    message_contact_link($user->id, 'add', false, 'user.php?id=' . $user->id, true);
    message_contact_link($user->id, 'block', false, 'user.php?id=' . $user->id, true);
}
message_history_link($user->id, 0, false, '', '', 'both');
echo '</div>';
echo '</td></tr></table>';
echo $OUTPUT->footer();
开发者ID:ajv,项目名称:Offline-Caching,代码行数:31,代码来源:user.php

示例3: message_print_contactlist_user

/**
 * Print a row of contactlist displaying user picture, messages waiting and
 * block links etc
 *
 * @param object $contact contact object containing all fields required for $OUTPUT->user_picture()
 * @param bool $incontactlist is the user a contact of ours?
 * @param bool $isblocked is the user blocked?
 * @param string $selectcontacturl the url to send the user to when a contact's name is clicked
 * @param bool $showactionlinks display action links next to the other users (add contact, block user etc)
 * @param object $selecteduser the user the current user is viewing (if any). They will be highlighted.
 * @return void
 */
function message_print_contactlist_user($contact, $incontactlist = true, $isblocked = false, $selectcontacturl = null, $showactionlinks = true, $selecteduser = null)
{
    global $OUTPUT, $USER, $COURSE;
    $fullname = fullname($contact);
    $fullnamelink = $fullname;
    $output = '';
    $linkclass = '';
    if (!empty($selecteduser) && $contact->id == $selecteduser->id) {
        $linkclass = 'messageselecteduser';
    }
    // Are there any unread messages for this contact?
    if ($contact->messagecount > 0) {
        $fullnamelink = '<strong>' . $fullnamelink . ' (' . $contact->messagecount . ')</strong>';
    }
    $strcontact = $strblock = $strhistory = null;
    if ($showactionlinks) {
        // Show block and delete links if user is real user.
        if (core_user::is_real_user($contact->id)) {
            $strcontact = message_get_contact_add_remove_link($incontactlist, $isblocked, $contact);
            $strblock = message_get_contact_block_link($incontactlist, $isblocked, $contact);
        }
        $strhistory = message_history_link($USER->id, $contact->id, true, '', '', 'icon');
    }
    $output .= html_writer::start_tag('div', array('class' => 'pix'));
    $output .= $OUTPUT->user_picture($contact, array('size' => 20, 'courseid' => $COURSE->id));
    $output .= html_writer::end_tag('div');
    $popupoptions = array('height' => MESSAGE_DISCUSSION_HEIGHT, 'width' => MESSAGE_DISCUSSION_WIDTH, 'menubar' => false, 'location' => false, 'status' => true, 'scrollbars' => true, 'resizable' => true);
    $link = $action = null;
    if (!empty($selectcontacturl)) {
        $link = new moodle_url($selectcontacturl . '&user2=' . $contact->id);
    } else {
        //can $selectcontacturl be removed and maybe the be removed and hardcoded?
        $link = new moodle_url("/message/index.php?id={$contact->id}");
        $action = new popup_action('click', $link, "message_{$contact->id}", $popupoptions);
    }
    if (strlen($strcontact . $strblock . $strhistory) > 0) {
        $output .= html_writer::tag('div', $strcontact . $strblock . $strhistory, array('class' => 'link'));
        $output .= html_writer::start_tag('div', array('class' => 'contact'));
        $linkattr = array('class' => $linkclass, 'title' => get_string('sendmessageto', 'message', $fullname));
        $output .= $OUTPUT->action_link($link, $fullnamelink, $action, $linkattr);
        $output .= html_writer::end_tag('div');
    } else {
        $output .= html_writer::start_tag('div', array('class' => 'contact nolinks'));
        $linkattr = array('class' => $linkclass, 'title' => get_string('sendmessageto', 'message', $fullname));
        $output .= $OUTPUT->action_link($link, $fullnamelink, $action, $linkattr);
        $output .= html_writer::end_tag('div');
    }
    return $output;
}
开发者ID:Hirenvaghasiya,项目名称:moodle,代码行数:61,代码来源:lib.php

示例4: message_print_contactlist_user

/**
 * Print a row of contactlist displaying user picture, messages waiting and 
 * block links etc
 * @param $contact contact object containing all fields required for print_user_picture()
 * @param $incontactlist is the user a contact of ours?
 */
function message_print_contactlist_user($contact, $incontactlist = true)
{
    $fullname = fullname($contact);
    $fullnamelink = $fullname;
    /// are there any unread messages for this contact?
    if ($contact->messagecount > 0) {
        $fullnamelink = '<strong>' . $fullnamelink . ' (' . $contact->messagecount . ')</strong>';
    }
    if ($incontactlist) {
        $strcontact = message_contact_link($contact->id, 'remove', true);
        $strblock = '';
    } else {
        $strcontact = message_contact_link($contact->id, 'add', true);
        $strblock = '&nbsp;' . message_contact_link($contact->id, 'block', true);
    }
    $strhistory = message_history_link($contact->id, 0, true, '', '', 'icon');
    echo '<tr><td class="pix">';
    print_user_picture($contact, SITEID, $contact->picture, 20, false, true, 'userwindow');
    echo '</td>';
    echo '<td class="contact">';
    link_to_popup_window("/message/discussion.php?id={$contact->id}", "message_{$contact->id}", $fullnamelink, 500, 500, get_string('sendmessageto', 'message', $fullname), 'menubar=0,location=0,status,scrollbars,resizable,width=500,height=500');
    echo '</td>';
    echo '<td class="link">&nbsp;' . $strcontact . $strblock . '&nbsp;' . $strhistory . '</td>';
    echo '</tr>';
}
开发者ID:r007,项目名称:PMoodle,代码行数:31,代码来源:lib.php

示例5: message_print_contactlist_user

/**
 * Print a row of contactlist displaying user picture, messages waiting and 
 * block links etc
 * @param $contact contact object containing all fields required for $OUTPUT->user_picture()
 * @param $incontactlist is the user a contact of ours?
 */
function message_print_contactlist_user($contact, $incontactlist = true)
{
    global $OUTPUT;
    $fullname = fullname($contact);
    $fullnamelink = $fullname;
    /// are there any unread messages for this contact?
    if ($contact->messagecount > 0) {
        $fullnamelink = '<strong>' . $fullnamelink . ' (' . $contact->messagecount . ')</strong>';
    }
    if ($incontactlist) {
        $strcontact = message_contact_link($contact->id, 'remove', true);
        $strblock = '';
    } else {
        $strcontact = message_contact_link($contact->id, 'add', true);
        $strblock = '&nbsp;' . message_contact_link($contact->id, 'block', true);
    }
    $strhistory = message_history_link($contact->id, 0, true, '', '', 'icon');
    echo '<tr><td class="pix">';
    $userpic = moodle_user_picture::make($contact, SITEID);
    $userpic->size = 20;
    $userpic->link = true;
    echo $OUTPUT->user_picture($userpic);
    echo '</td>';
    echo '<td class="contact">';
    $popupoptions = array('height' => 500, 'width' => 500, 'menubar' => false, 'location' => false, 'status' => true, 'scrollbars' => true, 'resizable' => true);
    $link = html_link::make("/message/discussion.php?id={$contact->id}", $fullnamelink);
    $link->add_action(new popup_action('click', $link->url, "message_{$contact->id}", $popupoptions));
    $link->title = get_string('sendmessageto', 'message', $fullname);
    echo $OUTPUT->link($link);
    echo '</td>';
    echo '<td class="link">&nbsp;' . $strcontact . $strblock . '&nbsp;' . $strhistory . '</td>';
    echo '</tr>';
}
开发者ID:ajv,项目名称:Offline-Caching,代码行数:39,代码来源:lib.php


注:本文中的message_history_link函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。