function print_header($title) { global $USER; $replacements = array('%fullname%' => get_string('mymoodle', 'my')); foreach ($replacements as $search => $replace) { $title = str_replace($search, $replace, $title); } $site = get_site(); $button = update_mymoodle_icon($USER->id); $nav = get_string('mymoodle', 'my'); $header = $site->shortname . ': ' . $nav; $loggedinas = user_login_string($site); print_header($title, $header, $nav, '', '', true, $button, $loggedinas); }
function print_header($title) { global $USER, $CFG; $replacements = array('%fullname%' => get_string('mymoodle', 'my')); foreach ($replacements as $search => $replace) { $title = str_replace($search, $replace, $title); } $site = get_site(); $button = update_mymoodle_icon($USER->id); $nav = get_string('mymoodle', 'my'); $header = $site->shortname . ': ' . $nav; $navlinks = array(array('name' => $nav, 'link' => '', 'type' => 'misc')); $navigation = build_navigation($navlinks); $loggedinas = user_login_string($site); if (empty($CFG->langmenu)) { $langmenu = ''; } else { $currlang = current_language(); $langs = get_list_of_languages(); $langlabel = get_accesshide(get_string('language')); $langmenu = popup_form($CFG->wwwroot . '/my/index.php?lang=', $langs, 'chooselang', $currlang, '', '', '', true, 'self', $langlabel); } print_header($title, $header, $navigation, '', '', true, $button, $loggedinas . $langmenu); }
notice_yesno(get_string('noguest', 'my') . '<br /><br />' . get_string('liketologin'), get_login_url(), $CFG->wwwroot); print_footer(); die; } $edit = optional_param('edit', -1, PARAM_BOOL); $blockaction = optional_param('blockaction', '', PARAM_ALPHA); $PAGE->set_context(get_context_instance(CONTEXT_USER, $USER->id)); $PAGE->set_url('my/index.php'); $PAGE->set_blocks_editing_capability('moodle/my:manageblocks'); // Note: MDL-19010 there will be further changes to printing header and blocks. // The code will be much nicer than this eventually. $pageblocks = blocks_setup($PAGE, BLOCKS_PINNED_BOTH); if ($edit != -1 and $PAGE->user_allowed_editing()) { $USER->editing = $edit; } $button = update_mymoodle_icon($USER->id); $header = $SITE->shortname . ': ' . $strmymoodle; $navigation = build_navigation($strmymoodle); $loggedinas = user_login_string(); if (empty($CFG->langmenu)) { $langmenu = ''; } else { $currlang = current_language(); $langs = get_list_of_languages(); $langlabel = get_accesshide(get_string('language')); $langmenu = popup_form($CFG->wwwroot . '/my/index.php?lang=', $langs, 'chooselang', $currlang, '', '', '', true, 'self', $langlabel); } print_header($strmymoodle, $header, $navigation, '', '', true, $button, $loggedinas . $langmenu); echo '<table id="layout-table">'; echo '<tr valign="top">'; $lt = empty($THEME->layouttable) ? array('left', 'middle', 'right') : $THEME->layouttable;