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


PHP message_print_search_results函数代码示例

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


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

示例1: message_print_search

function message_print_search()
{
    global $USER;
    if ($frm = data_submitted()) {
        message_print_search_results($frm);
    } else {
        /*
        /// unfinished buggy code disabled in search.html anyway
                // find all courses this use has readallmessages capabilities in
                if ($teachers = get_user_capability_course('moodle/site:readallmessages')) {
                    $courses = get_courses('all', 'c.sortorder ASC', 'c.id, c.shortname');
                    $cs = '<select name="courseselect">';
                    foreach ($teachers as $tcourse) {
                        $cs .= "<option value=\"$tcourse->course\">".$courses[$tcourse->id]->shortname."</option>\n";
                    }
                    $cs .= '</select>';
                }
        */
        include 'search.html';
    }
}
开发者ID:r007,项目名称:PMoodle,代码行数:21,代码来源:lib.php

示例2: message_print_search

/**
 * Print the search form and search results if a search has been performed
 * @param  boolean $advancedsearch show basic or advanced search form
 * @param  object $user1 the current user
 * @return boolean true if a search was performed
 */
function message_print_search($advancedsearch = false, $user1=null) {
    $frm = data_submitted();

    $doingsearch = false;
    if ($frm) {
        if (confirm_sesskey()) {
            $doingsearch = !empty($frm->combinedsubmit) || !empty($frm->keywords) || (!empty($frm->personsubmit) and !empty($frm->name));
        } else {
            $frm = false;
        }
    }

    if (!empty($frm->combinedsearch)) {
        $combinedsearchstring = $frm->combinedsearch;
    } else {
        //$combinedsearchstring = get_string('searchcombined','message').'...';
        $combinedsearchstring = '';
    }

    if ($doingsearch) {
        if ($advancedsearch) {

            $messagesearch = '';
            if (!empty($frm->keywords)) {
                $messagesearch = $frm->keywords;
            }
            $personsearch = '';
            if (!empty($frm->name)) {
                $personsearch = $frm->name;
            }
            include('search_advanced.html');
        } else {
            include('search.html');
        }

        $showicontext = false;
        message_print_search_results($frm, $showicontext, $user1);

        return true;
    } else {

        if ($advancedsearch) {
            $personsearch = $messagesearch = '';
            include('search_advanced.html');
        } else {
            include('search.html');
        }
        return false;
    }
}
开发者ID:nfreear,项目名称:moodle,代码行数:56,代码来源:lib.php

示例3: message_print_search

/**
 *
 * @global <type> $USER
 * @global <type> $PAGE
 * @global <type> $OUTPUT
 * @param  boolean advancedsearch show basic or advanced search form
 * @return boolean was a search performed?
 */
function message_print_search($advancedsearch = false, $user1 = null)
{
    global $USER, $PAGE, $OUTPUT;
    $frm = data_submitted();
    $doingsearch = false;
    if ($frm) {
        $doingsearch = !empty($frm->combinedsubmit) || !empty($frm->keywords) || (!empty($frm->personsubmit) and !empty($frm->name));
    }
    if (!empty($frm->combinedsearch)) {
        $combinedsearchstring = $frm->combinedsearch;
    } else {
        //$combinedsearchstring = get_string('searchcombined','message').'...';
        $combinedsearchstring = '';
    }
    //$PAGE->requires->js_init_call('M.core_message.init_search_page', array($combinedsearchstring));
    if ($doingsearch) {
        if ($advancedsearch) {
            $messagesearch = '';
            if (!empty($frm->keywords)) {
                $messagesearch = $frm->keywords;
            }
            $personsearch = '';
            if (!empty($frm->name)) {
                $personsearch = $frm->name;
            }
            include 'search_advanced.html';
        } else {
            include 'search.html';
        }
        $showicontext = false;
        message_print_search_results($frm, $showicontext, $user1);
        return true;
    } else {
        /*
        /// unfinished buggy code disabled in search.html anyway
                // find all courses this use has readallmessages capabilities in
                if ($teachers = get_user_capability_course('moodle/site:readallmessages')) {
                    $courses = get_courses('all', 'c.sortorder ASC', 'c.id, c.shortname');
                    $cs = '<select name="courseselect">';
                    foreach ($teachers as $tcourse) {
                        $cs .= "<option value=\"$tcourse->course\">".$courses[$tcourse->id]->shortname."</option>\n";
                    }
                    $cs .= '</select>';
                }
        */
        if ($advancedsearch) {
            $personsearch = $messagesearch = '';
            include 'search_advanced.html';
        } else {
            include 'search.html';
        }
        return false;
    }
}
开发者ID:vuchannguyen,项目名称:web,代码行数:62,代码来源:lib.php


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