本文整理汇总了PHP中print_box函数的典型用法代码示例。如果您正苦于以下问题:PHP print_box函数的具体用法?PHP print_box怎么用?PHP print_box使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了print_box函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: block_exabis_eportfolio_print_extern_item
function block_exabis_eportfolio_print_extern_item($item, $access)
{
global $CFG;
print_heading(format_string($item->name));
$box_content = '';
if ($item->type == 'link') {
$link = clean_param($item->url, PARAM_URL);
$link_js = str_replace('http://', '', $link);
if ($link) {
$box_content .= '<p><a href="#" onclick="window.open(\'http://' . addslashes_js($link_js) . '\',\'validate\',\'width=620,height=450,scrollbars=yes,status=yes,resizable=yes,menubar=yes,location=yes\');return true;">' . $link . '</a></p>';
}
} elseif ($item->type == 'file') {
if ($item->attachment) {
$type = mimeinfo("type", $item->attachment);
$ffurl = "{$CFG->wwwroot}/blocks/exabis_eportfolio/portfoliofile.php?access=" . $access . "&itemid=" . $item->id;
if (in_array($type, array('image/gif', 'image/jpeg', 'image/png'))) {
// Image attachments don't get printed as links
$box_content .= "<img width=\"100%\" src=\"{$ffurl}\" alt=\"" . format_string($item->name) . "\" /><br/>";
} else {
$box_content .= "<p>" . link_to_popup_window("{$ffurl}", 'popup', "{$ffurl}", $height = 400, $width = 500, format_string($item->name), 'none', true) . "</p>";
}
}
}
$box_content .= format_text($item->intro, FORMAT_HTML);
print_box($box_content);
}
示例2: rejudge_showresult
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');
}
示例3: apply
function apply($discussion, $all, $selected, $formdata)
{
global $COURSE, $USER, $CFG;
// Begin with standard text
$a = (object) array('name' => fullname($USER, true));
$allhtml = "<head>";
foreach ($CFG->stylesheets as $stylesheet) {
$allhtml .= '<link rel="stylesheet" type="text/css" href="' . $stylesheet . '" />' . "\n";
}
$allhtml .= "</head>\n<body id='forumng-email'>\n";
$preface = get_string('forward_preface', 'forumng', $a);
$allhtml .= $preface;
$alltext = format_text_email($preface, FORMAT_HTML);
// Include intro if specified
if (!preg_match('~^(<br[^>]*>|<p>|</p>|\\s)*$~', $formdata->message)) {
$alltext .= "\n" . forum_cron::EMAIL_DIVIDER . "\n";
$allhtml .= '<hr size="1" noshade="noshade" />';
// Add intro
$message = trusttext_strip(stripslashes($formdata->message));
$allhtml .= format_text($message, $formdata->format);
$alltext .= format_text_email($message, $formdata->format);
}
// Get list of all post ids in discussion order
$alltext .= "\n" . forum_cron::EMAIL_DIVIDER . "\n";
$allhtml .= '<hr size="1" noshade="noshade" />';
$poststext = '';
$postshtml = '';
$discussion->build_selected_posts_email($selected, $poststext, $postshtml);
$alltext .= $poststext;
$allhtml .= $postshtml . '</body>';
$emails = preg_split('~[; ]+~', $formdata->email);
$subject = stripslashes($formdata->subject);
foreach ($emails as $email) {
$fakeuser = (object) array('email' => $email, 'mailformat' => 1, 'id' => 0);
$from = $USER;
$from->maildisplay = 999;
// Nasty hack required for OU moodle
if (!email_to_user($fakeuser, $from, $subject, $alltext, $allhtml)) {
print_error('error_forwardemail', 'forumng', $formdata->email);
}
}
// Log that it was sent
$discussion->log('forward discussion', $formdata->email);
if (!empty($formdata->ccme)) {
if (!email_to_user($USER, $from, $subject, $alltext, $allhtml)) {
print_error('error_forwardemail', 'forumng', $USER->email);
}
}
$discussion->print_subpage_header($this->get_page_name());
print_box(get_string('forward_done', 'forumng'));
print_continue('../../discuss.php?' . $discussion->get_link_params(forum::PARAM_PLAIN));
print_footer($COURSE);
}
示例4: user_message_form
if (!get_user_preferences('message_usehtmleditor', 0)) {
$CFG->htmleditor = '';
}
$msgform = new user_message_form('user_bulk_message.php');
if ($msgform->is_cancelled()) {
redirect($return);
} else {
if ($formdata = $msgform->get_data()) {
$options = new object();
$options->para = false;
$options->newlines = true;
$options->smiley = false;
$msg = format_text($formdata->messagebody, $formdata->format, $options);
$in = implode(',', $SESSION->bulk_users);
$userlist = $DB->get_records_select_menu('user', "id IN ({$in})", null, 'fullname', 'id,' . $DB->sql_fullname() . ' AS fullname');
$usernames = implode(', ', $userlist);
$optionsyes = array();
$optionsyes['confirm'] = 1;
$optionsyes['sesskey'] = sesskey();
$optionsyes['msg'] = $msg;
admin_externalpage_print_header();
print_heading(get_string('confirmation', 'admin'));
print_box($msg, 'boxwidthnarrow boxaligncenter generalbox', 'preview');
notice_yesno(get_string('confirmmessage', 'bulkusers', $usernames), 'user_bulk_message.php', 'user_bulk.php', $optionsyes, NULL, 'post', 'get');
admin_externalpage_print_footer();
die;
}
}
admin_externalpage_print_header();
$msgform->display();
admin_externalpage_print_footer();
示例5: current
$firstscorm = current($scorms);
if (!($course->format == 'scorm' && $firstscorm->id == $scorm->id)) {
$navlinks[] = array('name' => $strscorms, 'link' => "index.php?id={$course->id}", 'type' => 'activity');
}
}
}
$pagetitle = strip_tags($course->shortname . ': ' . format_string($scorm->name));
add_to_log($course->id, 'scorm', 'pre-view', 'view.php?id=' . $cm->id, "{$scorm->id}");
if (has_capability('mod/scorm:skipview', get_context_instance(CONTEXT_MODULE, $cm->id)) && scorm_simple_play($scorm, $USER)) {
exit;
}
//
// Print the page header
//
$navlinks = array();
$navlinks[] = array('name' => format_string($scorm->name, true), 'link' => "view.php?id={$cm->id}", 'type' => 'activityinstance');
$navigation = build_navigation($navlinks);
print_header($pagetitle, $course->fullname, $navigation, '', '', true, update_module_button($cm->id, $course->id, $strscorm), navmenu($course, $cm));
if (has_capability('mod/scorm:viewreport', $context)) {
$trackedusers = scorm_get_count_users($scorm->id, $cm->groupingid);
if ($trackedusers > 0) {
echo "<div class=\"reportlink\"><a {$CFG->frametarget} href=\"report.php?id={$cm->id}\"> " . get_string('viewalluserreports', 'scorm', $trackedusers) . '</a></div>';
} else {
echo '<div class="reportlink">' . get_string('noreports', 'scorm') . '</div>';
}
}
// Print the main part of the page
print_heading(format_string($scorm->name));
print_box(format_text($scorm->summary), 'generalbox', 'intro');
scorm_view_display($USER, $scorm, 'view.php?id=' . $cm->id, $cm);
print_footer($course);
示例6: admin_externalpage_setup
<?php
//$Id$
///This file only manages the installation of 1.6 lang packs.
///in downloads.moodle.org, they are store in separate directory /lang16
///in local server, they are stored in $CFG->dataroot/lang
///This helps to avoid confusion.
require_once '../config.php';
require_once $CFG->libdir . '/adminlib.php';
require_once $CFG->libdir . '/filelib.php';
require_once $CFG->libdir . '/componentlib.class.php';
admin_externalpage_setup('langimport');
if (!empty($CFG->skiplangupgrade)) {
admin_externalpage_print_header();
print_box(get_string('langimportdisabled', 'admin'));
print_footer();
die;
}
$mode = optional_param('mode', 0, PARAM_INT);
//phase
$pack = optional_param('pack', array(), PARAM_FILE);
//pack to install
$displaylang = $pack;
$uninstalllang = optional_param('uninstalllang', '', PARAM_FILE);
$confirm = optional_param('confirm', 0, PARAM_BOOL);
$sitelang = optional_param('sitelangconfig', '', PARAM_FILE);
define('INSTALLATION_OF_SELECTED_LANG', 2);
define('DELETION_OF_SELECTED_LANG', 4);
define('UPDATE_ALL_LANG', 5);
$strlang = get_string('langimport', 'admin');
$strlanguage = get_string('language');
示例7: get_recordset_sql
$sql = 'SELECT id, firstname, lastname, email
FROM ' . $CFG->prefix . 'user u
WHERE deleted = 0 AND confirmed = 1
AND mnethostid = ' . $CFG->mnet_localhost_id . ' ' . $select . 'ORDER BY lastname ASC, firstname ASC';
$availableusers = get_recordset_sql($sql, 0, MAX_USERS_PER_PAGE);
/// Print the page
/// get language strings
$str = get_strings(array('enrolmentplugins', 'configuration', 'users', 'administration'));
/// Get some language strings
$strpotentialusers = get_string('potentialusers', 'role');
$strexistingusers = get_string('existingusers', 'role');
$straction = get_string('assignroles', 'role');
$strroletoassign = get_string('roletoassign', 'role');
$strcurrentcontext = get_string('currentcontext', 'role');
$strsearch = get_string('search');
$strshowall = get_string('showall');
$strparticipants = get_string('participants');
$strsearchresults = get_string('searchresults');
admin_externalpage_print_header();
print_box('<strong>' . s($mnet_peer->name) . ' : ' . format_string($course->shortname) . ' ' . format_string($course->fullname) . '</strong><br />' . get_string("enrolcourseenrol_desc", "mnet"));
echo "<hr />";
include dirname(__FILE__) . '/enr_course_enrol.html';
if (!empty($errors)) {
$msg = '<p>';
foreach ($errors as $e) {
$msg .= $e . '<br />';
}
$msg .= '</p>';
notify($msg);
}
admin_externalpage_print_footer();
示例8: forum_print_latest_discussions
echo ' ';
}
echo '</p>';
if (!empty($showall)) {
forum_print_latest_discussions($course, $forum, 0, 'header', '', -1, -1, -1, 0, $cm);
} else {
forum_print_latest_discussions($course, $forum, -1, 'header', '', -1, -1, $page, $CFG->forum_manydiscussions, $cm);
}
break;
case 'teacher':
if (!empty($showall)) {
forum_print_latest_discussions($course, $forum, 0, 'header', '', -1, -1, -1, 0, $cm);
} else {
forum_print_latest_discussions($course, $forum, -1, 'header', '', -1, -1, $page, $CFG->forum_manydiscussions, $cm);
}
break;
default:
if (!empty($forum->intro)) {
$options = new stdclass();
$options->para = false;
print_box(format_text($forum->intro, FORMAT_MOODLE, $options), 'generalbox', 'intro');
}
echo '<br />';
if (!empty($showall)) {
forum_print_latest_discussions($course, $forum, 0, 'header', '', -1, -1, -1, 0, $cm);
} else {
forum_print_latest_discussions($course, $forum, -1, 'header', '', -1, -1, $page, $CFG->forum_manydiscussions, $cm);
}
break;
}
print_footer($course);
示例9: print_box
// Explain
print_box(get_string('ssoacldescr', 'mnet'));
// Are the needed bits enabled?
$warn = '';
if (empty($CFG->mnet_dispatcher_mode) || $CFG->mnet_dispatcher_mode !== 'strict') {
$warn = '<p>' . get_string('mnetdisabled', 'mnet') . '</p>';
}
if (!is_enabled_auth('mnet')) {
$warn .= '<p>' . get_string('authmnetdisabled', 'mnet') . '</p>';
}
if (get_config('auth/mnet', 'auto_add_remote_users') != true) {
$warn .= '<p>' . get_string('authmnetautoadddisabled', 'mnet') . '</p>';
}
if (!empty($warn)) {
$warn = '<p>' . get_string('ssoaclneeds', 'mnet') . '</p>' . $warn;
print_box($warn);
}
// output the ACL table
$columns = array("username", "mnet_host_id", "access", "delete");
$headings = array();
$string = array('username' => get_string('username'), 'mnet_host_id' => get_string('remotehost', 'mnet'), 'access' => get_string('accesslevel', 'mnet'), 'delete' => get_string('delete'));
foreach ($columns as $column) {
if ($sort != $column) {
$columnicon = "";
$columndir = "ASC";
} else {
$columndir = $dir == "ASC" ? "DESC" : "ASC";
$columnicon = $dir == "ASC" ? "down" : "up";
$columnicon = " <img src=\"{$CFG->pixpath}/t/{$columnicon}.gif\" alt=\"\" />";
}
$headings[$column] = "<a href=\"?sort={$column}&dir={$columndir}&\">" . $string[$column] . "</a>{$columnicon}";
示例10: addslashes_js
$jsdescription = addslashes_js(trim(format_text($groups[$gpid]->description)));
if (empty($jsdescription)) {
$line[] = $name;
} else {
$jsstrdescription = addslashes_js($strdescription);
$overlib = "return overlib('{$jsdescription}', BORDER, 0, FGCLASS, 'description', " . "CAPTIONFONTCLASS, 'caption', CAPTION, '{$jsstrdescription}');";
$line[] = '<span onmouseover="' . s($overlib) . '" onmouseout="return nd();">' . $name . '</span>';
}
$fullnames = array();
foreach ($users as $user) {
$fullnames[] = '<a href="' . $CFG->wwwroot . '/user/view.php?id=' . $user->id . '&course=' . $course->id . '">' . fullname($user, true) . '</a>';
}
$line[] = implode(', ', $fullnames);
$line[] = count($users);
$table->data[] = $line;
}
if ($groupid and empty($table->data)) {
continue;
}
if (!empty($CFG->enablegroupings)) {
if ($gpgid < 0) {
print_heading($strnotingrouping, '', 3);
} else {
print_heading(format_string($groupings[$gpgid]->name), '', 3);
print_box(format_text($groupings[$gpgid]->description), 'generalbox boxwidthnarrow boxaligncenter');
}
}
print_table($table, false);
$printed = true;
}
print_footer($course);
示例11: notice
/**
* Print a message and exit.
*
* @uses $CFG
* @param string $message ?
* @param string $link ?
* @todo Finish documenting this function
*/
function notice($message, $link = '', $course = NULL)
{
global $CFG, $SITE, $THEME, $COURSE, $PAGE;
$message = clean_text($message);
// In case nasties are in here
if (CLI_SCRIPT) {
// notices in cron should be mtrace'd.
mtrace($message);
die;
}
if (!$PAGE->headerprinted) {
//header not yet printed
print_header(get_string('notice'));
} else {
print_container_end_all(false, $THEME->open_header_containers);
}
print_box($message, 'generalbox', 'notice');
print_continue($link);
if (empty($course)) {
print_footer($COURSE);
} else {
print_footer($course);
}
exit;
}
示例12: print_box
print_box($stroutofattempts, 'center');
} elseif ($key == $preferences['newemailkey']) {
$olduser = clone $user;
cancel_email_update($user->id);
$user->email = $preferences['newemail'];
// Detect duplicate before saving
if (get_record('user', 'email', addslashes($user->email))) {
$stremailnowexists = get_string('auth_emailnowexists', 'auth');
print_box($stremailnowexists, 'center');
print_continue("{$CFG->wwwroot}/user/view.php?id={$user->id}");
} else {
// update user email
if (!set_field('user', 'email', addslashes($user->email), 'id', $user->id)) {
error('Error updating user record');
} else {
$authplugin = get_auth_plugin($user->auth);
$authplugin->user_update($olduser, $user);
events_trigger('user_updated', $user);
$a->email = $user->email;
$stremailupdatesuccess = get_string('auth_emailupdatesuccess', 'auth', $a);
print_box($stremailupdatesuccess, 'center');
print_continue("{$CFG->wwwroot}/user/view.php?id={$user->id}");
}
}
} else {
$preferences['newemailattemptsleft']--;
set_user_preference('newemailattemptsleft', $preferences['newemailattemptsleft'], $user->id);
$strinvalidkey = get_string('auth_invalidnewemailkey', 'auth');
print_box($strinvalidkey, 'center');
}
print_footer('none');
示例13: switch
$head = $gXpLang['add_affiliate'];
} else {
$head = $gXpLang['account_status'] . ' : ';
$head .= '<span style="text-transform: capitalize;">';
switch ($account['approved']) {
case 1:
$head .= $gXpLang['status_pending'];
break;
case 2:
$head .= $gXpLang['status_approved'];
break;
default:
$head .= $gXpLang['status_disapproved'];
}
$head .= '</span>';
print_box(0, $head);
}
// echo $head;
?>
<!-- </div>-->
<table class="admintable">
<tbody><tr>
<td valign="top" width="60%">
<table class="adminform">
<tbody>
<tr>
<th colspan="2"><?php
echo $gXpLang['affiliate_personal_details'];
?>
</th>
示例14: print_box
<br />
<?php
print_box($error, $msg);
$commission = $gXpAdmin->getCommissionById($_GET['id']);
$aff = $gXpAdmin->getAffiliateById($commission['aff_id']);
?>
<form action="manage-commission.php<?php
echo $user > 0 ? "?user=" . $user : "";
?>
" method="post" name="adminForm">
<?php
if (!$msg) {
print_box(0, $user > 0 ? '' : $gXpLang['commission_status_approval']);
?>
<table class="admintable">
<tbody><tr>
<td valign="top" width="60%">
<fieldset style="width:384px;border:1px solid #e9e9e9;padding:0px 0px 10px 10px;margin:10px 0px 10px 0px;">
<legend style="border:1px solid #e9e9e9;font:bold 12px arial;color:#333;padding:3px;"><?php
echo $gXpLang['commission_details'];
?>
</legend>
<table class="adminform">
<tbody>
<tr>
<td width="100"><?php
示例15: get_records
$requireds = get_records('qcreate_required', 'qcreateid', $qcreate->id, 'qtype', 'qtype, no, id');
$modulecontext = get_context_instance(CONTEXT_MODULE, $cm->id);
require_login($COURSE->id);
require_capability('mod/qcreate:grade', $modulecontext);
add_to_log($COURSE->id, "qcreate", "overview", "overview.php?id={$cm->id}", "{$qcreate->id}");
/// Print the page header
$strqcreates = get_string("modulenameplural", "qcreate");
$strqcreate = get_string("modulename", "qcreate");
$navlinks = array();
$navlinks[] = array('name' => $strqcreates, 'link' => "index.php?id={$COURSE->id}", 'type' => 'activity');
$navlinks[] = array('name' => format_string($qcreate->name), 'link' => '', 'type' => 'activityinstance');
$navigation = build_navigation($navlinks);
print_header_simple(format_string($qcreate->name), "", $navigation, "", "", true, update_module_button($cm->id, $COURSE->id, $strqcreate), navmenu($COURSE, $cm));
$mode = 'overview';
include 'tabs.php';
print_box(format_text($qcreate->intro, $qcreate->introformat), 'generalbox', 'intro');
$qcreatetime = new object();
$qcreatetime->timeopen = userdate($qcreate->timeopen);
$qcreatetime->timeclose = userdate($qcreate->timeclose);
/* if ($qcreate->timeopen == 0 AND $qcreate->timeclose ==0 ){
$timestring = get_string('timenolimit', 'qcreate');
} else if ($qcreate->timeopen != 0 AND $qcreate->timeclose ==0 ) {
$timestring = get_string('timeopen', 'qcreate', $qcreatetime);
} else if ($qcreate->timeopen == 0 AND $qcreate->timeclose !=0 ) {
$timestring = get_string('timeclose', 'qcreate', $qcreatetime);
} else {
$timestring = get_string('timeopenclose', 'qcreate', $qcreatetime);
}*/
$timestring = qcreate_time_status($qcreate);
if ($qcreate->graderatio == 100) {