本文整理汇总了PHP中print_heading_with_help函数的典型用法代码示例。如果您正苦于以下问题:PHP print_heading_with_help函数的具体用法?PHP print_heading_with_help怎么用?PHP print_heading_with_help使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了print_heading_with_help函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: admin_externalpage_setup
$showroles = 1;
$currenttab = 'override';
include_once $CFG->dirroot . '/user/tabs.php';
} else {
if ($context->contextlevel == CONTEXT_COURSE and $context->instanceid == SITEID) {
require_once $CFG->libdir . '/adminlib.php';
admin_externalpage_setup('frontpageroles', '', array('contextid' => $contextid, 'roleid' => $roleid), $CFG->wwwroot . '/' . $CFG->admin . '/roles/override.php');
admin_externalpage_print_header();
$currenttab = 'override';
include_once 'tabs.php';
} else {
$currenttab = 'override';
include_once 'tabs.php';
}
}
print_heading_with_help($title, 'overrides');
if ($roleid) {
/// Show UI for overriding roles.
if (!empty($capabilities)) {
print_box(get_string('nocapabilitiesincontext', 'role'), 'generalbox boxaligncenter');
} else {
// Print the capabilities overrideable in this context
print_box_start('generalbox boxwidthwide boxaligncenter');
if ($showadvanced) {
$showadvancedlabel = get_string('hideadvanced', 'form');
} else {
$showadvancedlabel = get_string('showadvanced', 'form');
}
?>
<form id="overrideform" action="<?php
echo $baseurl . '&roleid=' . $roleid;
示例2: display
//.........这里部分代码省略.........
$table->column_class('rpercent', 'numcol');
$table->column_class('facility', 'numcol');
$table->column_class('qsd', 'numcol');
$table->column_class('disc_index', 'numcol');
$table->column_class('disc_coeff', 'numcol');
$table->column_suppress('id');
$table->column_suppress('qname');
$table->column_suppress('facility');
$table->column_suppress('qsd');
$table->column_suppress('disc_index');
$table->column_suppress('disc_coeff');
$table->set_attribute('cellspacing', '0');
$table->set_attribute('id', 'itemanalysis');
$table->set_attribute('class', 'generaltable generalbox');
// Start working -- this is necessary as soon as the niceties are over
$table->setup();
$tablesort = $table->get_sql_sort();
$sorts = explode(",", trim($tablesort));
if ($tablesort and is_array($sorts)) {
$sortindex = array();
$sortorder = array();
foreach ($sorts as $sort) {
$data = explode(" ", trim($sort));
$sortindex[] = trim($data[0]);
$s = trim($data[1]);
if ($s == "ASC") {
$sortorder[] = SORT_ASC;
} else {
$sortorder[] = SORT_DESC;
}
}
if (count($sortindex) > 0) {
$sortindex[] = "id";
$sortorder[] = SORT_ASC;
foreach ($questions as $qid => $row) {
$index1[$qid] = $row[$sortindex[0]];
$index2[$qid] = $row[$sortindex[1]];
}
array_multisort($index1, $sortorder[0], $index2, $sortorder[1], $questions);
}
}
$format_options = new stdClass();
$format_options->para = false;
$format_options->noclean = true;
$format_options->newlines = false;
// Now it is time to page the data, simply slice the keys in the array
if (!isset($pagesize) || (int) $pagesize < 1) {
$pagesize = 10;
}
$table->pagesize($pagesize, count($questions));
$start = $table->get_page_start();
$pagequestions = array_slice(array_keys($questions), $start, $pagesize);
foreach ($pagequestions as $qnum) {
$q = $questions[$qnum];
$qid = $q['id'];
$question = get_record('question', 'id', $qid);
if (has_capability('moodle/question:manage', get_context_instance(CONTEXT_COURSE, $course->id))) {
$qnumber = " (" . link_to_popup_window('/question/question.php?id=' . $qid, '&cmid=' . $cm->id . 'editquestion', $qid, 450, 550, get_string('edit'), 'none', true) . ") ";
} else {
$qnumber = $qid;
}
$qname = '<div class="qname">' . format_text($question->name . " : ", $question->questiontextformat, $format_options, $quiz->course) . '</div>';
$qicon = print_question_icon($question, true);
$qreview = quiz_question_preview_button($quiz, $question);
$qtext = format_text($question->questiontext, $question->questiontextformat, $format_options, $quiz->course);
$qquestion = $qname . "\n" . $qtext . "\n";
$responses = array();
foreach ($q['responses'] as $aid => $resp) {
$response = new stdClass();
if ($q['credits'][$aid] <= 0) {
$qclass = 'uncorrect';
} elseif ($q['credits'][$aid] == 1) {
$qclass = 'correct';
} else {
$qclass = 'partialcorrect';
}
$response->credit = '<span class="' . $qclass . '">(' . format_float($q['credits'][$aid], 2) . ') </span>';
$response->text = '<span class="' . $qclass . '">' . format_text($resp, FORMAT_MOODLE, $format_options, $quiz->course) . ' </span>';
$count = $q['rcounts'][$aid] . '/' . $q['count'];
$response->rcount = $count;
$response->rpercent = '(' . format_float($q['rcounts'][$aid] / $q['count'] * 100, 0) . '%)';
$responses[] = $response;
}
$facility = format_float($q['facility'] * 100, 0) . "%";
$qsd = format_float($q['qsd'], 3);
$di = format_float($q['disc_index'], 2);
$dc = format_float($q['disc_coeff'], 2);
$response = array_shift($responses);
$table->add_data(array($qnumber . "\n<br />" . $qicon . "\n " . $qreview, $qquestion, $response->text, $response->credit, $response->rcount, $response->rpercent, $facility, $qsd, $di, $dc));
foreach ($responses as $response) {
$table->add_data(array('', '', $response->text, $response->credit, $response->rcount, $response->rpercent, '', '', '', ''));
}
}
print_heading_with_help(get_string("analysistitle", "quiz_analysis"), "itemanalysis", "quiz");
echo '<div id="tablecontainer">';
$table->print_html();
echo '</div>';
$this->print_options_form($quiz, $cm, $attemptselection, $lowmarklimit, $pagesize);
return true;
}
示例3: display_question_editing_page
/**
* This method should be overriden if you want to include a special heading or some other
* html on a question editing page besides the question editing form.
*
* @param question_edit_form $mform a child of question_edit_form
* @param object $question
* @param string $wizardnow is '' for first page.
*/
function display_question_editing_page(&$mform, $question, $wizardnow)
{
list($heading, $langmodule) = $this->get_heading(empty($question->id));
print_heading_with_help($heading, $this->name(), $langmodule);
$permissionstrs = array();
if (!empty($question->id)) {
if ($question->formoptions->canedit) {
$permissionstrs[] = get_string('permissionedit', 'question');
}
if ($question->formoptions->canmove) {
$permissionstrs[] = get_string('permissionmove', 'question');
}
if ($question->formoptions->cansaveasnew) {
$permissionstrs[] = get_string('permissionsaveasnew', 'question');
}
}
if (!$question->formoptions->movecontext && count($permissionstrs)) {
print_heading(get_string('permissionto', 'question'), 'center', 3);
$html = '<ul>';
foreach ($permissionstrs as $permissionstr) {
$html .= '<li>' . $permissionstr . '</li>';
}
$html .= '</ul>';
print_box($html, 'boxwidthnarrow boxaligncenter generalbox');
}
$mform->display();
}
示例4: error
if (!($site = get_site())) {
error("Could not find site-level course");
}
if (!($adminuser = get_admin())) {
error("Could not find site admin");
}
$strfile = get_string('file');
$struser = get_string('user');
$strusersupdated = get_string('usersupdated');
$struploadpictures = get_string('uploadpictures', 'admin');
$userfields = array(0 => 'username', 1 => 'idnumber', 2 => 'id');
$userfield = optional_param('userfield', 0, PARAM_INT);
$overwritepicture = optional_param('overwritepicture', 0, PARAM_BOOL);
/// Print the header
admin_externalpage_print_header();
print_heading_with_help($struploadpictures, 'uploadpictures');
$mform = new admin_uploadpicture_form(null, $userfields);
if ($formdata = $mform->get_data()) {
if (!array_key_exists($userfield, $userfields)) {
notify(get_string('uploadpicture_baduserfield', 'admin'));
} else {
// Large files are likely to take their time and memory. Let PHP know
// that we'll take longer, and that the process should be recycled soon
// to free up memory.
@set_time_limit(0);
@raise_memory_limit("192M");
if (function_exists('apache_child_terminate')) {
@apache_child_terminate();
}
// Create a unique temporary directory, to process the zip file
// contents.
示例5: array
$cnt = 0;
$table->data[] = array('<strong>' . $section->fullname . '</section>');
$table->data[] = array(netpublish_print_move_here($cm->id, $articleid, $cnt, $section->id));
if ($articles = netpublish_get_articles($section->id, $netpublish->id)) {
foreach ($articles as $article) {
if ($article->id == $articleid) {
continue;
}
$cnt++;
$table->data[] = array(" " . stripslashes($article->title));
$table->data[] = array(netpublish_print_move_here($cm->id, $articleid, $cnt, $section->id));
}
}
}
// all of the printing
print_heading_with_help(get_string('movingarticle', 'netpublish') . ": {$movingarticle->title}", 'movingarticle', 'netpublish');
print_tabs($tabs, $cm->id);
echo '<p>';
print_table($table);
echo '</p>';
print_footer($course);
//////////////////////////////// HELP FUNCTIONS ////////////////////////////////
function netpublish_array_search($needle, $haystack)
{
$needle = intval($needle);
foreach ($haystack as $key => $value) {
if ($needle === intval($value)) {
return (int) $key;
exit;
}
}
示例6: print_continue
$efile = "{$CFG->wwwroot}/file.php?file=/" . $qformat->question_get_export_dir() . "/{$exportfilename}" . $file_ext . "&forcedownload=1";
}
echo "<p><div class=\"boxaligncenter\"><a href=\"{$efile}\">{$txt->download}</a></div></p>";
echo "<p><div class=\"boxaligncenter\"><font size=\"-1\">{$txt->downloadextra}</font></div></p>";
print_continue("edit.php?courseid={$course->id}");
print_footer($course);
exit;
}
/// Display upload form
// get valid formats to generate dropdown list
$fileformatnames = get_import_export_formats('export');
// get filename
if (empty($exportfilename)) {
$exportfilename = default_export_filename($course, $category);
}
print_heading_with_help($txt->exportquestions, 'export', 'quiz');
print_box_start('generalbox boxwidthnormal boxaligncenter');
?>
<form enctype="multipart/form-data" method="post" action="export.php">
<fieldset class="invisiblefieldset" style="display: block;">
<input type="hidden" name="sesskey" value="<?php
echo sesskey();
?>
" />
<input type="hidden" name="courseid" value="<?php
echo $course->id;
?>
" />
<table cellpadding="5">
示例7: foreach
// echo '<div class="mdl-align"><table width="80%" cellpadding="10"><tr><td>';
echo '<div><table width="80%" cellpadding="10"><tr><td>';
if ($check_anonymously) {
$itemnr = 0;
//print the items in an analysed form
foreach ($items as $item) {
if ($item->hasvalue == 0) {
continue;
}
echo '<table width="100%" class="generalbox">';
//get the class of item-typ
$itemclass = 'feedback_item_' . $item->typ;
//get the instance of the item-class
$itemobj = new $itemclass();
$itemnr++;
if ($feedback->autonumbering) {
$printnr = $itemnr . '.';
} else {
$printnr = '';
}
$itemobj->print_analysed($item, $printnr, $mygroupid);
// $itemnr = $itemobj->print_analysed($item, $itemnr, $mygroupid);
echo '</table>';
}
} else {
print_heading_with_help(get_string('insufficient_responses_for_this_group', 'feedback'), 'insufficient_responses', 'feedback');
}
echo '</td></tr></table></div>';
// print_simple_box_end();
print_box_end();
print_footer($course);
示例8: output_edit_lists
/**
* Outputs a list to allow editing/rearranging of existing categories
*
* $this->initialize() must have already been called
*
*/
function output_edit_lists()
{
print_heading_with_help(get_string('editcategories', 'quiz'), 'categories', 'question');
foreach ($this->editlists as $context => $list) {
$listhtml = $list->to_html(0, array('str' => $this->str));
if ($listhtml) {
print_box_start('boxwidthwide boxaligncenter generalbox questioncategories contextlevel' . $list->context->contextlevel);
print_heading(get_string('questioncatsfor', 'question', print_context_name(get_context_instance_by_id($context))), '', 3);
echo $listhtml;
print_box_end();
}
}
echo $list->display_page_numbers();
}
示例9: get_string
$strwebquests = get_string("modulenameplural", "webquest");
print_header_simple(format_string($webquest->name), "", "<a href=\"index.php?id={$course->id}\">{$strwebquests}</a> ->\n <a href=\"view.php?id={$cm->id}\">" . format_string($webquest->name, true) . "</a> -> {$strtasks}", "", "", true);
add_to_log($course->id, "webquest", "update tasks", "view.php?id={$cm->id}", "{$webquest->id}");
$straction = $action ? '-> ' . get_string($action, 'webquest') : '';
//*********************************************edit tasks**********************/////
if ($action == 'edittasks') {
if (!isteacher($course->id)) {
error("Only teachers can look at this page");
/// is trying to get access but not allowed jejejeje
}
$count = count_records("webquest_grades", "webquestid", $webquest->id);
if ($count) {
notify(get_string("warningtask", "webquest"));
}
///// setup a form to edit tasks
print_heading_with_help(get_string("edittasks", "webquest"), "tasks", "webquest");
?>
<form name="form" method="post" action="tasks.php">
<input type="hidden" name="id" value="<?php
echo $cm->id;
?>
" />
<input type="hidden" name="action" value="inserttasks" />
<center><table cellpadding="5" border="1">
<?php
// get existing tasks, if none set up appropriate default ones
if ($tasksraw = get_records("webquest_tasks", "webquestid", $webquest->id, "taskno ASC")) {
foreach ($tasksraw as $task) {
$tasks[] = $task;
// to renumber index 0,1,2...
}
示例10: get_record
$thismod = get_record($modnames[$i]->name, "id", $mod->instance);
$checkmod = get_record("block_openshare_modules", "moduleid", $mod->id);
$menu .= '<tr class="modinstance">' . "\n\t\t" . '<td class="ffield">';
//make the license select menu
$menu .= make_license_select('license_' . $mod->id, $modid . '~license_' . $mod->id, $mod->id, $checkmod, $licenses);
$menu .= '</td>' . "\n\t\t" . '<td class="ffield">';
//make the radio buttons
$menu .= make_status_inputs('closed', 'status_' . $mod->id, $modid . '~closed_' . $mod->id, '1', '1,\'license_' . $mod->id . '\'', $checkmod);
$menu .= make_status_inputs('open', 'status_' . $mod->id, $modid . '~open_' . $mod->id, '2', '3,\'license_' . $mod->id . '\'', $checkmod);
$menu .= '</td>' . "\n\t\t" . '<td>' . $thismod->name . '</td>' . "\n\t</tr>\n";
}
reset($checkmod);
}
}
//Print form
print_heading_with_help(get_string('openmodsset', 'block_openshare'), 'openshare', 'block_openshare');
print_simple_box_start("center");
print "<h2>" . $course->fullname . " (" . $course->shortname . ")</h2>";
?>
<script type="text/javascript" src="set_open_mods.js"></script>
<style type="text/css">
#openshare { border: 2px solid gray; }
#openshare td, #openshare th { border: 1px solid gray; border-collapse: collapse; text-align: left; padding: 4px 6px; }
#openshare th {text-transform: capitalize; font-weight: normal; }
tr.allmods { border: 2px solid; }
.allmods th { font-size: 130%; text-align: center; vertical-align: top; }
.modtype { border: 2px solid gray; text-transform: capitalize; }
.modtype th { font-size: 120%;}
#openshare tr.modtype th.ffield { padding-left: 1em; background: url("<?php
echo $CFG->wwwroot;
示例11: print_single_button
}
$options['action'] = 'duplicate';
print_single_button('manage.php', $options, get_string('duplicaterole', 'role'));
print_single_button('manage.php', null, get_string('listallroles', 'role'));
echo '</div>';
}
echo '</div>';
$lang = str_replace('_utf8', '', current_language());
print_simple_box_start('center');
include_once 'manage.html';
print_simple_box_end();
if ($usehtmleditor) {
use_html_editor('description');
}
} else {
print_heading_with_help(get_string('roles', 'role'), 'roles');
$table = new object();
$table->tablealign = 'center';
$table->align = array('right', 'left', 'left', 'left');
$table->wrap = array('nowrap', '', 'nowrap', 'nowrap');
$table->cellpadding = 5;
$table->cellspacing = 0;
$table->width = '90%';
$table->data = array();
$table->head = array(get_string('name'), get_string('description'), get_string('shortname'), get_string('edit'));
/*************************
* List all current roles *
**************************/
foreach ($roles as $role) {
$stredit = get_string('edit');
$strdelete = get_string('delete');
示例12: game_bookquiz_create_objects
$objects = game_bookquiz_create_objects($pageobjects, $bookid);
// function to preps the data to be sent to DB
if (!game_bookquiz_save_objects($objects)) {
// sends it to DB
error("could not save");
}
} else {
error('could not get data');
}
print_continue("{$CFG->wwwroot}/mod/game/view.php?id={$cm->id}");
print_footer($course);
exit;
}
}
/// Print upload form
print_heading_with_help(get_string("bookquiz_import_odt", "game"), "importodt", "game");
print_simple_box_start("center");
?>
<form id="theform" enctype="multipart/form-data" method="post">
<input type="hidden" name="id" value="<?php
echo $cm->id;
?>
" />
<table cellpadding="5">
<tr><td align="right"><b>
<?php
print_string("upload");
?>
:</td><td>
<input name="newfile" type="file" size="50" />
示例13: exercise_print_assessment_form
exercise_print_assessment_form($exercise, $assessment, true, $_SERVER["HTTP_REFERER"]);
} elseif ($action == 'displaygradingform') {
print_heading_with_help(get_string("specimenassessmentform", "exercise"), "specimen", "exercise");
exercise_print_assessment_form($exercise);
// called with no assessment
print_continue("view.php?id={$cm->id}");
} elseif ($action == 'editelements') {
if (!has_capability('mod/exercise:assess', $context)) {
error("Only teachers can look at this page");
}
$count = count_records("exercise_grades", "exerciseid", $exercise->id);
if ($exercise->phase > 1 and $count) {
notify(get_string("warningonamendingelements", "exercise"));
}
// set up heading, form and table
print_heading_with_help(get_string("editingassessmentelements", "exercise"), "elements", "exercise");
?>
<form id="form" method="post" action="assessments.php">
<input type="hidden" name="id" value="<?php
echo $cm->id;
?>
" />
<input type="hidden" name="action" value="insertelements" />
<center><table cellpadding="5" border="1">
<?php
// get existing elements, if none set up appropriate default ones
if ($elementsraw = get_records("exercise_elements", "exerciseid", $exercise->id, "elementno ASC")) {
foreach ($elementsraw as $element) {
$elements[] = $element;
// to renumber index 0,1,2...
}
示例14: error
// function to preps the data to be sent to DB
if (!$mod_save_objects($objects, $mod->id, $pageid)) {
// sends it to DB
error("could not save");
}
} else {
error('could not get data');
}
echo "<hr>";
print_continue("{$CFG->wwwroot}/mod/{$modname}/view.php?id={$cm->id}");
print_footer($course);
exit;
}
}
/// Print upload form
print_heading_with_help($strimportppt, "importppt", "lesson");
print_simple_box_start("center");
echo "<form id=\"theform\" enctype=\"multipart/form-data\" method=\"post\">";
echo "<input type=\"hidden\" name=\"id\" value=\"{$cm->id}\" />\n";
echo "<input type=\"hidden\" name=\"pageid\" value=\"{$pageid}\" />\n";
echo "<table cellpadding=\"5\">";
echo "<tr><td align=\"right\">";
print_string("upload");
echo ":</td><td>";
echo "<input name=\"newfile\" type=\"file\" size=\"50\" />";
echo "</td></tr><tr><td> </td><td>";
echo "<input type=\"submit\" name=\"save\" value=\"" . get_string("uploadthisfile") . "\" />";
echo "</td></tr>";
echo "</table>";
echo "</form>";
print_simple_box_end();
示例15: admin_externalpage_setup
admin_externalpage_setup('checkpermissions', '', array('contextid' => $contextid));
admin_externalpage_print_header();
} else {
if ($context->contextlevel == CONTEXT_COURSE and $context->instanceid == SITEID) {
admin_externalpage_setup('frontpageroles', '', array('contextid' => $contextid), $CFG->wwwroot . '/' . $CFG->admin . '/roles/check.php');
admin_externalpage_print_header();
$currenttab = 'check';
include_once 'tabs.php';
} else {
$currenttab = 'check';
include_once 'tabs.php';
}
}
}
/// Print heading.
print_heading_with_help($title, 'checkpermissions');
/// If a user has been chosen, show all the permissions for this user.
$reportuser = $userselector->get_selected_user();
if (!is_null($reportuser)) {
print_box_start('generalbox boxaligncenter boxwidthwide');
print_heading(get_string('permissionsforuser', 'role', fullname($reportuser)), '', 3);
$table = new explain_capability_table($context, $reportuser, $contextname);
$table->display();
print_box_end();
$selectheading = get_string('selectanotheruser', 'role');
} else {
$selectheading = get_string('selectauser', 'role');
}
/// Show UI for choosing a user to report on.
print_box_start('generalbox boxwidthnormal boxaligncenter', 'chooseuser');
echo '<form method="get" action="' . $CFG->wwwroot . '/' . $CFG->admin . '/roles/check.php" >';