本文整理汇总了PHP中print_header_simple函数的典型用法代码示例。如果您正苦于以下问题:PHP print_header_simple函数的具体用法?PHP print_header_simple怎么用?PHP print_header_simple使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了print_header_simple函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: print_grade_page_head_local
/**
* Prints the page headers, breadcrumb trail, page heading, (optional) dropdown navigation menu and
* (optional) navigation tabs for any gradebook page. All gradebook pages MUST use these functions
* in favour of the usual print_header(), print_header_simple(), print_heading() etc.
* !IMPORTANT! Use of tabs.php file in gradebook pages is forbidden unless tabs are switched off at
* the site level for the gradebook ($CFG->grade_navmethod = GRADE_NAVMETHOD_DROPDOWN).
*
* @param int $courseid
* @param string $active_type The type of the current page (report, settings, import, export, scales, outcomes, letters)
* @param string $active_plugin The plugin of the current page (grader, fullview etc...)
* @param string $heading The heading of the page. Tries to guess if none is given
* @param boolean $return Whether to return (true) or echo (false) the HTML generated by this function
* @param string $bodytags Additional attributes that will be added to the <body> tag
* @param string $buttons Additional buttons to display on the page
*
* @return string HTML code or nothing if $return == false
*/
function print_grade_page_head_local($courseid, $active_type, $active_plugin = null, $heading = false, $return = false, $bodytags = '', $buttons = false, $extracss = array())
{
global $CFG, $COURSE;
$strgrades = get_string('grades');
$plugin_info = grade_get_plugin_info($courseid, $active_type, $active_plugin);
// Determine the string of the active plugin
$stractive_plugin = $active_plugin ? $plugin_info['strings']['active_plugin_str'] : $heading;
$stractive_type = $plugin_info['strings'][$active_type];
$navlinks = array();
$first_link = '';
if ($active_type == 'settings' && $active_plugin != 'coursesettings') {
$first_link = $plugin_info['report'][$active_plugin]['link'];
} elseif ($active_type != 'report') {
$first_link = $CFG->wwwroot . '/grade/index.php?id=' . $COURSE->id;
}
if ($active_type == 'preferences') {
$CFG->stylesheets[] = $CFG->wwwroot . '/grade/report/styles.css';
}
foreach ($extracss as $css_url) {
$CFG->stylesheets[] = $css_url;
}
$navlinks[] = array('name' => $strgrades, 'link' => $first_link, 'type' => 'misc');
$active_type_link = '';
if (!empty($plugin_info[$active_type]['link']) && $plugin_info[$active_type]['link'] != qualified_me()) {
$active_type_link = $plugin_info[$active_type]['link'];
}
if (!empty($plugin_info[$active_type]['parent']['link'])) {
$active_type_link = $plugin_info[$active_type]['parent']['link'];
$navlinks[] = array('name' => $stractive_type, 'link' => $active_type_link, 'type' => 'misc');
}
if (empty($plugin_info[$active_type]['id'])) {
$navlinks[] = array('name' => $stractive_type, 'link' => $active_type_link, 'type' => 'misc');
}
$navlinks[] = array('name' => $stractive_plugin, 'link' => null, 'type' => 'misc');
$navigation = build_navigation($navlinks);
$title = ': ' . $stractive_plugin;
if (empty($plugin_info[$active_type]['id']) || !empty($plugin_info[$active_type]['parent'])) {
$title = ': ' . $stractive_type . ': ' . $stractive_plugin;
}
$returnval = print_header_simple($strgrades . ': ' . $stractive_type, $title, $navigation, '', $bodytags, true, $buttons, navmenu($COURSE), false, '', $return);
// Guess heading if not given explicitly
if (!$heading) {
$heading = $stractive_plugin;
}
if ($CFG->grade_navmethod == GRADE_NAVMETHOD_COMBO || $CFG->grade_navmethod == GRADE_NAVMETHOD_DROPDOWN) {
$returnval .= print_grade_plugin_selector($plugin_info, $return);
}
$returnval .= print_heading($heading);
if ($CFG->grade_navmethod == GRADE_NAVMETHOD_COMBO || $CFG->grade_navmethod == GRADE_NAVMETHOD_TABS) {
$returnval .= grade_print_tabs($active_type, $active_plugin, $plugin_info, $return);
}
if ($return) {
return $returnval;
}
}
示例2: print_header_and_tabs
function print_header_and_tabs($cm, $course, $quiz, $reportmode = "overview", $meta = "")
{
global $CFG;
/// Define some strings
$strquizzes = get_string("modulenameplural", "quiz");
$strquiz = get_string("modulename", "quiz");
/// Print the page header
print_header_simple(format_string($quiz->name), "", "<a href=\"index.php?id={$course->id}\">{$strquizzes}</a>\n -> " . format_string($quiz->name), '', $meta, true, update_module_button($cm->id, $course->id, $strquiz), navmenu($course, $cm));
/// Print the tabs
$currenttab = 'reports';
$mode = $reportmode;
require $CFG->dirroot . '/mod/quiz/tabs.php';
}
示例3: print_header
function print_header()
{
global $USER, $CFG;
$tagname = tag_display_name($this->tag_object);
$navlinks = array();
$navlinks[] = array('name' => get_string('tags', 'tag'), 'link' => "{$CFG->wwwroot}/tag/search.php", 'type' => '');
$navlinks[] = array('name' => $tagname, 'link' => '', 'type' => '');
$navigation = build_navigation($navlinks);
$title = get_string('tag', 'tag') . ' - ' . $tagname;
$button = '';
if ($this->user_allowed_editing()) {
$button = update_tag_button($this->id);
}
print_header_simple($title, '', $navigation, '', '', '', $button);
}
示例4: printHeader
public static function printHeader($title = '', $course_id = SITEID, $cache = false)
{
$navlinks = array();
if ($course_id != SITEID) {
$navlinks[] = array('name' => get_field('course', 'shortname', 'id', $course_id), 'link' => $GLOBALS['CFG']->wwwroot . '/course/view.php?id=' . $course_id, 'type' => 'title');
}
$navlinks[] = array('name' => $title, 'link' => '', 'type' => 'title');
print_header_simple($title, '', build_navigation($navlinks), '', '', $cache);
echo '<div style="float:right;">';
/* helpbutton('repository', sharing_cart_plugins::get_string('title', 'repository'),
'block_sharing_cart/plugins/repository', true, false, '', false);*/
echo '</div>';
echo '<div style="clear:both;"><!-- clear float --></div>';
print_heading($title);
}
示例5: print_header_and_tabs
function print_header_and_tabs($cm, $course, $quiz, $reportmode = "overview", $meta = "")
{
global $CFG;
/// Define some strings
$strquizzes = get_string("modulenameplural", "quiz");
$strquiz = get_string("modulename", "quiz");
/// Print the page header
$navlinks = array();
$navlinks[] = array('name' => $strquizzes, 'link' => "index.php?id={$course->id}", 'type' => 'activity');
$navlinks[] = array('name' => format_string($quiz->name), 'link' => '', 'type' => 'activityinstance');
$navigation = build_navigation($navlinks);
print_header_simple(format_string($quiz->name), "", $navigation, '', $meta, true, update_module_button($cm->id, $course->id, $strquiz), navmenu($course, $cm));
/// Print the tabs
$currenttab = 'reports';
$mode = $reportmode;
require $CFG->dirroot . '/mod/quiz/tabs.php';
}
示例6: webquestscorm_print_header
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";
}
示例7: print_header_and_tabs
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';
}
示例8: print_header_and_tabs
function print_header_and_tabs($cm, $course, $quiz, $reportmode = "overview")
{
global $CFG;
/// Define some strings
$strquizzes = get_string("modulenameplural", "quiz");
$strquiz = get_string("modulename", "quiz");
/// Print the page header
$navigation = build_navigation('', $cm);
print_header_simple(format_string($quiz->name), "", $navigation, '', '', true, update_module_button($cm->id, $course->id, $strquiz), navmenu($course, $cm));
/// Print the tabs
$currenttab = 'reports';
$mode = $reportmode;
require $CFG->dirroot . '/mod/quiz/tabs.php';
$course_context = get_context_instance(CONTEXT_COURSE, $course->id);
if (has_capability('gradereport/grader:view', $course_context) && has_capability('moodle/grade:viewall', $course_context)) {
echo '<div class="allcoursegrades"><a href="' . $CFG->wwwroot . '/grade/report/grader/index.php?id=' . $course->id . '">' . get_string('seeallcoursegrades', 'grades') . '</a></div>';
}
}
示例9: print_header
function print_header($title, $morebreadcrumbs = NULL)
{
global $USER, $CFG, $WS;
$this->init_full();
if ($this->user_allowed_editing()) {
$buttons = wiki_table_start('', true);
$buttons .= update_module_button($this->modulerecord->id, $this->courserecord->id, get_string('modulename', 'wiki'));
if (!empty($CFG->showblocksonmodpages)) {
$buttons .= wiki_change_column('', true);
$prop = null;
$prop->method = "get";
$prop->action = "view.php";
$prop->events = 'onsubmit="this.target=\'_top\'; return true"';
$buttons .= wiki_form_start($prop, true);
$buttons .= wiki_div_start('', true);
$prop = null;
$prop->name = "id";
$prop->value = $this->modulerecord->id;
$buttons .= wiki_input_hidden($prop, true);
$prop = null;
$prop->name = "edit";
$prop->value = $this->user_is_editing() ? 'off' : 'on';
$buttons .= wiki_input_hidden($prop, true);
$prop = null;
$prop->value = get_string($this->user_is_editing() ? 'blockseditoff' : 'blocksediton');
$buttons .= wiki_input_submit($prop, true);
$buttons .= wiki_div_end(true);
$buttons .= wiki_form_end(true);
}
$buttons .= wiki_table_end('', true);
} else {
$buttons = ' ';
}
// print_header($title, $this->courserecord->fullname, $crumbtext, '', '', true, $buttons, navmenu($this->courserecord, $this->modulerecord));
/// Print header.
$navlinks = array();
$navlinks[] = array('name' => get_string('modulenameplural', 'wiki'), 'link' => $CFG->wwwroot . '/mod/wiki/index.php?id=' . $this->courserecord->id, 'type' => 'activity');
$navlinks[] = array('name' => format_string($this->activityrecord->name), 'link' => "view.php", 'type' => 'activityinstance');
$navigation = build_navigation($navlinks);
print_header_simple(format_string($this->activityrecord->name), "", $navigation, "", "", true, $buttons, navmenu($this->courserecord, $WS->cm));
}
示例10: key_form
}
/// First create the form
$editform = new key_form();
$editform->set_data($key);
if ($editform->is_cancelled()) {
redirect($returnurl);
} elseif ($data = $editform->get_data()) {
if ($data->id) {
$record = new object();
$record->id = $data->id;
$record->iprestriction = $data->iprestriction;
$record->validuntil = $data->validuntil;
update_record('user_private_key', $record);
} else {
create_user_key('grade/export', $USER->id, $course->id, $data->iprestriction, $data->validuntil);
}
redirect($returnurl);
}
$strkeys = get_string('userkeys', 'userkey');
$strgrades = get_string('grades');
if ($id) {
$strheading = get_string('edituserkey', 'userkey');
} else {
$strheading = get_string('createuserkey', 'userkey');
}
$navlinks = array(array('name' => $strgrades, 'link' => $CFG->wwwroot . '/grade/index.php?id=' . $courseid, 'type' => 'misc'), array('name' => $strkeys, 'link' => $CFG->wwwroot . '/grade/export/keymanager.php?id=' . $courseid, 'type' => 'misc'), array('name' => $strheading, 'link' => '', 'type' => 'misc'));
$navigation = build_navigation($navlinks);
/// Print header
print_header_simple($strkeys, ': ' . $strkeys, $navigation, '', '', true, '', navmenu($course));
$editform->display();
print_footer($course);
示例11: array
/// processing posted grades & feedback here
if ($data = data_submitted() and confirm_sesskey() and has_capability('moodle/grade:edit', $context)) {
$warnings = $report->process_data($data);
} else {
$warnings = array();
}
// Override perpage if set in URL
if ($perpageurl) {
$report->user_prefs['studentsperpage'] = $perpageurl;
}
// final grades MUST be loaded after the processing
$report->load_users();
$numusers = $report->get_numusers();
$report->load_final_grades();
/// Print header
print_header_simple($strgrades . ': ' . $reportname, ': ' . $strgrades, $navigation, '', '', true, $buttons, navmenu($course));
/// Print the plugin selector at the top
print_grade_plugin_selector($courseid, 'report', 'grader');
// Add tabs
$currenttab = 'graderreport';
require 'tabs.php';
echo $report->group_selector;
echo '<div class="clearer"></div>';
echo $report->get_toggles_html();
//show warnings if any
foreach ($warnings as $warning) {
notify($warning);
}
$studentsperpage = $report->get_pref('studentsperpage');
// Don't use paging if studentsperpage is empty or 0 at course AND site levels
if (!empty($studentsperpage)) {
示例12: error
} else {
error("courseid is not correct");
}
}
if (!$capabilities->complete) {
error(get_string('error'));
}
/// Print the page header
$strfeedbacks = get_string("modulenameplural", "feedback");
$strfeedback = get_string("modulename", "feedback");
$buttontext = update_module_button($cm->id, $course->id, $strfeedback);
$navlinks = array();
$navlinks[] = array('name' => $strfeedbacks, 'link' => "index.php?id={$course->id}", 'type' => 'activity');
$navlinks[] = array('name' => format_string($feedback->name), 'link' => "", 'type' => 'activityinstance');
$navigation = build_navigation($navlinks);
print_header_simple(format_string($feedback->name), "", $navigation, "", "", true, $buttontext, navmenu($course, $cm));
//ishidden check.
//feedback in courses
if (empty($cm->visible) and !$capabilities->viewhiddenactivities and $course->id != SITEID) {
notice(get_string("activityiscurrentlyhidden"));
}
//ishidden check.
//feedback on mainsite
if (empty($cm->visible) and !$capabilities->viewhiddenactivities and $courseid == SITEID) {
notice(get_string("activityiscurrentlyhidden"));
}
feedback_print_errors();
//check, if the feedback is open (timeopen, timeclose)
$checktime = time();
if ($feedback->timeopen > $checktime or $feedback->timeclose < $checktime and $feedback->timeclose > 0) {
// print_simple_box_start('center');
示例13: error
if (!($course = get_record('course', 'id', $certrequest->courseid))) {
error('Invalid Course');
}
if ($certrequest->status != 'submitted') {
error('Invalid Certification');
}
require_login($course->id);
$strtitle = get_string('approvecertification', 'block_tao_certification_path');
//check this user is an MT for this user.
$ptcontext = get_context_instance(CONTEXT_USER, $certrequest->userid);
require_capability('moodle/local:ismt', $ptcontext);
$navlinks = array();
$navlinks[] = array('name' => get_string('certification', 'block_tao_certification_path'), 'link' => "{$CFG->wwwroot}/local/lp/certification.php", 'type' => 'misc');
$navlinks[] = array('name' => $strtitle, 'link' => "", 'type' => 'misc');
$navigation = build_navigation($navlinks);
print_header_simple($strtitle, $strtitle, $navigation);
if ($action == 'approved') {
$certrequest->status = 'approved';
$certrequest->changeuserid = $USER->id;
$certrequest->timechanged = time();
$certrequest->description = $description;
if (!update_record('tao_user_certification_status', $certrequest)) {
notify("Error updating certification status");
print_footer(NULL, $course);
die;
}
//now save event
$eventdata = new object();
$eventdata->userid = $certrequest->userid;
$eventdata->course = $course->id;
$eventdata->certification = $certrequest->certtype;
示例14: require_login
}
}
}
}
require_login($course->id);
// needed to setup proper $COURSE
$context = get_context_instance(CONTEXT_COURSE, $course->id);
require_capability('moodle/course:manageactivities', $context);
$streditinga = get_string("editinga", "moodle", $fullmodulename);
$strmodulenameplural = get_string("modulenameplural", $module->name);
if ($module->name == "label") {
$focuscursor = "form.content";
} else {
$focuscursor = "form.name";
}
print_header_simple($streditinga, '', "<a href=\"{$CFG->wwwroot}/mod/{$module->name}/index.php?id={$course->id}\">{$strmodulenameplural}</a> ->\n {$strnav} {$streditinga}", $focuscursor, "", false);
if (!empty($cm->id)) {
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
$currenttab = 'update';
include_once $CFG->dirroot . '/' . $CFG->admin . '/roles/tabs.php';
}
unset($SESSION->modform);
// Clear any old ones that may be hanging around.
$modform = "../mod/{$module->name}/mod.html";
if (file_exists($modform)) {
if ($usehtmleditor = can_use_html_editor()) {
$defaultformat = FORMAT_HTML;
$editorfields = '';
} else {
$defaultformat = FORMAT_MOODLE;
}
示例15: get_context_instance
if ($user->id == $USER->id) {
$context = get_context_instance(CONTEXT_SYSTEM);
} else {
$context = get_context_instance(CONTEXT_USER, $user->id);
}
$link_values = '?concernspost=' . $concernspost;
$title = "{$strconcerns}: " . fullname($user);
$footer = '';
}
$navlinks[] = array('name' => $strilps, 'link' => "{$CFG->wwwroot}/blocks/ilp/list.php?courseid={$courseid}", 'type' => 'misc');
$navlinks[] = array('name' => $strilp, 'link' => "{$CFG->wwwroot}/blocks/ilp/view.php?id={$user->id}&courseid={$courseid}", 'type' => 'misc');
$navlinks[] = array('name' => fullname($user), 'link' => FALSE, 'type' => 'misc');
$navlinks[] = array('name' => $strconcerns, 'link' => FALSE, 'type' => 'misc');
$navlinks[] = array('name' => $strcomments, 'link' => FALSE, 'type' => 'misc');
$navigation = build_navigation($navlinks);
print_header_simple($title, '', $navigation, '', '', true, '', '');
//Allow users to see their own profile, but prevent others
if (has_capability('moodle/legacy:guest', $context, NULL, false)) {
error("You are logged in as Guest.");
}
if ($USER->id != $user->id) {
require_capability('mod/ilpconcern:view', $context);
}
$mform = new ilpconcern_updatecomment_form('', array('userid' => $user->id, 'id' => $id, 'courseid' => $courseid, 'concernspost' => $concernspost, 'commentid' => $commentid));
echo '<div class="ilp_post yui-t4">';
echo '<div class="bd" role="main">';
echo '<div class="yui-main">';
echo '<div class="yui-b">';
if (isset($post->name)) {
echo '<div class="yui-gd">';
echo '<div class="yui-u first">';