本文整理汇总了PHP中print_container_start函数的典型用法代码示例。如果您正苦于以下问题:PHP print_container_start函数的具体用法?PHP print_container_start怎么用?PHP print_container_start使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了print_container_start函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: printconfirmdelete
/**
* Prints the comment deletion confirmation form
*
* @param page $page The page whose version will be restored
* @param int $versionid The version to be restored
* @param bool $confirm If false, shows a yes/no confirmation page.
* If true, restores the old version and redirects the user to the 'view' tab.
*/
private function printconfirmdelete() {
global $OUTPUT;
$strdeletecheck = get_string('deletecommentcheck', 'wiki');
$strdeletecheckfull = get_string('deletecommentcheckfull', 'wiki');
//ask confirmation
$optionsyes = array('confirm'=>1, 'pageid'=>$this->page->id, 'action'=>'delete', 'commentid'=>$this->commentid, 'sesskey'=>sesskey());
$deleteurl = new moodle_url('/mod/wiki/instancecomments.php', $optionsyes);
$return = new moodle_url('/mod/wiki/comments.php', array('pageid'=>$this->page->id));
echo $OUTPUT->heading($strdeletecheckfull);
print_container_start(false, 'wiki_deletecommentform');
echo '<form class="wiki_deletecomment_yes" action="' . $deleteurl . '" method="post" id="deletecomment">';
echo '<div><input type="submit" name="confirmdeletecomment" value="' . get_string('yes') . '" /></div>';
echo '</form>';
echo '<form class="wiki_deletecomment_no" action="' . $return . '" method="post">';
echo '<div><input type="submit" name="norestore" value="' . get_string('no') . '" /></div>';
echo '</form>';
print_container_end();
}
示例2: print_course_search
print_course_search('', false, 'short');
break;
case FRONTPAGETOPICONLY:
// Do nothing!! :-)
break;
}
echo '<br />';
}
print_container_end();
echo '</td>';
break;
case 'right':
// The right column
if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $editing || $PAGE->user_allowed_editing()) {
echo '<td style="width: ' . $preferred_width_right . 'px;" id="right-column">';
print_container_start();
if ($PAGE->user_allowed_editing()) {
echo '<div style="text-align:center">' . update_course_icon($SITE->id) . '</div>';
echo '<br />';
}
blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT);
print_container_end();
echo '</td>';
}
break;
}
}
?>
</tr>
</table>
示例3: display_course_blocks_end
/**
* Finish displaying the resource with the course blocks
*/
function display_course_blocks_end()
{
global $CFG;
global $THEME;
$PAGE = $this->PAGE;
$pageblocks = blocks_setup($PAGE);
$blocks_preferred_width = bounded_number(180, blocks_preferred_width($pageblocks[BLOCK_POS_RIGHT]), 210);
$lt = empty($THEME->layouttable) ? array('left', 'middle', 'right') : $THEME->layouttable;
foreach ($lt as $column) {
if ($column != 'middle') {
array_shift($lt);
} else {
if ($column == 'middle') {
break;
}
}
}
foreach ($lt as $column) {
switch ($column) {
case 'left':
if (blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $PAGE->user_is_editing()) {
echo '<td style="width: ' . $blocks_preferred_width . 'px;" id="left-column">';
print_container_start();
blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
print_container_end();
echo '</td>';
}
break;
case 'middle':
echo '</div>';
print_container_end();
echo '</td>';
break;
case 'right':
if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $PAGE->user_is_editing()) {
echo '<td style="width: ' . $blocks_preferred_width . 'px;" id="right-column">';
print_container_start();
blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT);
print_container_end();
echo '</td>';
}
break;
}
}
echo '</tr></table>';
print_footer($this->course);
}
示例4: print_container
/**
* Print a message in a standard themed container.
*
* @param string $message, the content of the container
* @param boolean $clearfix clear both sides
* @param string $classes, space-separated class names.
* @param string $idbase
* @param boolean $return, return as string or just print it
* @return string or void
*/
function print_container($message, $clearfix = false, $classes = '', $idbase = '', $return = false)
{
$output = print_container_start($clearfix, $classes, $idbase, true);
$output .= $message;
$output .= print_container_end(true);
if ($return) {
return $output;
} else {
echo $output;
}
}
示例5: print_restoreversion
/**
* Prints the restore version content
*
* @uses $CFG
*
* @param page $page The page whose version will be restored
* @param int $versionid The version to be restored
* @param bool $confirm If false, shows a yes/no confirmation page.
* If true, restores the old version and redirects the user to the 'view' tab.
*/
private function print_restoreversion()
{
global $CFG, $OUTPUT;
$version = wiki_get_version($this->version->id);
echo $OUTPUT->heading(get_string('restoreconfirm', 'wiki', $version->version), 2);
print_container_start(false, 'wiki_restoreform');
echo '<form class="wiki_restore_yes" action="' . $CFG->wwwroot . '/mod/wiki/restoreversion.php?pageid=' . $this->page->id . '&versionid=' . $version->id . '" method="post" id="restoreversion">';
echo '<div><input type="submit" name="confirm" value="' . get_string('yes') . '" /></div>';
echo '</form>';
echo '<form class="wiki_restore_no" action="' . $CFG->wwwroot . '/mod/wiki/viewversion.php?pageid=' . $this->page->id . '&versionid=' . $version->id . '" method="post">';
echo '<div><input type="submit" name="norestore" value="' . get_string('no') . '" /></div>';
echo '</form>';
print_container_end();
}
示例6: print_header_simple
$view->editlink = $editlink;
$view->submissiontext = $submissiontext;
$view->submissiondate = $submissiondate;
$view->cm = $assignment->coursemodule;
$views[] = $view;
}
//===================
// DISPLAY
//===================
print_header_simple($str->assignments, "", $navigation, "", "", true, "", navmenu($course));
foreach ($views as $view) {
print_container_start(true, 'generalbox');
// info bit
print_container_start(true, 'generalbox highlight');
echo "<strong>{$view->section} - {$view->name}</strong>\n";
echo "{$view->submitted}";
print_container_end();
// description part
echo "<p>{$view->description}</p>\n";
//submission part
print_container_start(false, 'generalbox');
echo "<p><strong>{$view->submissiondate}</strong></p>\n";
echo "<p>{$view->submissiontext}</p>\n";
echo "<p>{$view->editlink}</p>\n";
print_container_end();
// feedback part
$onlineinstance = new assignment_online($view->cm);
$onlineinstance->view_feedback();
print_container_end();
}
print_footer($course);
示例7: print_header
}
/// print header
/// @param string $title Appears at the top of the window
/// @param string $heading Appears at the top of the page
print_header($CFG->sitename, $CFG->sitename);
/// print page content header
print_container_start(true, 'content-header', 'content-header');
corner_left_top();
corner_left_bottom();
corner_right_top();
corner_right_bottom();
echo "{$messagetext}";
echo '<div class="contenttoright">' . get_string('loginas', '', $USER->firstname) . ' (<a href="logout.php" title="' . get_string('logout') . '">' . get_string('logout') . '</a>)</div>';
print_container_end();
/// print content
print_container_start(true, 'content-body', 'content-body');
corner_left_top();
corner_left_bottom();
corner_right_top();
corner_right_bottom();
echo "<br><form method=\"post\">";
/// sitename
echo "<label for=\"sitename\">" . get_string("sitename") . ":</label><div class='formcontenttoright'><input type=\"text\" name=\"sitename\" size=\"55\" value=\"" . $CFG->sitename . "\" /><br>\r\n " . get_string('sitenameinfo') . "</div><br><br>";
///lang
echo "<label for=\"lang\">" . get_string("lang") . ":</label><div class='formcontenttoright'><select name=\"lang\" /><option value=\"en_utf8\"";
if ($CFG->lang == "en_utf8") {
echo " selected";
}
echo ">" . get_string('en') . "</option><option value=\"ca_utf8\"";
if ($CFG->lang == "ca_utf8") {
echo " selected";
示例8: page_frontpage_settings
/**
* Called from {@link page_print_position()} and it is
* supposed to print the front page settings in the
* center column for the site course and only for
* the default page (EG: the landing page).
*
* @return boolean
**/
function page_frontpage_settings()
{
global $CFG, $SESSION, $SITE, $PAGE, $COURSE;
// Cheap check first - course ID
if ($COURSE->id != SITEID) {
return false;
}
// More expensive check - make sure we are viewing default page
$default = page_get_default_page();
$current = $PAGE->get_formatpage();
if (empty($default->id) or empty($current->id) or $default->id != $current->id) {
return false;
}
$editing = $PAGE->user_is_editing();
/// START COPY/PASTE FROM INDEX.PHP
print_container_start();
/// Print Section
if ($SITE->numsections > 0) {
if (!($section = get_record('course_sections', 'course', $SITE->id, 'section', 1))) {
delete_records('course_sections', 'course', $SITE->id, 'section', 1);
// Just in case
$section->course = $SITE->id;
$section->section = 1;
$section->summary = '';
$section->sequence = '';
$section->visible = 1;
$section->id = insert_record('course_sections', $section);
}
if (!empty($section->sequence) or !empty($section->summary) or $editing) {
print_box_start('generalbox sitetopic');
/// If currently moving a file then show the current clipboard
if (ismoving($SITE->id)) {
$stractivityclipboard = strip_tags(get_string('activityclipboard', '', addslashes($USER->activitycopyname)));
echo '<p><font size="2">';
echo "{$stractivityclipboard} (<a href=\"course/mod.php?cancelcopy=true&sesskey={$USER->sesskey}\">" . get_string('cancel') . '</a>)';
echo '</font></p>';
}
$options = NULL;
$options->noclean = true;
echo format_text($section->summary, FORMAT_HTML, $options);
if ($editing) {
$streditsummary = get_string('editsummary');
echo "<a title=\"{$streditsummary}\" " . " href=\"course/editsection.php?id={$section->id}\"><img src=\"{$CFG->pixpath}/t/edit.gif\" " . " class=\"iconsmall\" alt=\"{$streditsummary}\" /></a><br /><br />";
}
get_all_mods($SITE->id, $mods, $modnames, $modnamesplural, $modnamesused);
print_section($SITE, $section, $mods, $modnamesused, true);
if ($editing) {
print_section_add_menus($SITE, $section->section, $modnames);
}
print_box_end();
}
}
if (isloggedin() and !isguest() and isset($CFG->frontpageloggedin)) {
$frontpagelayout = $CFG->frontpageloggedin;
} else {
$frontpagelayout = $CFG->frontpage;
}
foreach (explode(',', $frontpagelayout) as $v) {
switch ($v) {
/// Display the main part of the front page.
case FRONTPAGENEWS:
if ($SITE->newsitems) {
// Print forums only when needed
require_once $CFG->dirroot . '/mod/forum/lib.php';
if (!($newsforum = forum_get_course_forum($SITE->id, 'news'))) {
error('Could not find or create a main news forum for the site');
}
if (!empty($USER->id)) {
$SESSION->fromdiscussion = $CFG->wwwroot;
if (forum_is_subscribed($USER->id, $newsforum)) {
$subtext = get_string('unsubscribe', 'forum');
} else {
$subtext = get_string('subscribe', 'forum');
}
print_heading_block($newsforum->name);
echo '<div class="subscribelink"><a href="mod/forum/subscribe.php?id=' . $newsforum->id . '">' . $subtext . '</a></div>';
} else {
print_heading_block($newsforum->name);
}
forum_print_latest_discussions($SITE, $newsforum, $SITE->newsitems, 'plain', 'p.modified DESC');
}
break;
case FRONTPAGECOURSELIST:
if (isloggedin() and !has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM)) and !isguest() and empty($CFG->disablemycourses)) {
print_heading_block(get_string('mycourses'));
print_my_moodle();
} else {
if (!has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM)) and !isguest() or count_records('course') <= FRONTPAGECOURSELIMIT) {
// admin should not see list of courses when there are too many of them
print_heading_block(get_string('availablecourses'));
print_courses(0);
}
//.........这里部分代码省略.........
示例9: definition
//.........这里部分代码省略.........
//
}
// if the user is a teacher
if (has_capability('mod/feedbackccna:feedallow', $context)) {
// the display rule stays
$nothing = 0;
// if they didn't allow students to answer a question yet, \
// they may do so now
if ($data->allow != FEED_ALLOWED) {
// again, add the header/box/whatever
$mform->addElement('header', 'editorheader', get_string('headerlabel2_presentation', 'feedbackccna'));
// add a checkbox, asking to allow the answers
$mform->addElement('advcheckbox', 'check' . $data->id . '1', get_string('checkbox', 'feedbackccna'), null, null, array(0, 1));
// what if they allowed them to, but changed mind?
} else {
// let's see how many have answered
$number1 = get_user_answer_count($course_id, FEED_TYPE_PRE, $f_id);
// we may also like to see how many are they in total
$number_total = get_user_total($context);
// header. see above
$mform->addElement('header', 'editorheader', get_string('headerlabel3_presentation', 'feedbackccna'));
// this would display something like \
// "1 out of over 9000 students have answered"
$mform->addElement('static', 'text' . FEED_TYPE_PRE, null, $number1 . get_string('text_mid', 'feedbackccna') . $number_total . get_string('text_last', 'feedbackccna'));
// help the poor teacher!
// show him the names of the infidels!
$mform->addHelpButton('text' . FEED_TYPE_PRE, 'student_number1', 'feedbackccna');
$mform->addElement('html', '<br/>');
// this is serious. end this madness now!
$mform->addElement('advcheckbox', 'uncheck' . $data->id . FEED_TYPE_PRE, get_string('checkbox2', 'feedbackccna'), null, null, array(0, 1));
}
}
// then, maybe it is a laboratory that we're talking about?
} elseif ($data->type == FEED_TYPE_LAB) {
// is we're dealing with a student, the same conditions apply
if (has_capability('mod/feedbackccna:rateteacher', $context) and $data->allow == FEED_ALLOWED and !has_capability('mod/feedbackccna:feededit', $context) and (!get_user_absent($course_id, $user_id, $f_id) or !class_graded($course_id, $f_id)) and !get_user_answer_true($course_id, $user_id, FEED_TYPE_LAB, $f_id)) {
// Then, you have my permission to answer!
$nothing = 0;
$mform->addElement('header', 'editorheader', get_string('headerlabel_lab', 'feedbackccna'));
$mform->addElement('html', '<div id="star' . $data->id . FEED_TYPE_LAB . '"></div>');
$mform->addElement('hidden', 'value' . $data->id . FEED_TYPE_LAB, null, array('id' => 'value' . $data->id . FEED_TYPE_LAB, 'type' => 'hidden'));
$mform->addElement('html', '<script type = "text/javascript">
var s2 = new Stars({
maxRating: 5,
imagePath: "images/",
value: ' . $values[FEED_TYPE_LAB] . ',
container:"star' . $data->id . FEED_TYPE_LAB . '",
bindField:"value' . $data->id . FEED_TYPE_LAB . '"
});
</script>');
break;
}
// but, if they're teachers, the same as above goes
if (has_capability('mod/feedbackccna:feedallow', $context)) {
$nothing = 0;
if ($data->allow != FEED_ALLOWED) {
$mform->addElement('header', 'editorheader', get_string('headerlabel2_lab', 'feedbackccna'));
$mform->addElement('advcheckbox', 'check' . $data->id . FEED_TYPE_LAB, get_string('checkbox', 'feedbackccna'), null, null, array(0, 1));
} else {
$number2 = get_user_answer_count($course_id, FEED_TYPE_LAB, $f_id);
$number_total = get_user_total($context);
$mform->addElement('header', 'editorheader', get_string('headerlabel3_lab', 'feedbackccna'));
$mform->addElement('static', 'text' . FEED_TYPE_LAB, null, $number2 . get_string('text_mid', 'feedbackccna') . $number_total . get_string('text_last', 'feedbackccna'));
$mform->addHelpButton('text' . FEED_TYPE_LAB, 'student_number2', 'feedbackccna');
$mform->addElement('html', '<br/>');
$mform->addElement('advcheckbox', 'uncheck' . $data->id . FEED_TYPE_LAB, get_string('checkbox2', 'feedbackccna'), null, null, array(0, 1));
}
}
}
}
//
// let's see about those hacks :)
// if we displayed nothing (shame on us)
if ($nothing) {
// if we had some modules, but we were somehow constrained
if ($something) {
// the user is a student, so tell them their teacher is bad
$mform->addElement('header', 'editorheader', get_string('headerlabel_nothing', 'feedbackccna'));
// and help them get to da choppa
$mform->addElement('html', '<a href = "' . $CFG->wwwroot . '/course/view.php?id=' . $course_id . '" >Back to course </a>');
// if there were none, send some error (you'll hate this one >:) )
} else {
print_error('Feedback category is non-existent! Please check ' . 'that your modules have been correctly inserted into the ' . 'database! Error sent from locallib.php');
// when the above error appears, it means that the "new_array" \
// variable in this file is empty. please check the return \
// output of the function populating that variable
}
// so, we displayed something, after all?
} else {
// admin left aside, show a button to all students
if (has_capability('mod/feedbackccna:rateteacher', $context) or has_capability('mod/feedbackccna:feedallow', $context)) {
// this block prints a submit button, so that we may \
// actually send that answer
print_container_start(false, 'singlebutton');
$this->add_action_buttons(false, get_string('submitlabel', 'feedbackccna'));
print_container_end();
//
}
}
}
示例10: print_project_details
function print_project_details($project, $summary = FALSE, $align = "center")
{
global $CFG, $DB;
$projectlink = $CFG->wwwroot . '/project/view.php?id=' . $project->id;
if ($align == 'center') {
print_container_start(false, 'projectpanel projectpanelfull ' . $align);
} else {
print_container_start(false, 'projectpanel ' . $align);
}
print_heading('<a href="' . $projectlink . '">' . $project->name . '</a>', 'left', 2, 'title');
$start = getdate($project->startdate);
$end = getdate($project->enddate);
$startstr = $start['mday'] . ' ' . $start['month'] . ' ' . $start['year'];
$endstr = $end['mday'] . ' ' . $end['month'] . ' ' . $end['year'];
print_heading($project->subtitle, 'left', 3, 'subtitle');
print_heading($startstr . ' - ' . $endstr, 'left', 3, 'subtitledate');
echo print_container_start(false, 'desccontainer');
echo '<img src="' . $CFG->wwwroot . '/file.php?file=/1/' . $project->logo . '" class="logo" />';
if ($summary) {
$extra = substr($project->description, SHORTDESCLEN);
$pos = strpos($project->description, " ");
if ($pos != false) {
echo '<p class="description">' . substr($project->description, 0, SHORTDESCLEN + $pos) . '... ' . '<a href="' . $projectlink . '" class="more">' . get_string('more', 'project') . '</a>' . '</p>';
} else {
echo '<p class="description">' . $project->description . '</p>';
}
} else {
echo '<p class="description">' . $project->description . '</p>';
}
echo print_container_end();
$manager = $DB->get_record('user', array('id' => $project->manager));
echo print_heading(get_string('projectmanager', 'project'), 'left', '4', 'label');
echo '<p class="info">' . $manager->firstname . ' ' . $manager->lastname . '</p>';
$team = $DB->get_records_sql("\n\t\tSELECT u.*, tm.role\n\t\tFROM {user} u\n\t\tINNER JOIN {project_team_members} tm\n\t\tWHERE tm.userid = u.id\n\t\tAND tm.projectid = {$project->id}\n\t\tORDER BY tm.role");
if ($team != FALSE) {
echo print_heading(get_string('team', 'project'), 'left', '4', 'label');
echo '<ul>';
foreach ($team as $member) {
echo '<li>' . $member->firstname . ' ' . $member->lastname . '<span class="role"> - ' . $member->role . '</span></li>';
}
echo '</ul>';
}
print_container_end();
}
示例11: redirect
/**
* Redirects the user to another page, after printing a notice
*
* @param string $url The url to take the user to
* @param string $message The text message to display to the user about the redirect, if any
* @param string $delay How long before refreshing to the new page at $url?
* @todo '&' needs to be encoded into '&' for XHTML compliance,
* however, this is not true for javascript. Therefore we
* first decode all entities in $url (since we cannot rely on)
* the correct input) and then encode for where it's needed
* echo "<script type='text/javascript'>alert('Redirect $url');</script>";
*/
function redirect($url, $message = '', $delay = -1)
{
global $CFG, $THEME;
if (!empty($CFG->usesid) && !isset($_COOKIE[session_name()])) {
$url = sid_process_url($url);
}
$message = clean_text($message);
$encodedurl = preg_replace("/\\&(?![a-zA-Z0-9#]{1,8};)/", "&", $url);
$encodedurl = preg_replace('/^.*href="([^"]*)".*$/', "\\1", clean_text('<a href="' . $encodedurl . '" />'));
$url = str_replace('&', '&', $encodedurl);
/// At developer debug level. Don't redirect if errors have been printed on screen.
/// Currenly only works in PHP 5.2+; we do not want strict PHP5 errors
$lasterror = error_get_last();
$error = defined('DEBUGGING_PRINTED') or !empty($lasterror) && $lasterror['type'] & DEBUG_DEVELOPER;
$errorprinted = debugging('', DEBUG_ALL) && $CFG->debugdisplay && $error;
if ($errorprinted) {
$message = "<strong>Error output, so disabling automatic redirect.</strong></p><p>" . $message;
}
$performanceinfo = '';
if (defined('MDL_PERF') || (!empty($CFG->perfdebug) and $CFG->perfdebug > 7)) {
if (defined('MDL_PERFTOLOG') && !function_exists('register_shutdown_function')) {
$perf = get_performance_info();
error_log("PERF: " . $perf['txt']);
}
}
/// when no message and header printed yet, try to redirect
if (empty($message) and !defined('HEADER_PRINTED')) {
// Technically, HTTP/1.1 requires Location: header to contain
// the absolute path. (In practice browsers accept relative
// paths - but still, might as well do it properly.)
// This code turns relative into absolute.
if (!preg_match('|^[a-z]+:|', $url)) {
// Get host name http://www.wherever.com
$hostpart = preg_replace('|^(.*?[^:/])/.*$|', '$1', $CFG->wwwroot);
if (preg_match('|^/|', $url)) {
// URLs beginning with / are relative to web server root so we just add them in
$url = $hostpart . $url;
} else {
// URLs not beginning with / are relative to path of current script, so add that on.
$url = $hostpart . preg_replace('|\\?.*$|', '', me()) . '/../' . $url;
}
// Replace all ..s
while (true) {
$newurl = preg_replace('|/(?!\\.\\.)[^/]*/\\.\\./|', '/', $url);
if ($newurl == $url) {
break;
}
$url = $newurl;
}
}
$delay = 0;
//try header redirection first
@header($_SERVER['SERVER_PROTOCOL'] . ' 303 See Other');
//302 might not work for POST requests, 303 is ignored by obsolete clients
@header('Location: ' . $url);
//another way for older browsers and already sent headers (eg trailing whitespace in config.php)
echo '<meta http-equiv="refresh" content="' . $delay . '; url=' . $encodedurl . '" />';
echo '<script type="text/javascript">' . "\n" . '//<![CDATA[' . "\n" . "location.replace('" . addslashes_js($url) . "');" . "\n" . '//]]>' . "\n" . '</script>';
// To cope with Mozilla bug
die;
}
if ($delay == -1) {
$delay = 3;
// if no delay specified wait 3 seconds
}
if (!defined('HEADER_PRINTED')) {
// this type of redirect might not be working in some browsers - such as lynx :-(
// IECISA *********** MODIFIED -> to put out sitename
//print_header('', '', '', '', $errorprinted ? '' : ('<meta http-equiv="refresh" content="'. $delay .'; url='. $encodedurl .'" />'));
print_header($CFG->sitename, $CFG->sitename, '', '', $errorprinted ? '' : '<meta http-equiv="refresh" content="' . $delay . '; url=' . $encodedurl . '" />');
// ********* END
$delay += 3;
// double redirect prevention, it was sometimes breaking upgrades before 1.7
} else {
print_container_end_all(false, $THEME->open_header_containers);
}
//IECISA ********** ADDED -> to have the save html aspect than the other pages
/// print page content
print_container_start(true, 'content-body', 'content-body');
corner_left_top();
corner_left_bottom();
corner_right_top();
corner_right_bottom();
// ********** END
echo '<div id="redirect">';
echo '<div id="message">' . $message . '</div>';
echo '<div id="continue">( <a href="' . $encodedurl . '">' . get_string('continue') . '</a> )</div>';
echo '</div>';
//.........这里部分代码省略.........
示例12: tabobject
if (!preg_match("/summary|manageelements|managenetwork/", $screen)) {
$screen = 'summary';
}
$rows[1][] = new tabobject('summary', "view.php?id={$cm->id}&view=admin&screen=summary", get_string('summary', 'tracker'));
$rows[1][] = new tabobject('manageelements', "view.php?id={$cm->id}&view=admin&screen=manageelements", get_string('manageelements', 'tracker'));
$rows[1][] = new tabobject('managenetwork', "view.php?id={$cm->id}&view=admin&screen=managenetwork", get_string('managenetwork', 'tracker'));
break;
default:
}
if (!empty($screen)) {
$selected = $screen;
$activated = array($view);
} else {
$selected = $view;
}
print_container_start(true, 'mod-header');
print_tabs($rows, $selected, '', $activated);
print_container_end();
//=====================================================================
// Print the main part of the page
//
//=====================================================================
/// routing to appropriate view against situation
// echo "routing : $view:$screen:$action ";
if ($view == 'reportanissue') {
if (has_capability('mod/tracker:report', $context)) {
include "views/issuereportform.html";
} else {
notice(get_string('youneedanaccount', 'tracker'), $CFG->wwwroot . "/course/view.php?id={$course->id}");
}
} elseif ($view == 'view') {