} else if (!empty($CFG->defaulthomepage) && ($CFG->defaulthomepage == HOMEPAGE_MY) && optional_param('redirect', 1, PARAM_BOOL) === 1) { redirect($CFG->wwwroot .'/my/'); } else if (!empty($CFG->defaulthomepage) && ($CFG->defaulthomepage == HOMEPAGE_USER)) { $PAGE->settingsnav->get('usercurrentsettings')->add(get_string('makethismyhome'), new moodle_url('/', array('setdefaulthome'=>true)), navigation_node::TYPE_SETTING); } } if (isloggedin()) { add_to_log(SITEID, 'course', 'view', 'view.php?id='.SITEID, SITEID); } /// If the hub plugin is installed then we let it take over the homepage here if (file_exists($CFG->dirroot.'/local/hub/lib.php') and get_config('local_hub', 'hubenabled')) { require_once($CFG->dirroot.'/local/hub/lib.php'); $hub = new local_hub(); $continue = $hub->display_homepage(); //display_homepage() return true if the hub home page is not displayed //mostly when search form is not displayed for not logged users if (empty($continue)) { exit; } } $PAGE->set_pagetype('site-index'); $PAGE->set_docs_path(''); $PAGE->set_pagelayout('frontpage'); $editing = $PAGE->user_is_editing(); $PAGE->set_title($SITE->fullname); $PAGE->set_heading($SITE->fullname); echo $OUTPUT->header();