示例#1
0
if ($oublog->global) {
    if (!is_null($oubloginstance)) {
        $name = $oubloginstance->name;
        $buttontext = oublog_get_search_form('user', $oubloguser->id, $strblogsearch, $querytexthtml);
    } else {
        $buttontext = oublog_get_search_form('id', $cm->id, $strblogssearch, $querytexthtml);
    }
    if (isset($name)) {
        $PAGE->navbar->add(fullname($oubloguser), new moodle_url('/user/view.php', array('id' => $oubloguser->id)));
        $PAGE->navbar->add(format_string($oubloginstance->name), $mreturnurl);
    } else {
        $PAGE->navbar->add(format_string($oublog->name), new moodle_url('/mod/oublog/allposts.php'));
    }
} else {
    $name = $oublog->name;
    $buttontext = oublog_get_search_form('id', $cm->id, $strblogsearch, $querytexthtml);
}
$PAGE->navbar->add(get_string('searchfor', 'local_ousearch', $querytext));
$PAGE->set_button($buttontext);
echo $OUTPUT->header();
// Print Groups
groups_print_activity_menu($cm, $returnurl);
global $modulecontext, $personalblog;
$modulecontext = $context;
$personalblog = $oublog->global ? true : false;
// FINALLY do the actual query
$query = new local_ousearch_search($querytext);
$query->set_coursemodule($cm);
if ($oublog->global && isset($oubloguser)) {
    $query->set_user_id($oubloguser->id);
} else {
示例#2
0
    $completion = new completion_info($course);
    $completion->set_module_viewed($cm);
}
// Print the header.
$PAGEWILLCALLSKIPMAINDESTINATION = true;
$hideunusedblog = false;
if ($oublog->global) {
    $blogtype = 'personal';
    $returnurl = $CFG->wwwroot . '/mod/oublog/view.php?user='******'user', $oubloguser->id, $strblogsearch);
} else {
    $blogtype = 'course';
    $returnurl = $CFG->wwwroot . '/mod/oublog/view.php?id=' . $id;
    $name = $oublog->name;
    $buttontext = oublog_get_search_form('id', $cm->id, $strblogsearch);
}
if ($tag) {
    $returnurl .= '&tag=' . urlencode($tag);
}
// Set-up individual.
$currentindividual = -1;
$individualdetails = 0;
// Set up whether the group selector should display.
$showgroupselector = true;
if ($oublog->individual) {
    // If separate individual and visible group, do not show groupselector
    // unless the current user has permission.
    if ($oublog->individual == OUBLOG_SEPARATE_INDIVIDUAL_BLOGS && !has_capability('mod/oublog:viewindividual', $context)) {
        $showgroupselector = false;
    }