本文整理匯總了PHP中print_simple_box_start函數的典型用法代碼示例。如果您正苦於以下問題:PHP print_simple_box_start函數的具體用法?PHP print_simple_box_start怎麽用?PHP print_simple_box_start使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了print_simple_box_start函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: print_entry
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();
}
}
示例2: display_msg
/**
* Display an message with optional details from HTML
*
* @param string $msg The message to display
* @param string $details Any message details to be initially hidden
* @param string $type The 'type' of message: i.e. 'error','general', ???
*/
function display_msg($msg, $details = '', $type = 'error')
{
$width = '';
if (!empty($details)) {
$innertags = array('html', 'body');
foreach ($innertags as $tag) {
if (($tagpos = stripos($details, '<' . $tag)) !== false && ($firstend = strpos(substr($details, $tagpos), '>')) !== false) {
if (($tagend = stripos($details, '</' . $tag . '>')) !== false) {
$details = substr($details, $tagpos + $firstend + 1, $tagend - $tagpos - $firstend - 1);
} else {
$details = substr($details, $tagpos + $firstend + 1);
}
}
}
$details = addcslashes($details, "'");
$details = preg_replace("/\n/", '', $details);
$details = preg_replace("|/alfresco/images/logo/AlfrescoLogo32.png|", '/blocks/repository/AlfrescoLogo32.png', $details);
$width = '99%';
// TBD
}
$output = print_simple_box_start('center', $width, '', 5, $type . 'box', '', true);
$output .= $msg;
if (!empty($details)) {
$output .= '<p align="right"><input type="button" value="' . get_string('details', 'block_repository') . '" onclick="toggle_msgdetails();" /></p>' . '<div id="msgdetails" style="overflow:auto;overflow-y:hidden;-ms-overflow-y:hidden"></div>';
$output .= "\n<script type=\"text/javascript\">\n//<![CDATA[\nfunction toggle_msgdetails() {\n mddiv = document.getElementById('msgdetails');\n if (mddiv) {\n mddiv.innerHTML = (mddiv.innerHTML == '') ? '{$details}' : '';\n }\n}\n//]]>\n</script>\n";
}
$output .= print_simple_box_end(true);
echo $output;
}
示例3: view
/**
* Displays the assignment content - this method overrides
* the parent class, adding a repository availability check
*/
function view()
{
global $USER;
require_capability('mod/assignment:view', $this->context);
//start of RL base-class modification
$repo = $this->get_repository_object();
if (!$repo) {
//configuration is not complete
$message = get_string('errorrepository', 'assignment_backpack');
//wrap the error with further instructions
print_error('errorrepositoryview', 'assignment_backpack', '', $message);
}
//end of RL base-class modification
add_to_log($this->course->id, 'assignment', 'view', "view.php?id={$this->cm->id}", $this->assignment->id, $this->cm->id);
$this->view_header();
if ($this->assignment->timeavailable > time() and !has_capability('mod/assignment:grade', $this->context) and $this->assignment->var3) {
// force hiding before available date
print_simple_box_start('center', '', '', 0, 'generalbox', 'intro');
print_string('notavailableyet', 'assignment');
print_simple_box_end();
} else {
$this->view_intro();
}
$this->view_dates();
$filecount = $this->count_user_files($USER->id);
$submission = $this->get_submission($USER->id);
$this->view_feedback();
if (!$this->drafts_tracked() or !$this->isopen() or $this->is_finalized($submission)) {
print_heading(get_string('submission', 'assignment'), '', 3);
} else {
print_heading(get_string('submissiondraft', 'assignment'), '', 3);
}
if ($filecount and $submission) {
print_simple_box($this->print_user_files($USER->id, true), 'center');
} else {
if (!$this->isopen() or $this->is_finalized($submission)) {
print_simple_box(get_string('nofiles', 'assignment'), 'center');
} else {
print_simple_box(get_string('nofilesyet', 'assignment'), 'center');
}
}
if (has_capability('mod/assignment:submit', $this->context)) {
$this->view_upload_form();
}
if ($this->notes_allowed()) {
print_heading(get_string('notes', 'assignment'), '', 3);
$this->view_notes();
}
$this->view_final_submission();
$this->view_footer();
}
示例4: journal_user_complete_index
function journal_user_complete_index($course, $user, $journal, $journalopen, $heading)
{
/// Prints a journal, entry and feedback ... used on the journal index page.
if (isteacher($course->id)) {
$entrycount = journal_count_entries($journal, get_current_group($course->id));
$entryinfo = " (<a href=\"report.php?id={$journal->coursemodule}\">" . get_string("viewallentries", "journal", $entrycount) . "</a>)";
} else {
$entryinfo = "";
}
$journal->name = "<a href=\"view.php?id={$journal->coursemodule}\">" . format_string($journal->name, true) . "</a>";
if ($heading) {
echo "<h3>{$heading} - {$journal->name}{$entryinfo}</h3>";
} else {
echo "<h3>{$journal->name}{$entryinfo}</h3>";
}
print_simple_box_start("left", "90%");
echo format_text($journal->intro, $journal->introformat);
print_simple_box_end();
echo "<br clear=\"all\" />";
echo "<br />";
if (isstudent($course->id) or isteacher($course->id)) {
print_simple_box_start("right", "90%");
if ($journalopen) {
echo "<p align=\"right\"><a href=\"edit.php?id={$journal->coursemodule}\">";
echo get_string("edit") . "</a></p>";
} else {
echo "<p align=\"right\"><a href=\"view.php?id={$journal->coursemodule}\">";
echo get_string("view") . "</a></p>";
}
if ($entry = get_record("journal_entries", "userid", $user->id, "journal", $journal->id)) {
if ($entry->modified) {
echo "<p align=\"center\"><font size=\"1\">" . get_string("lastedited") . ": " . userdate($entry->modified) . "</font></p>";
}
if ($entry->text) {
echo format_text($entry->text, $entry->format);
}
if ($entry->teacher) {
$grades = make_grades_menu($journal->assessed);
journal_print_feedback($course, $entry, $grades);
}
} else {
print_string("noentry", "journal");
}
print_simple_box_end();
echo "<br clear=\"all\" />";
echo "<br />";
}
}
示例5: instance_config_print
function instance_config_print()
{
global $CFG;
/// set up the numberoftags select field
$numberoftags = array();
for ($i = 1; $i <= 200; $i++) {
$numberoftags[$i] = $i;
}
if (is_file($CFG->dirroot . '/blocks/' . $this->name() . '/config_instance.html')) {
print_simple_box_start('center', '', '', 5, 'blockconfigglobal');
include $CFG->dirroot . '/blocks/' . $this->name() . '/config_instance.html';
print_simple_box_end();
} else {
notice(get_string('blockconfigbad'), str_replace('blockaction=', 'dummy=', qualified_me()));
}
}
示例6: view
function view()
{
global $USER;
require_capability('mod/assignment:view', $this->context);
add_to_log($this->course->id, 'assignment', 'view', "view.php?id={$this->cm->id}", $this->assignment->id, $this->cm->id);
$this->view_header();
if ($this->assignment->timeavailable > time() and !has_capability('mod/assignment:grade', $this->context) and $this->assignment->var3) {
// force hiding before available date
print_simple_box_start('center', '', '', 0, 'generalbox', 'intro');
print_string('notavailableyet', 'assignment');
print_simple_box_end();
} else {
$this->view_intro();
}
$this->view_dates();
if (has_capability('mod/assignment:submit', $this->context)) {
$filecount = $this->count_user_files($USER->id);
$submission = $this->get_submission($USER->id);
$this->view_feedback();
if (!$this->drafts_tracked() or !$this->isopen() or $this->is_finalized($submission)) {
print_heading(get_string('submission', 'assignment'), '', 3);
} else {
print_heading(get_string('submissiondraft', 'assignment'), '', 3);
}
if ($filecount and $submission) {
print_simple_box($this->print_user_files($USER->id, true), 'center');
} else {
if (!$this->isopen() or $this->is_finalized($submission)) {
print_simple_box(get_string('nofiles', 'assignment'), 'center');
} else {
print_simple_box(get_string('nofilesyet', 'assignment'), 'center');
}
}
$this->view_upload_form();
if ($this->notes_allowed()) {
print_heading(get_string('notes', 'assignment'), '', 3);
$this->view_notes();
}
$this->view_final_submission();
}
$this->view_footer();
}
示例7: data_submitted
$data = data_submitted();
}
if ($success) {
$savedstr = get_string('configsaved', 'repository');
//admin_externalpage_print_header();
print_heading($savedstr);
redirect($baseurl, $savedstr, 3);
} else {
print_error('instancenotsaved', 'repository', $baseurl);
}
exit;
} else {
// Display the form
// admin_externalpage_print_header();
print_heading(get_string('configplugin', 'repository_' . $plugin));
print_simple_box_start();
$mform->display();
print_simple_box_end();
$return = false;
}
}
} else {
if (!empty($delete)) {
// admin_externalpage_print_header();
$instance = repository::get_instance($delete);
//if you try to delete an instance set as readonly, display an error message
if ($instance->readonly) {
throw new repository_exception('readonlyinstance', 'repository');
}
if ($sure) {
if (!confirm_sesskey()) {
示例8: workshop_user_complete
function workshop_user_complete($course, $user, $mod, $workshop)
{
if ($submission = workshop_get_student_submission($workshop, $user)) {
if ($basedir = workshop_file_area($workshop, $user)) {
if ($files = get_directory_list($basedir)) {
$countfiles = count($files) . ' ' . get_string('submissions', 'workshop');
foreach ($files as $file) {
$countfiles .= "; {$file}";
}
}
}
print_simple_box_start();
echo $submission->description . '<br />';
if (!empty($countfiles)) {
echo $countfiles, '<br />';
}
workshop_print_feedback($course, $submission);
print_simple_box_end();
} else {
print_string('notsubmittedyet', 'workshop');
}
}
示例9: user_complete
/**
* Print complete information about the user's interaction with the assignment
*
* @param $user object
*/
function user_complete($user, $grade = null)
{
if ($grade) {
echo '<p>' . get_string('grade') . ': ' . $grade->str_long_grade . '</p>';
if ($grade->str_feedback) {
echo '<p>' . get_string('feedback') . ': ' . $grade->str_feedback . '</p>';
}
}
if ($submission = $this->get_submission($user->id)) {
if ($basedir = $this->file_area($user->id)) {
if ($files = get_directory_list($basedir)) {
$countfiles = count($files) . " " . get_string("uploadedfiles", "assignment");
foreach ($files as $file) {
$countfiles .= "; {$file}";
}
}
}
print_simple_box_start();
echo get_string("lastmodified") . ": ";
echo userdate($submission->timemodified);
echo $this->display_lateness($submission->timemodified);
$this->print_user_files($user->id);
echo '<br />';
$this->view_feedback($submission);
print_simple_box_end();
} else {
print_string("notsubmittedyet", "assignment");
}
}
示例10: print_entry
/**
* Presents registration forms.
*
* @param object $course Course info
* @access public
*/
function print_entry($course)
{
global $CFG, $USER, $form;
$zerocost = zero_cost($course);
if ($zerocost) {
$manual = enrolment_factory::factory('manual');
if (!empty($this->errormsg)) {
$manual->errormsg = $this->errormsg;
}
$manual->print_entry($course);
return;
}
prevent_double_paid($course);
httpsrequired();
if (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] != 443) {
// MDL-9836
if (empty($CFG->loginhttps)) {
print_error('httpsrequired', 'enrol_authorize');
} else {
$wwwsroot = str_replace('http:', 'https:', $CFG->wwwroot);
redirect("{$wwwsroot}/course/enrol.php?id={$course->id}");
exit;
}
}
$strcourses = get_string('courses');
$strloginto = get_string('loginto', '', $course->shortname);
$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) {
print_heading(get_string('choosemethod', 'enrol_authorize'), 'center');
}
print_simple_box_start('center', '80%');
if ($USER->username == 'guest') {
// only real guest user, not for users with guest role
$curcost = get_course_cost($course);
echo '<div class="mdl-align">';
echo '<p>' . get_string('paymentrequired') . '</p>';
echo '<p><b>' . get_string('cost') . ": {$curcost['currency']} {$curcost['cost']}" . '</b></p>';
echo '<p><a href="' . $CFG->httpswwwroot . '/login/">' . get_string('loginsite') . '</a></p>';
echo '</div>';
} else {
require_once $CFG->dirroot . '/enrol/authorize/enrol_form.php';
$frmenrol = new enrol_authorize_form('enrol.php', compact('course'));
if ($frmenrol->get_data()) {
$authorizeerror = '';
switch ($form->paymentmethod) {
case AN_METHOD_CC:
$authorizeerror = $this->cc_submit($form, $course);
break;
case AN_METHOD_ECHECK:
$authorizeerror = $this->echeck_submit($form, $course);
break;
}
if (!empty($authorizeerror)) {
error($authorizeerror);
}
}
$frmenrol->display();
}
print_simple_box_end();
if ($course->password) {
$password = '';
include $CFG->dirroot . '/enrol/manual/enrol.html';
}
print_footer();
}
示例11: print_feedback_radio
function print_feedback_radio($item, $value = false, $readonly = false)
{
$presentation = explode("|", stripslashes_safe($item->presentation));
$requiredmark = $item->required == 1 ? '<font color="red">*</font>' : '';
?>
<td valign="top" align="left"><?php
echo text_to_html(stripslashes_safe($item->name) . $requiredmark, true, false, false);
?>
</td>
<td valign="top" align="left">
<?php
$index = 1;
$checked = '';
if ($readonly) {
foreach ($presentation as $radio) {
if ($value == $index) {
print_simple_box_start('left');
echo text_to_html($radio, true, false, false);
print_simple_box_end();
break;
}
$index++;
}
} else {
foreach ($presentation as $radio) {
if ($value == $index) {
$checked = 'checked="checked"';
} else {
$checked = '';
}
?>
<table><tr>
<td valign="top"><input type="radio"
name="<?php
echo $item->typ . '_' . $item->id;
?>
"
value="<?php
echo $index;
?>
" <?php
echo $checked;
?>
/>
</td><td><?php
echo text_to_html($radio, true, false, false);
?>
</td></tr></table>
<?php
$index++;
}
/*
if($item->required == 1) {
echo '<input type="hidden" name="'.$item->typ . '_' . $item->id.'" value="1" />';
}
*/
}
?>
</td>
<?php
}
示例12: print_simple_box_start
<?php
//admin_externalpage_print_header();
print_simple_box_start("center", "");
if (!empty($page->message)) {
echo '<p>' . $page->message . '</p>';
}
?>
<form method="post" action="settings.php">
<div>
<input type="hidden" name="sesskey" value="<?php
echo $USER->sesskey;
?>
" />
<input type="hidden" name="action" value="<?php
echo $page->action;
?>
" />
<table cellpadding="9" cellspacing="0" width="635">
<tr>
<td align="right" valign="top">Server Id:</td>
<td valign="top"><input type="text" name="serverId" size="3" value="<?php
echo $page->serverId;
?>
" /></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="<?php
示例13: user_complete
/**
* Print complete information about the user's interaction with the assignment
*
* @param $user object
*/
function user_complete($user)
{
if ($submission = $this->get_submission($user->id)) {
if ($basedir = $this->file_area($user->id)) {
if ($files = get_directory_list($basedir)) {
$countfiles = count($files) . " " . get_string("uploadedfiles", "assignment");
foreach ($files as $file) {
$countfiles .= "; {$file}";
}
}
}
print_simple_box_start();
echo get_string("lastmodified") . ": ";
echo userdate($submission->timemodified);
echo $this->display_lateness($submission->timemodified);
$this->print_user_files($user->id);
echo '<br />';
if (empty($submission->timemarked)) {
print_string("notgradedyet", "assignment");
} else {
$this->view_feedback($submission);
}
print_simple_box_end();
} else {
print_string("notsubmittedyet", "assignment");
}
}
示例14: preg_split
/// Insert a link to force page refresh if new content isn't showing.
// build new URL + query string
$queries = preg_split('/[?&]/', me());
$nqueries = count($queries);
$me = $queries[0] . '?';
for ($i = 1; $i < $nqueries; $i++) {
if (!strstr($queries[$i], 'allowcache')) {
$me .= $queries[$i] . '&';
}
}
$me .= 'allowcache=0';
// Insert the link
$linkdesc = get_string('reloadlinkdescription', 'wiki');
$linktext = get_string('reloadlinktext', 'wiki');
echo "<div class='wikilinkright'><a href='{$me}' title='{$linkdesc}'><input type='button' value='{$linktext}' /></a></div>";
print_simple_box_start('center', '100%', '', '20');
/// Don't filter any pages containing wiki actions (except view). A wiki page containing
/// actions will have the form [action]/[pagename]. If the action is 'view' or the '/'
/// isn't there (so the action defaults to 'view'), filter it.
/// If the page does not yet exist, the display will default to 'edit'.
if ((count($actions) < 2 || $actions[0] == "view") && $wiki_entry && record_exists('wiki_pages', 'pagename', addslashes($page), 'wiki', $wiki_entry->id)) {
print format_text($content, $moodle_format);
} else {
if ($actions[0] == 'edit' && $reallyedit) {
// Check the page isn't locked before printing out standard wiki content. (Locking
// is implemented as a wrapper over the existing wiki.)
list($gotlock, $lock) = wiki_obtain_lock($wiki_entry->id, $pagename);
if (!$gotlock) {
$modcontext = get_context_instance(CONTEXT_MODULE, $cm->id);
$canoverridelock = has_capability('mod/wiki:overridelock', $modcontext);
$a = new stdClass();
示例15: redirect
}
}
redirect($CFG->wwwroot . '/mod/slideshow/view.php?id=' . $id, "Done");
}
/// Print the page header
if ($course->category) {
$navigation = "<a href=\"../../course/view.php?id={$course->id}\">{$course->shortname}</a> ->";
} else {
$navigation = '';
}
$strslideshows = get_string("modulenameplural", "slideshow");
$strslideshow = get_string("modulename", "slideshow");
print_header("{$course->shortname}: {$slideshow->name}", "{$course->fullname}", "{$navigation} <a href=index.php?id={$course->id}>{$strslideshows}</a> -> {$slideshow->name}", "", "", true, update_module_button($cm->id, $course->id, $strslideshow), navmenu($course, $cm));
/// Print the main part of the page
include 'tabs.php';
print_simple_box_start('center', '800px', '#ffffff', 10);
echo '<script type="text/javascript" src="js/jquery.min.js"></script>';
$data = get_record("slideshow_files", "id", $p);
echo '<script type="text/javascript" charset="utf-8">
var metaid = 2;
function addFormFieldMeta() {
var metarowid = window.metaid;
jQuery("#divTxtMeta").append(\'<div id="row_meta_\'+metarowid+\'" style="clear: both;-moz-border-radius:6px 6px 6px 6px;background-color:#F3F3F3;list-style-type:none;padding:5px 5px 5px 10px;margin:5px"> \\
<table> \\
<tr> \\
<td width="200px" align="right"><strong>Question \'+metarowid+\'</strong></td> \\
<td width="60px" align="right">' . get_string('slideshow_questionname', 'slideshow') . '</td> \\
<td colspan="3"><input type="text" name="name_\'+metarowid+\'" value="" style="width:400px;" /></td> \\
</tr> \\