function show_header() { global $CFG, $USER; $swwwroot = htmlspecialchars($CFG->wwwroot); $navtail = get_string('summary_title', ANNOTATION_STRINGS); $navmiddle = ""; require_js(ANNOTATION_PATH . '/marginalia/3rd-party.js'); require_js(ANNOTATION_PATH . '/marginalia/log.js'); require_js(ANNOTATION_PATH . '/marginalia-config.js'); require_js(ANNOTATION_PATH . '/marginalia/domutil.js'); require_js(ANNOTATION_PATH . '/marginalia/prefs.js'); require_js(ANNOTATION_PATH . '/marginalia/rest-prefs.js'); require_js(ANNOTATION_PATH . '/marginalia/annotation.js'); require_js(ANNOTATION_PATH . '/marginalia/rest-annotate.js'); require_js(ANNOTATION_PATH . '/smartquote.js'); require_js(ANNOTATION_PATH . '/summary.js'); $meta = "<link rel='stylesheet' type='text/css' href='" . s(ANNOTATION_PATH) . "/summary-styles.php'/>\n"; if (null != $this->course && $this->course->category) { print_header($this->course->shortname . ': ' . get_string('summary_title', ANNOTATION_STRINGS), $this->course->fullname, '<a href=' . $CFG->wwwroot . '/course/view.php?id=' . $this->course->id . '>' . $this->course->shortname . '</a> -> ' . $navtail, "", $meta, true, "", navmenu($this->course)); } elseif (null != $this->course) { print_header($this->course->shortname . ': ' . get_string('summary_title', ANNOTATION_STRINGS), $this->course->fullname, $navtail, "", $meta, true, "", navmenu($this->course)); } else { print_header(get_string('summary_title', ANNOTATION_STRINGS), null, "{$navtail}", "", $meta, true, "", null); } // echo $tagsHtml; if (isloggedin()) { $sannotationpath = s(ANNOTATION_PATH); echo "<script language='JavaScript' type='text/javascript'>\n" . "var annotationService = new RestAnnotationService('{$sannotationpath}/annotate.php', { csrfCookie: 'MoodleSessionTest' } );\n" . "window.annotationSummary = new AnnotationSummary(annotationService" . ", '{$swwwroot}'" . ", '" . s($USER->username) . "');\n" . "window.preferences = new Preferences( new RestPreferenceService('{$sannotationpath}/user-preference.php' ) );\n" . "</script>\n"; } }
/** * Constructor for the base resource class * * Constructor for the base resource class. * If cmid is set create the cm, course, resource objects. * and do some checks to make sure people can be here, and so on. * * @param cmid integer, the current course module id - not set for new resources */ function resource_base($cmid = 0) { global $CFG, $COURSE; $this->navlinks = array(); if ($cmid) { if (!($this->cm = get_coursemodule_from_id('resource', $cmid))) { error("Course Module ID was incorrect"); } if (!($this->course = get_record("course", "id", $this->cm->course))) { error("Course is misconfigured"); } if (!($this->resource = get_record("resource", "id", $this->cm->instance))) { error("Resource ID was incorrect"); } $this->strresource = get_string("modulename", "resource"); $this->strresources = get_string("modulenameplural", "resource"); if (!$this->cm->visible and !has_capability('moodle/course:viewhiddenactivities', get_context_instance(CONTEXT_MODULE, $this->cm->id))) { $pagetitle = strip_tags($this->course->shortname . ': ' . $this->strresource); $navigation = build_navigation($this->navlinks, $this->cm); print_header($pagetitle, $this->course->fullname, $navigation, "", "", true, '', navmenu($this->course, $this->cm)); notice(get_string("activityiscurrentlyhidden"), "{$CFG->wwwroot}/course/view.php?id={$this->course->id}"); } } else { $this->course = $COURSE; } }
public function print_header($title, $morebreadcrumbs = null, $navigation = '') { global $USER, $CFG; $this->init_full(); $replacements = array('%fullname%' => format_string($this->activityrecord->name)); foreach ($replacements as $search => $replace) { $title = str_replace($search, $replace, $title); } if ($this->courserecord->id == SITEID) { $breadcrumbs = array(); } else { $breadcrumbs = array($this->courserecord->shortname => $CFG->wwwroot . '/course/view.php?id=' . $this->courserecord->id); } $breadcrumbs[get_string('modulenameplural', 'game')] = $CFG->wwwroot . '/mod/game/index.php?id=' . $this->courserecord->id; $breadcrumbs[format_string($this->activityrecord->name)] = $CFG->wwwroot . '/mod/game/view.php?id=' . $this->modulerecord->id; if (!empty($morebreadcrumbs)) { $breadcrumbs = array_merge($breadcrumbs, $morebreadcrumbs); } if (empty($morebreadcrumbs) && $this->user_allowed_editing()) { $buttons = '<table><tr><td>' . update_module_button($this->modulerecord->id, $this->courserecord->id, get_string('modulename', 'game')) . '</td>'; if (!empty($CFG->showblocksonmodpages)) { $buttons .= '<td><form ' . $CFG->frametarget . ' method="get" action="view.php">' . '<div>' . '<input type="hidden" name="id" value="' . $this->modulerecord->id . '" />' . '<input type="hidden" name="edit" value="' . ($this->user_is_editing() ? 'off' : 'on') . '" />' . '<input type="submit" value="' . get_string($this->user_is_editing() ? 'blockseditoff' : 'blocksediton') . '" />' . '</div></form></td>'; } $buttons .= '</tr></table>'; } else { $buttons = ' '; } print_header($title, $this->courserecord->fullname, $navigation); }
function print_message($msg) { print_header(); echo "\n<center>\n<table height=300>\n<tr><td align=center><font color=NAVY><b>\n {$msg}\n </b></font>\n </td>\n</tr>\n</table>\n\t"; print_footer(); exit; }
function print_entry($course) { global $CFG, $USER; $strloginto = get_string("loginto", "", $course->shortname); $strcourses = get_string("courses"); $teacher = get_teacher($course->id); if ((double) $course->cost < 0) { $cost = (double) $CFG->enrol_cost; } else { $cost = (double) $course->cost; } if (abs($cost) < 0.01) { // no cost, default to base class entry to course $manual = enrolment_factory::factory('manual'); $manual->print_entry($course); } else { $navlinks = array(); $navlinks[] = array('name' => $strcourses, 'link' => "{$CFG->wwwroot}/course", 'type' => 'misc'); $navlinks[] = array('name' => $strloginto, 'link' => null, 'type' => 'misc'); $navigation = build_navigation($navlinks); print_header($strloginto, $course->fullname, $navigation); print_course($course, "80%"); if ($course->password) { // Presenting two options print_heading(get_string('costorkey', 'enrol_paypal'), 'center'); } print_simple_box_start("center"); if ($USER->username == 'guest') { // force login only for guest user, not real users with guest role if (empty($CFG->loginhttps)) { $wwwroot = $CFG->wwwroot; } else { // This actually is not so secure ;-), 'cause we're // in unencrypted connection... $wwwroot = str_replace("http://", "https://", $CFG->wwwroot); } echo '<div align="center"><p>' . get_string('paymentrequired') . '</p>'; echo '<p><b>' . get_string('cost') . ": {$CFG->enrol_currency} {$cost}" . '</b></p>'; echo '<p><a href="' . $wwwroot . '/login/">' . get_string('loginsite') . '</a></p>'; echo '</div>'; } else { //Sanitise some fields before building the PayPal form $coursefullname = $course->fullname; $courseshortname = $course->shortname; $userfullname = fullname($USER); $userfirstname = $USER->firstname; $userlastname = $USER->lastname; $useraddress = $USER->address; $usercity = $USER->city; include $CFG->dirroot . '/enrol/paypal/enrol.html'; } print_simple_box_end(); if ($course->password) { // Second option $password = ''; include $CFG->dirroot . '/enrol/manual/enrol.html'; } print_footer(); } }
/** * Show a simple confirmation form */ public static function confirm($label) { if (is_post()) { if (isset($_POST['confirm_yes'])) { return true; } else { if (isset($_POST['confirm_no'])) { return false; } } } ?> <?php print_header(); ?> <div id="confirm_form"> <?php \Meta\Core\Form::open(); ?> <h2><?php echo $label; ?> </h2> <input type="submit" name="confirm_yes" value="Sim" /> <input type="submit" name="confirm_no" value="Nao" /> <?php \Meta\Core\Form::close(); ?> </div> <?php print_footer(); ?> <?php exit; }
function print_header($title, $morenavlinks = NULL, $bodytags = '', $meta = '', $extrabuttons = '') { global $USER, $CFG; $this->init_full(); $replacements = array('%fullname%' => format_string($this->activityrecord->name)); foreach ($replacements as $search => $replace) { $title = str_replace($search, $replace, $title); } if (empty($morenavlinks) && $this->user_allowed_editing()) { // mmmm, tables $buttons = '<table><tr>'; $buttons .= '<td>' . $extrabuttons . '</td>'; $buttons .= '<td>' . update_module_button(optional_param('clone', $this->modulerecord->id, PARAM_INT), $this->courserecord->id, get_string('modulename', $this->activityname)) . '</td>'; if (!empty($CFG->showblocksonmodpages)) { $clonething = optional_param('clone', 0, PARAM_INT); $clonething = $clonething ? '<input type="hidden" name="clone" value="' . $clonething . '" />' : ''; $buttons .= '<td><form ' . $CFG->frametarget . ' method="get" action="view.php"><div>' . '<input type="hidden" name="id" value="' . $this->modulerecord->id . '" />' . $clonething . '<input type="hidden" name="edit" value="' . ($this->user_is_editing() ? 'off' : 'on') . '" />' . '<input type="submit" value="' . get_string($this->user_is_editing() ? 'blockseditoff' : 'blocksediton') . '" /></div></form></td>'; } $buttons .= '</tr></table>'; } else { $buttons = $extrabuttons ? $extrabuttons : ' '; } if (empty($morenavlinks)) { $morenavlinks = array(); } $navigation = build_navigation($morenavlinks, $this->modulerecord); print_header($title, $this->courserecord->fullname, $navigation, '', $meta, true, $buttons, navmenu($this->courserecord, $this->modulerecord), false, $bodytags); }
function invalid_booking($message) { global $day, $month, $year, $area, $room; print_header($day, $month, $year, $area, isset($room) ? $room : ""); echo "<h1>" . get_vocab('invalid_booking') . "</h1>\n"; echo "<p>{$message}</p>\n"; // Print footer and exit print_footer(TRUE); }
function output_html($result = array(), $arguments = array()) { print_header(); print_table_head(); foreach ($result as $no => $line) { print_table_line($no, $line['day'], $line['counter']); } print_footer(); }
/** * Prints the page header. */ function print_header() { global $CFG, $USER, $PAGE; require_once $CFG->libdir . '/blocklib.php'; require_once $CFG->dirroot . '/course/lib.php'; require_once $CFG->dirroot . '/my/pagelib.php'; /// My Moodle arguments: $edit = optional_param('edit', -1, PARAM_BOOL); $blockaction = optional_param('blockaction', '', PARAM_ALPHA); $mymoodlestr = get_string('mymoodle', 'my'); if (isguest()) { $wwwroot = $CFG->wwwroot . '/login/index.php'; if (!empty($CFG->loginhttps)) { $wwwroot = str_replace('http:', 'https:', $wwwroot); } print_header($mymoodlestr); notice_yesno(get_string('noguest', 'my') . '<br /><br />' . get_string('liketologin'), $wwwroot, $CFG->wwwroot); print_footer(); die; } /// Add curriculum stylesheets... if (file_exists($CFG->dirroot . '/curriculum/styles.css')) { $CFG->stylesheets[] = $CFG->wwwroot . '/curriculum/styles.css'; } /// Fool the page library into thinking we're in My Moodle. $CFG->pagepath = $CFG->wwwroot . '/my/index.php'; $PAGE = page_create_instance($USER->id); if ($section = optional_param('section', '', PARAM_ALPHAEXT)) { $PAGE->section = $section; } $this->pageblocks = blocks_setup($PAGE, BLOCKS_PINNED_BOTH); /// Make sure that the curriculum block is actually on this /// user's My Moodle page instance. if ($cablockid = get_field('block', 'id', 'name', 'curr_admin')) { if (!record_exists('block_pinned', 'blockid', $cablockid, 'pagetype', 'my-index')) { blocks_execute_action($PAGE, $this->pageblocks, 'add', (int) $cablockid, true, false); } } if ($edit != -1 and $PAGE->user_allowed_editing()) { $USER->editing = $edit; } //$PAGE->print_header($mymoodlestr); $title = $this->get_title(); print_header($title, $title, build_navigation($this->get_navigation())); echo '<table border="0" cellpadding="3" cellspacing="0" width="100%" id="layout-table">'; echo '<tr valign="top">'; $blocks_preferred_width = bounded_number(180, blocks_preferred_width($this->pageblocks[BLOCK_POS_LEFT]), 210); if (blocks_have_content($this->pageblocks, BLOCK_POS_LEFT) || $PAGE->user_is_editing()) { echo '<td style="vertical-align: top; width: ' . $blocks_preferred_width . 'px;" id="left-column">'; blocks_print_group($PAGE, $this->pageblocks, BLOCK_POS_LEFT); echo '</td>'; } echo '<td valign="top" id="middle-column">'; if (blocks_have_content($this->pageblocks, BLOCK_POS_CENTRE) || $PAGE->user_is_editing()) { blocks_print_group($PAGE, $this->pageblocks, BLOCK_POS_CENTRE); } }
function display() { global $CFG; $formatoptions = new object(); $formatoptions->noclean = true; /// Are we displaying the course blocks? if ($this->resource->options == 'showblocks') { parent::display_course_blocks_start(); $entry = get_record('kaltura_entries', 'context', "R_" . "{$this->resource}->id"); if (trim(strip_tags($this->resource->alltext))) { echo $entry->title; $player_url = $CFG->wwwroot . '/mod/kaltura/kswfdoc.php?context=' . $this->course->id . '&entry_id=' . $resource->alltext; $formatoptions = new object(); $formatoptions->noclean = true; print_simple_box(format_text($resource->summary, FORMAT_MOODLE, $formatoptions, $this->course->id), "center"); if ($resource->alltext) { echo '<input style="margin-top:20px;" type="button" value="View video presentation" onclick="kalturaInitModalBox(\'' . $player_url . '\', {width:780, height:400});">'; } // echo embed_kaltura($resource->alltext,get_width($entry),get_height($entry),$entry->entry_type); } parent::display_course_blocks_end(); } else { /// Set up generic stuff first, including checking for access parent::display(); /// Set up some shorthand variables $cm = $this->cm; $course = $this->course; $resource = $this->resource; $entry = get_record('kaltura_entries', 'context', "R_" . "{$resource->id}"); $pagetitle = strip_tags($course->shortname . ': ' . format_string($resource->name)); $inpopup = optional_param('inpopup', '', PARAM_BOOL); add_to_log($course->id, "resource", "view", "view.php?id={$cm->id}", $resource->id, $cm->id); $navigation = build_navigation($this->navlinks, $cm); print_header($pagetitle, $course->fullname, $navigation, "", "", true, update_module_button($cm->id, $course->id, $this->strresource), navmenu($course, $cm)); if (trim(strip_tags($this->resource->alltext))) { echo $entry->title; } $formatoptions = new object(); $formatoptions->noclean = true; print_simple_box(format_text($resource->summary, FORMAT_MOODLE, $formatoptions, $this->course->id), "center"); if (trim(strip_tags($this->resource->alltext))) { $player_url = $CFG->wwwroot . '/mod/kaltura/kswfdoc.php?context=' . $this->course->id . '&entry_id=' . $resource->alltext; if ($resource->alltext) { echo '<input type="button" style="margin-top:20px;" value="View video presentation" onclick="kalturaInitModalBox(\'' . $player_url . '\', {width:780, height:400});">'; } // echo embed_kaltura($resource->alltext,get_width($entry),get_height($entry),$entry->entry_type); } /* print_simple_box(format_text($resource->alltext, $resource->reference, $formatoptions, $course->id), "center", "", "", "20"); */ $strlastmodified = get_string("lastmodified"); echo "<div class=\"modified\">{$strlastmodified}: " . userdate($resource->timemodified) . "</div>"; print_footer($course); } }
function display() { global $CFG; $formatoptions = new object(); $formatoptions->noclean = true; /// Are we displaying the course blocks? if ($this->resource->options == 'showblocks') { parent::display_course_blocks_start(); $entry = get_record('kaltura_entries', 'context', "R_" . "{$this->resource}->id"); if (trim(strip_tags($this->resource->alltext))) { echo $entry->title; $context = get_context_instance(CONTEXT_COURSE, $this->course->id); $formatoptions = new object(); $formatoptions->noclean = true; print_simple_box(format_text($resource->summary, FORMAT_MOODLE, $formatoptions, $this->course->id), "center"); if (has_capability('moodle/course:manageactivities', $context)) { echo embed_kaltura($resource->alltext, get_width($entry), get_height($entry), $entry->entry_type, $entry->design, true); } else { echo embed_kaltura($resource->alltext, get_width($entry), get_height($entry), KalturaEntryType::MEDIA_CLIP, $entry->design, true); } } parent::display_course_blocks_end(); } else { /// Set up generic stuff first, including checking for access parent::display(); /// Set up some shorthand variables $cm = $this->cm; $course = $this->course; $resource = $this->resource; $entry = get_record('kaltura_entries', 'context', "R_" . "{$resource->id}"); $pagetitle = strip_tags($course->shortname . ': ' . format_string($resource->name)); $inpopup = optional_param('inpopup', '', PARAM_BOOL); add_to_log($course->id, "resource", "view", "view.php?id={$cm->id}", $resource->id, $cm->id); $navigation = build_navigation($this->navlinks, $cm); print_header($pagetitle, $course->fullname, $navigation, "", "", true, update_module_button($cm->id, $course->id, $this->strresource), navmenu($course, $cm)); if (trim(strip_tags($this->resource->alltext))) { echo $entry->title; $context = get_context_instance(CONTEXT_COURSE, $this->course->id); $formatoptions = new object(); $formatoptions->noclean = true; print_simple_box(format_text($resource->summary, FORMAT_MOODLE, $formatoptions, $this->course->id), "center"); if (has_capability('moodle/course:manageactivities', $context)) { echo embed_kaltura($resource->alltext, get_width($entry), get_height($entry), $entry->entry_type, $entry->design, true); } else { echo embed_kaltura($resource->alltext, get_width($entry), get_height($entry), KalturaEntryType::MEDIA_CLIP, $entry->design, true); } } /* print_simple_box(format_text($resource->alltext, $resource->reference, $formatoptions, $course->id), "center", "", "", "20"); */ $strlastmodified = get_string("lastmodified"); echo "<div class=\"modified\">{$strlastmodified}: " . userdate($resource->timemodified) . "</div>"; print_footer($course); } }
function header_main() { global $gbl, $sgbl, $login, $ghtml; initProgram(); init_language(); print_meta_lan(); if ($login->isDefaultSkin()) { print_header_old_default(); } else { print_header(); } }
function rejudge_showresult($success = true) { print_header(get_string('notice')); if ($success) { $message = get_string('rejudgesuccess', 'assignment_onlinejudge'); } else { $message = get_string('rejudgefailed', 'assignment_onlinejudge'); } print_box($message, 'generalbox', 'notice'); close_window_button(); print_footer('none'); }
/** * Constructor for the webquestscorm class * * Constructor for the base assignment class. * If cmid is set create the cm, course, assignment objects. * If the assignment is hidden and the user is not a teacher then * this prints a page header and notice. * * @param cmid integer, the current course module id - not set for new assignments * @param assignment object, usually null, but if we have it we pass it to save db access * @param cm object, usually null, but if we have it we pass it to save db access * @param course object, usually null, but if we have it we pass it to save db access */ function webquestscorm($cmid = 0, $webquestscorm = NULL, $cm = NULL, $course = NULL) { global $CFG; if ($cmid) { if ($cm) { $this->cm = $cm; } else { if (!($this->cm = get_coursemodule_from_id('webquestscorm', $cmid))) { error('Course Module ID was incorrect'); } } $this->context = get_context_instance(CONTEXT_MODULE, $this->cm->id); if ($course) { $this->course = $course; } else { if (!($this->course = get_record('course', 'id', $this->cm->course))) { error('Course is misconfigured'); } } if ($webquestscorm) { $this->webquestscorm = $webquestscorm; } else { if (!($this->webquestscorm = get_record('webquestscorm', 'id', $this->cm->instance))) { error('webquestscorm ID was incorrect'); } } $this->strwebquestscorm = get_string('modulename', 'webquestscorm'); $this->strwebquestscorms = get_string('modulenameplural', 'webquestscorm'); $this->strsubmissions = get_string('submissions', 'webquestscorm'); $this->strlastmodified = get_string('lastmodified'); if ($this->course->category) { $this->navigation = "<a target=\"{$CFG->framename}\" href=\"{$CFG->wwwroot}/course/view.php?id={$this->course->id}\">{$this->course->shortname}</a> -> " . "<a target=\"{$CFG->framename}\" href=\"index.php?id={$this->course->id}\">{$this->strwebquestscorms}</a> ->"; } else { $this->navigation = "<a target=\"{$CFG->framename}\" href=\"index.php?id={$this->course->id}\">{$this->strwebquestscorms}</a> ->"; } $this->pagetitle = strip_tags($this->course->shortname . ': ' . $this->strwebquestscorm . ': ' . format_string($this->webquestscorm->name, true)); // visibility $this->context = get_context_instance(CONTEXT_MODULE, $this->cm->id); if (!$this->cm->visible and !has_capability('moodle/course:viewhiddenactivities', $this->context)) { $this->pagetitle = strip_tags($this->course->shortname . ': ' . $this->strwebquestscorm); print_header($this->pagetitle, $this->course->fullname, "{$this->navigation} {$this->strwebquestscorm}", "", "", true, '', navmenu($this->course, $this->cm)); notice(get_string("activityiscurrentlyhidden"), "{$CFG->wwwroot}/course/view.php?id={$this->course->id}"); } $this->currentgroup = get_current_group($this->course->id); $this->path = $CFG->dataroot . '/' . $this->cm->course . '/moddata/webquestscorm' . '/' . $this->cm->id; } if ($this->usehtmleditor = can_use_html_editor()) { $this->defaultformat = FORMAT_HTML; } else { $this->defaultformat = FORMAT_MOODLE; } }
function page_denied() { ?> <?php print_header(); ?> <h3>You don't have permission to access this page.</h3> <?php print_footer(); ?> <?php exit; }
function iplookup_display($ip, $user = 0) { print_header(); if ($user) { if ($user = get_record('user', 'id', $user)) { print_heading(fullname($user) . ", {$user->city}, {$user->country}", 'center', '4'); } } echo 'Search results: <iframe src="http://www.hostip.info/api/get.html?ip=' . $ip . '" height="60" width="300"></iframe>'; echo '<object data="http://www.hostip.info/map/frame.html?ip=' . $ip . '" ' . 'type="text/html" border="0" width="610" height="330"></object>'; close_window_button(); print_footer('none'); }
function alert_error($error, $return) { global $head; if (!$head) { print_header(''); } if (!$return) { echo "<script>alert('{$error}');window.close();</script></body></html>"; } else { echo "<script>alert('{$error}');window.location.href='{$return}';</script></body></html>"; } die; }
function header_main() { global $gbl, $sgbl, $login, $ghtml; initProgram(); initLanguage(); initLanguageCharset(); // Load default skin or feather skin if ($login->isDefaultSkin()) { include_once "lib/default_header.php"; CreateDefaultHeaderMenu(); } else { print_header(); } }
function print_header($title) { global $USER, $CFG; $replacements = array('%fullname%' => get_string('mycollaboration', 'local')); foreach ($replacements as $search => $replace) { $title = str_replace($search, $replace, $title); } $site = get_site(); $nav = get_string('mycollaboration', 'local'); $header = $site->shortname . ': ' . $nav; $navlinks = array(array('name' => $nav, 'link' => '', 'type' => 'misc')); $navigation = build_navigation($navlinks); print_header($title, $header, $navigation, '', '', true); }
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); }
{ global $course, $choose; echo '</td></tr></table>'; print_footer($course); } function html_header($course, $wdir, $formfield = "") { global $CFG, $ME, $choose; if (!($site = get_site())) { error("Invalid site!"); } if ($course->id == $site->id) { $strfiles = get_string("sitefiles"); } else { $strfiles = get_string("files"); } if ($wdir == "/") { $fullnav = "{$strfiles}"; } else { $dirs = explode("/", $wdir); $numdirs = count($dirs); $link = ""; $navigation = ""; for ($i = 1; $i < $numdirs - 1; $i++) { $navigation .= " -> "; $link .= "/" . urlencode($dirs[$i]); $navigation .= "<a href=\"" . $ME . "?id={$course->id}&pod={$podcast}&wdir={$wdir}&choose={$choose}\">" . $dirs[$i] . "</a>"; } $fullnav = "<a href=\"" . $ME . "?id={$course->id}&pod={$podcast}&wdir={$wdir}&choose={$choose}\">{$strfiles}</a> {$navigation} -> " . $dirs[$numdirs - 1]; } if ($choose) { print_header(); $chooseparts = explode('.', $choose); ?> <script language="javascript" type="text/javascript"> <!-- function set_value(txt) { opener.document.forms['<?php echo $chooseparts[0] . "']." . $chooseparts[1]; ?> .value = txt; window.close(); } --> </script> <?php echo '<div id="nav-bar">Podcast</div>'; if ($course->id == $site->id) { print_heading(get_string("publicsitefileswarning"), "center", 2);
/** * initialize the controller */ function init() { global $pgv_lang, $CONTACT_EMAIL, $GEDCOM, $pgv_changes; $this->nid = safe_GET_xref('nid'); $noterec = find_other_record($this->nid); if (isset($pgv_changes[$this->nid . "_" . $GEDCOM])) { $noterec = "0 @" . $this->nid . "@ NOTE\n"; } else { if (!$noterec) { return false; } } $this->note = new Note($noterec); $this->note->ged_id = PGV_GED_ID; // This record is from a file if (!$this->note->canDisplayDetails()) { print_header($pgv_lang["private"] . " " . $pgv_lang["shared_note_info"]); print_privacy_error($CONTACT_EMAIL); print_footer(); exit; } $this->uname = PGV_USER_NAME; //-- perform the desired action switch ($this->action) { case "addfav": $this->addFavorite(); break; case "accept": $this->acceptChanges(); break; case "undo": $this->note->undoChange(); break; } //-- check for the user //-- if the user can edit and there are changes then get the new changes if ($this->show_changes && PGV_USER_CAN_EDIT && isset($pgv_changes[$this->nid . "_" . $GEDCOM])) { $newrec = find_updated_record($this->nid); $this->diffnote = new Note($newrec); $this->diffnote->setChanged(true); $noterec = $newrec; } if ($this->note->canDisplayDetails()) { $this->canedit = PGV_USER_CAN_EDIT; } if ($this->show_changes && $this->canedit) { $this->note->diffMerge($this->diffnote); } }
/** * Prints the entry form/page for this enrolment * * This is only called from course/enrol.php * Most plugins will probably override this to print payment * forms etc, or even just a notice to say that manual enrolment * is disabled * * @param course current course object */ function print_entry($course) { global $CFG, $USER, $SESSION, $THEME; $strloginto = get_string('loginto', '', $course->shortname); $strcourses = get_string('courses'); $context = context_system::get_context(); $navlinks = array(); $navlinks[] = array('name' => $strcourses, 'link' => ".", 'type' => 'misc'); $navlinks[] = array('name' => $strloginto, 'link' => null, 'type' => 'misc'); $navigation = build_navigation($navlinks); // if we get here we are going to display the BUY COURSE message print_header($strloginto, $course->fullname, $navigation, "form.password"); include "{$CFG->dirroot}/enrol/joomdle/enrol.html"; print_footer(); }
function print_page($title, $text, $header = '') { global $p_user; /*if ($p_user['bp_user_id']) { $bpApi = new TheGame(); preg_match('`/([^/]*)$`Uis', $_SERVER['PHP_SELF'], $res); $pageTag = $bpApi->getPageTags($p_user['bp_user_id'], $p_user['login_id'], $res[1]); var_dump($pageTag); }*/ print_header($title, $header); print_leftbar(); print_topbar(); echo $text; print_footer(); }
function webquestscorm_print_header($name, $currenttab = '', $course = NULL, $cm = NULL, $cmid = 0) { global $CFG; if ($cmid) { if (!isset($cm)) { if (!($cm = get_coursemodule_from_id('webquestscorm', $cmid))) { error('Course Module ID was incorrect'); } } if (!isset($course)) { if (!($course = get_record('course', 'id', $this->cm->course))) { error('Course is misconfigured'); } } if (!isset($name)) { if (!($webquestscorm = get_record('webquestscorm', 'id', $this->cm->instance))) { error('webquestscorm ID was incorrect'); } $name = $webquestscorm->name; } } else { if (!isset($cm)) { error('Course Module ID was incorrect'); } if (!isset($course)) { error('Course is misconfigured'); } if (!isset($name)) { error('webquestscorm name was incorrect'); } } $strwebquestscorms = get_string('modulenameplural', 'webquestscorm'); $strwebquestscorm = get_string('modulename', 'webquestscorm'); $strname = format_string($name); $button = update_module_button($cm->id, $course->id, $strwebquestscorm); $meta = ''; if ($CFG->version < 2007101500) { print_header_simple(format_string($strname), "", "<a href=\"index.php?id={$course->id}\">{$strwebquestscorms}</a> -> " . format_string($name), "", "", true, update_module_button($cm->id, $course->id, $strwebquestscorm), navmenu($course, $cm)); } else { $navigation = build_navigation('', $cm); print_header($course->shortname . ':' . $strname, $course->fullname, $navigation, '', $meta, true, $button, navmenu($course, $cm)); } print_heading(format_string($name, true)); require_once "tabs.php"; }
/** * Sign up a new user ready for confirmation. * Password is passed in plaintext. * * @param object $user new user object (with system magic quotes) * @param boolean $notify print notice with link and terminate */ function user_signup($user, $notify = true) { $user->password = hash_internal_user_password($user->password); if (!($user->id = insert_record('user', $user))) { print_error('auth_emailnoinsert', 'auth'); } if (!send_confirmation_email($user)) { print_error('auth_emailnoemail', 'auth'); } if ($notify) { global $CFG; $emailconfirm = get_string('emailconfirm'); print_header($emailconfirm, $emailconfirm, $emailconfirm); notice(get_string('emailconfirmsent', '', $user->email), "{$CFG->wwwroot}/index.php"); } else { return true; } }
function print_header_and_tabs($cm, $course, $game, $reportmode = "overview", $meta = "") { global $CFG; /// Define some strings $strgames = get_string("modulenameplural", "game"); $strgame = get_string("modulename", "game"); /// Print the page header if (function_exists('build_navigation')) { $navigation = build_navigation('', $cm); print_header($course->shortname, $course->shortname, $navigation); } else { print_header_simple(format_string($game->name), "", "<a href=\"index.php?id={$course->id}\">{$strgames}</a>\n -> " . format_string($game->name), '', $meta, true, update_module_button($cm->id, $course->id, $strgame), navmenu($course, $cm)); } /// Print the tabs $currenttab = 'reports'; $mode = $reportmode; include 'tabs.php'; }
function csverror($message, $link = '') { global $CFG, $SESSION; print_header(get_string('error')); echo '<br />'; $message = clean_text($message); print_simple_box('<span style="font-family:monospace;color:#000000;">' . $message . '</span>', 'center', '', '#FFBBBB', 5, 'errorbox'); if (!$link) { if (!empty($SESSION->fromurl)) { $link = $SESSION->fromurl; unset($SESSION->fromurl); } else { $link = $CFG->wwwroot . '/'; } } print_continue($link); print_footer(); die; }
function print_header($pageTitle = '', $pageHeading = '', $pageNavigation = '', $pageFocus = '', $pageMeta = '') { global $CFG, $USER; $this->init_full(); $extraheader = ''; if (!empty($USER) && !empty($USER->id) && $this->user_allowed_editing()) { if ($this->user_is_editing()) { $editingString = get_string('turneditingoff'); } else { $editingString = get_string('turneditingon'); } $params = $this->url->params(); $params['edit'] = $this->user_is_editing() ? 0 : 1; $paramstring = ''; foreach ($params as $key => $val) { $paramstring .= '<input type="hidden" name="' . $key . '" value="' . s($val) . '" />'; } $extraheader = '<form ' . $CFG->frametarget . ' method="get" action="' . $this->url->out(false) . '"><div>' . $paramstring . '<input type="submit" value="' . $editingString . '" /></div></form>'; } print_header($pageTitle, $pageHeading, $pageNavigation, $pageFocus, $pageMeta, true, $extraheader); }