本文整理汇总了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';
}
}
示例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;
}
}
示例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;
}
}