當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。