本文整理汇总了PHP中print_box_start函数的典型用法代码示例。如果您正苦于以下问题:PHP print_box_start函数的具体用法?PHP print_box_start怎么用?PHP print_box_start使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了print_box_start函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: sloodle_display_config_form
function sloodle_display_config_form($sloodleauthid, $auth_obj)
{
//--------------------------------------------------------
// SETUP
// Determine which course is being accessed
$courseid = $auth_obj->course->get_course_id();
// We need to fetch a list of visible chatrooms on the course
// Get the ID of the chat type
$rec = get_record('modules', 'name', 'chat');
if (!$rec) {
sloodle_debug("Failed to get chatroom module type.");
exit;
}
$chatmoduleid = $rec->id;
// Get all visible chatrooms in the current course
$recs = get_records_select('course_modules', "course = {$courseid} AND module = {$chatmoduleid} AND visible = 1");
if (!$recs) {
error(get_string('nochatrooms', 'sloodle'));
exit;
}
$chatrooms = array();
foreach ($recs as $cm) {
// Fetch the chatroom instance
$inst = get_record('chat', 'id', $cm->instance);
if (!$inst) {
continue;
}
// Store the chatroom details
$chatrooms[$cm->id] = $inst->name;
}
// Sort the list by name
natcasesort($chatrooms);
//--------------------------------------------------------
// FORM
// Get the current object configuration
$settings = SloodleController::get_object_configuration($sloodleauthid);
// Setup our default values
$sloodlemoduleid = (int) sloodle_get_value($settings, 'sloodlemoduleid', 0);
$sloodlelistentoobjects = (int) sloodle_get_value($settings, 'sloodlelistentoobjects', 0);
$sloodleautodeactivate = (int) sloodle_get_value($settings, 'sloodleautodeactivate', 1);
///// GENERAL CONFIGURATION /////
print_box_start('generalbox boxaligncenter');
echo '<h3>' . get_string('generalconfiguration', 'sloodle') . '</h3>';
// Ask the user to select a chatroom
echo get_string('selectchatroom', 'sloodle') . ': ';
choose_from_menu($chatrooms, 'sloodlemoduleid', $sloodlemoduleid, '');
echo "<br><br>\n";
// Listening to object chat
echo get_string('listentoobjects', 'sloodle') . ': ';
choose_from_menu_yesno('sloodlelistentoobjects', $sloodlelistentoobjects);
echo "<br><br>\n";
// Allowing auto-deactivation
echo get_string('allowautodeactivation', 'sloodle') . ': ';
choose_from_menu_yesno('sloodleautodeactivate', $sloodleautodeactivate);
echo "<br>\n";
print_box_end();
///// ACCESS LEVELS /////
sloodle_print_access_level_options($settings);
}
开发者ID:nagyistoce,项目名称:moodle-Teach-Pilot,代码行数:59,代码来源:object_config.php
示例2: memorization_print_new_verse_box
function memorization_print_new_verse_box()
{
global $CFG, $USER;
print_box_start('add-verse-box generalbox box');
print_heading(get_string('newverse', 'memorization'));
$biblebooks = biblebooks_array();
// create the book selector
$biblebookoptions = '';
foreach ($biblebooks as $booknumber => $bookofbible) {
if ($booknumber == 0) {
continue;
}
$biblebookoptions .= '<option value="' . $booknumber . '">' . $bookofbible . '</option>';
}
$startbookid = '<select name="startbookid">' . $biblebookoptions . '</select>';
$endbookid = '<select name="endbookid">' . $biblebookoptions . '</select>';
// create the chapter inputs
$startchapter = '<input type="text" name="startchapter" size="5" />';
$endchapter = '<input type="text" name="endchapter" size="5"/>';
// create the verse inputs
$startverse = '<input type="text" name="startverse" size="5"/>';
$endverse = '<input type="text" name="endverse" size="5"/>';
// create the version chooser
$versions = get_records('memorization_version');
if (!empty($versions)) {
$versionselect = '<select name="versionid">';
$lastversionid = get_field_sql("SELECT versionid FROM {$CFG->prefix}memorization_verse WHERE userid={$USER->id} ORDER BY id DESC");
foreach ($versions as $versionid => $version) {
$selected = $versionid == $lastversionid ? ' SELECTED="selected" ' : '';
$versionselect .= '<option ' . $selected . ' value="' . $versionid . '">' . $version->value . '</option>';
}
$versionselect .= '</select>';
}
$currenturl = new moodle_url(qualified_me());
echo '<form method="POST" action="addverse.php?' . $currenturl->get_query_string() . '">
<input type="hidden" name="sesskey" value="' . sesskey() . '">
<table>
<tr>
<td>' . get_string('fromverse', 'memorization') . '</td>
<td>' . $startbookid . ' ' . $startchapter . ':' . $startverse . '</td>
</tr>
<tr>
<td>' . get_string('toverse', 'memorization') . '</td>
<td>' . $endbookid . ' ' . $endchapter . ':' . $endverse . '</td>
</tr>
<tr>
<td>' . get_string('version', 'memorization') . '</td>
<td>' . $versionselect . '</td>
</tr>
</table>
<input type="submit">
</form>';
print_box_end();
}
开发者ID:NextEinstein,项目名称:riverhills,代码行数:56,代码来源:locallib.php
示例3: notice_okcancel
/**
* Print a message along with "Ok" link for the user to continue and "Cancel" link to close window.
*
* @param string $message The text to display
* @param string $linkok The link to take the user to if they choose "Ok"
* TODO Document remaining arguments
*/
function notice_okcancel($message, $linkok, $optionsok = NULL, $methodok = 'post')
{
global $CFG;
$message = clean_text($message);
$linkok = clean_text($linkok);
print_box_start('generalbox', 'notice');
echo '<p>' . $message . '</p>';
echo '<div class="buttons">';
print_single_button($linkok, $optionsok, get_string('ok'), $methodok, $CFG->framename);
close_window_button('cancel');
echo '</div>';
print_box_end();
}
开发者ID:hit-moodle,项目名称:onlinejudge,代码行数:20,代码来源:rejudge.php
示例4: print_form
function print_form()
{
if ($this->path == 'all') {
$sports = $this->sql_sports;
} else {
$sports = array($this->sql_sports[$this->path]);
}
print_box_start();
echo '<form method="POST">
' . array_reduce($sports, array($this, 'reduce_sport'), '') . '
<input type="hidden" name="type" value="' . $this->type . '">
<input type="hidden" name="path" value="' . $this->path . '">
<input type="hidden" name="userid" value="' . $this->userid . '">
<input type="submit" value="' . get_string('submit') . '">
</form>';
print_box_end();
}
开发者ID:rrusso,项目名称:EARS,代码行数:17,代码来源:admin_name.php
示例5: print_item
function print_item($item, $value = false, $readonly = false, $edit = false, $highlightrequire = false)
{
$info = $this->get_info($item);
$align = get_string('thisdirection') == 'ltr' ? 'left' : 'right';
$presentation = explode(FEEDBACK_MULTICHOICE_LINE_SEP, stripslashes_safe($info->presentation));
//test if required and no value is set so we have to mark this item
//we have to differ check and the other subtypes
if ($info->subtype == 'c') {
if (is_array($value)) {
$values = $value;
} else {
$values = explode(FEEDBACK_MULTICHOICE_LINE_SEP, $value);
}
if ($highlightrequire and $item->required and $values[0] == '') {
$highlight = 'bgcolor="#FFAAAA" class="missingrequire"';
} else {
$highlight = '';
}
$requiredmark = $item->required == 1 ? '<span class="feedback_required_mark">*</span>' : '';
echo '<td ' . $highlight . ' valign="top" align="' . $align . '">' . format_text(stripslashes_safe($item->name) . $requiredmark, true, false, false) . '</td>';
echo '<td valign="top" align="' . $align . '">';
} else {
if ($highlightrequire and $item->required and intval($value) <= 0) {
$highlight = 'bgcolor="#FFAAAA" class="missingrequire"';
} else {
$highlight = '';
}
$requiredmark = $item->required == 1 ? '<span class="feedback_required_mark">*</span>' : '';
?>
<td <?php
echo $highlight;
?>
valign="top" align="<?php
echo $align;
?>
"><?php
echo format_text(stripslashes_safe($item->name) . $requiredmark, true, false, false);
?>
</td>
<td valign="top" align="<?php
echo $align;
?>
">
<?php
}
$index = 1;
$checked = '';
if ($readonly) {
if ($info->subtype == 'c') {
print_box_start('generalbox boxalign' . $align);
foreach ($presentation as $pres) {
foreach ($values as $val) {
if ($val == $index) {
echo text_to_html($pres . '<br />', true, false, false);
break;
}
}
$index++;
}
// print_simple_box_end();
print_box_end();
} else {
foreach ($presentation as $pres) {
if ($value == $index) {
// print_simple_box_start($align);
print_box_start('generalbox boxalign' . $align);
echo text_to_html($pres, true, false, false);
// print_simple_box_end();
print_box_end();
break;
}
$index++;
}
}
} else {
//print the "not_selected" item on radiobuttons
if ($info->subtype == 'r') {
?>
<table><tr>
<td valign="top" align="<?php
echo $align;
?>
"><input type="radio"
name="<?php
echo $item->typ . '_' . $item->id;
?>
"
id="<?php
echo $item->typ . '_' . $item->id . '_xxx';
?>
"
value="" <?php
echo $value ? '' : 'checked="checked"';
?>
/>
</td>
<td align="<?php
echo $align;
?>
">
//.........这里部分代码省略.........
开发者ID:nadavkav,项目名称:MoodleTAO,代码行数:101,代码来源:lib.php
示例6: print_item
function print_item($item, $value = false, $readonly = false, $edit = false, $highlightrequire = false)
{
global $USER, $DB;
$align = get_string('thisdirection') == 'ltr' ? 'left' : 'right';
$presentation = $item->presentation;
if ($highlightrequire and $item->required and strval($value) == '') {
$highlight = 'bgcolor="#FFAAAA" class="missingrequire"';
} else {
$highlight = '';
}
$requiredmark = $item->required == 1 ? '<span class="feedback_required_mark">*</span>' : '';
?>
<td <?php
echo $highlight;
?>
valign="top" align="<?php
echo $align;
?>
">
<?php
if ($edit or $readonly) {
echo '(' . $item->label . ') ';
}
echo format_text($item->name . $requiredmark, true, false, false);
?>
</td>
<td valign="top" align="<?php
echo $align;
?>
">
<?php
if ($readonly) {
// print_simple_box_start($align);
print_box_start('generalbox boxalign' . $align);
echo $value ? UserDate($value) : ' ';
// print_simple_box_end();
print_box_end();
} else {
$feedback = $DB->get_record('feedback', array('id' => $item->feedback));
$course = $DB->get_record('course', array('id' => $feedback->course));
$coursecategory = $DB->get_record('course_categories', array('id' => $course->category));
switch ($presentation) {
case 1:
$itemvalue = time();
$itemshowvalue = UserDate($itemvalue);
break;
case 2:
$itemvalue = $course->shortname;
$itemshowvalue = $itemvalue;
break;
case 3:
$itemvalue = $coursecategory->name;
$itemshowvalue = $itemvalue;
break;
}
?>
<input type="hidden" name="<?php
echo $item->typ . '_' . $item->id;
?>
"
value="<?php
echo $itemvalue;
?>
" />
<span><?php
echo $itemshowvalue;
?>
</span>
<?php
}
?>
</td>
<?php
}
开发者ID:nicolasconnault,项目名称:moodle2.0,代码行数:74,代码来源:lib.php
示例7: redirect
if ($mform->is_cancelled()) {
redirect('show_entries.php?id=' . $id . '&do_show=showentries');
}
if (isset($formdata->confirmdelete) and $formdata->confirmdelete == 1) {
if ($completed = $DB->get_record('feedback_completed', array('id' => $completedid))) {
feedback_delete_completed($completedid);
add_to_log($course->id, 'feedback', 'delete', 'view.php?id=' . $cm->id, $feedback->id, $cm->id);
redirect('show_entries.php?id=' . $id . '&do_show=showentries');
}
}
/// 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));
/// Print the main part of the page
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
print_heading(format_text($feedback->name));
// print_simple_box_start("center", "60%", "#FFAAAA", 20, "noticebox");
print_box_start('generalbox errorboxcontent boxaligncenter boxwidthnormal');
print_heading(get_string('confirmdeleteentry', 'feedback'));
$mform->display();
// print_simple_box_end();
print_box_end();
print_footer($course);
开发者ID:nicolasconnault,项目名称:moodle2.0,代码行数:31,代码来源:delete_completed.php
示例8: print_box_end
print_box_end();
}
///////////////////////////////////////////////////////////////////////////
///print the Item-Edit-section
///////////////////////////////////////////////////////////////////////////
if ($do_show == 'edit') {
$add_item_form->display();
if (is_array($feedbackitems)) {
$itemnr = 0;
$helpbutton = helpbutton('preview', get_string('preview', 'feedback'), 'feedback', true, false, '', true);
print_heading($helpbutton . get_string('preview', 'feedback'));
if (isset($SESSION->feedback->moving) and $SESSION->feedback->moving->shouldmoving == 1) {
print_heading('<a href="' . htmlspecialchars($ME . '?id=' . $id) . '">' . get_string('cancel_moving', 'feedback') . '</a>');
}
// print_simple_box_start('center', '80%');
print_box_start('generalbox boxaligncenter boxwidthwide');
//check, if there exists required-elements
$countreq = $DB->count_records('feedback_item', array('feedback' => $feedback->id, 'required' => 1));
if ($countreq > 0) {
// echo '<font color="red">(*)' . get_string('items_are_required', 'feedback') . '</font>';
echo '<span class="feedback_required_mark">(*)' . get_string('items_are_required', 'feedback') . '</span>';
}
echo '<table>';
if (isset($SESSION->feedback->moving) and $SESSION->feedback->moving->shouldmoving == 1) {
$moveposition = 1;
echo '<tr>';
//only shown if shouldmoving = 1
echo '<td>';
$buttonlink = $ME . '?' . htmlspecialchars(feedback_edit_get_default_query($id, $do_show) . '&movehere=' . $moveposition);
echo '<a title="' . get_string('move_here', 'feedback') . '" href="' . $buttonlink . '">
<img class="movetarget" alt="' . get_string('move_here', 'feedback') . '" src="' . $CFG->pixpath . '/movehere.gif" />
开发者ID:nicolasconnault,项目名称:moodle2.0,代码行数:31,代码来源:edit.php
示例9: turnitintool_box_start
/**
* Abstracted version of box_start() / print_box_start() to work with Moodle 1.8 through 2.0
*
* @param string $classes The CSS class for the box HTML element
* @param string $ids An optional ID
* @param boolean Return the output or print it to screen directly
* @return string the HTML to output.
*/
function turnitintool_box_start($classes = 'generalbox', $ids = '', $return = false)
{
global $OUTPUT;
if (is_callable(array($OUTPUT, 'box_start')) and !$return) {
echo $OUTPUT->box_start($classes, $ids);
} else {
if (is_callable(array($OUTPUT, 'box_start'))) {
return $OUTPUT->box_start($classes, $ids);
} else {
return print_box_start($classes, $ids, $return);
}
}
}
开发者ID:ccle,项目名称:moodle-mod_turnitintool,代码行数:21,代码来源:lib.php
示例10: sloodle_print_access_level_options
/**
* Outputs the standard form elements for access levels in object configuration.
* Each part can be optionally hidden, and default values can be provided.
* (Note: the server access level must be communicated from the object back to Moodle... rubbish implementation, but it works!)
* @param array $current_config An associative array of setting names to values, containing defaults. (Ignored if null).
* @param bool $show_use_object Determines whether or not the "Use Object" setting is shown
* @param bool $show_control_object Determines whether or not the "Control Object" setting is shown
* @param bool $show_server Determines whether or not the server access setting is shown
* @return void
*/
function sloodle_print_access_level_options($current_config, $show_use_object = true, $show_control_object = true, $show_server = true)
{
// Quick-escape: if everything is being suppressed, then do nothing
if (!($show_use_object || $show_control_object || $show_server)) {
return;
}
// Fetch default values from the configuration, if possible
$sloodleobjectaccessleveluse = sloodle_get_value($current_config, 'sloodleobjectaccessleveluse', SLOODLE_OBJECT_ACCESS_LEVEL_PUBLIC);
$sloodleobjectaccesslevelctrl = sloodle_get_value($current_config, 'sloodleobjectaccesslevelctrl', SLOODLE_OBJECT_ACCESS_LEVEL_OWNER);
$sloodleserveraccesslevel = sloodle_get_value($current_config, 'sloodleserveraccesslevel', SLOODLE_SERVER_ACCESS_LEVEL_PUBLIC);
// Define our object access level array
$object_access_levels = array(SLOODLE_OBJECT_ACCESS_LEVEL_PUBLIC => get_string('accesslevel:public', 'sloodle'), SLOODLE_OBJECT_ACCESS_LEVEL_GROUP => get_string('accesslevel:group', 'sloodle'), SLOODLE_OBJECT_ACCESS_LEVEL_OWNER => get_string('accesslevel:owner', 'sloodle'));
// Define our server access level array
$server_access_levels = array(SLOODLE_SERVER_ACCESS_LEVEL_PUBLIC => get_string('accesslevel:public', 'sloodle'), SLOODLE_SERVER_ACCESS_LEVEL_COURSE => get_string('accesslevel:course', 'sloodle'), SLOODLE_SERVER_ACCESS_LEVEL_SITE => get_string('accesslevel:site', 'sloodle'), SLOODLE_SERVER_ACCESS_LEVEL_STAFF => get_string('accesslevel:staff', 'sloodle'));
// Display box and a heading
print_box_start('generalbox boxaligncenter');
echo '<h3>' . get_string('accesslevel', 'sloodle') . '</h3>';
// Print the object settings
if ($show_use_object || $show_control_object) {
// Object access
echo '<b>' . get_string('accesslevelobject', 'sloodle') . '</b><br><i>' . get_string('accesslevelobject:desc', 'sloodle') . '</i><br><br>';
// Use object
if ($show_use_object) {
echo get_string('accesslevelobject:use', 'sloodle') . ': ';
choose_from_menu($object_access_levels, 'sloodleobjectaccessleveluse', $sloodleobjectaccessleveluse, '');
echo '<br><br>';
}
// Control object
if ($show_control_object) {
echo get_string('accesslevelobject:control', 'sloodle') . ': ';
choose_from_menu($object_access_levels, 'sloodleobjectaccesslevelctrl', $sloodleobjectaccesslevelctrl, '');
echo '<br><br>';
}
}
// Print the server settings
if ($show_server) {
// Server access
echo '<b>' . get_string('accesslevelserver', 'sloodle') . '</b><br><i>' . get_string('accesslevelserver:desc', 'sloodle') . '</i><br><br>';
echo get_string('accesslevel', 'sloodle') . ': ';
choose_from_menu($server_access_levels, 'sloodleserveraccesslevel', $sloodleserveraccesslevel, '');
echo '<br>';
}
print_box_end();
}
开发者ID:nagyistoce,项目名称:moodle-Teach-Pilot,代码行数:54,代码来源:general.php
示例11: redirect
if (optional_param('cancelpassword', false)) {
// User clicked cancel in the password form.
redirect($CFG->wwwroot . '/mod/quiz/view.php?q=' . $quiz->id);
} else {
if (strcmp($quiz->password, $enteredpassword) === 0) {
// User entered the correct password.
$SESSION->passwordcheckedquizzes[$quiz->id] = true;
} else {
// User entered the wrong password, or has not entered one yet.
$url = $CFG->wwwroot . '/mod/quiz/attempt.php?q=' . $quiz->id;
print_header('', '', '', 'quizpassword');
if (trim(strip_tags($quiz->intro))) {
$formatoptions->noclean = true;
print_box(format_text($quiz->intro, FORMAT_MOODLE, $formatoptions), 'generalbox', 'intro');
}
print_box_start('generalbox', 'passwordbox');
if (!empty($enteredpassword)) {
echo '<p class="notifyproblem">', get_string('passworderror', 'quiz'), '</p>';
}
?>
<p><?php
print_string('requirepasswordmessage', 'quiz');
?>
</p>
<form id="passwordform" method="post" action="<?php
echo $url;
?>
" onclick="this.autocomplete='off'">
<div>
<label for="quizpassword"><?php
print_string('password');
开发者ID:edwinphillips,项目名称:moodle-485cb39,代码行数:31,代码来源:attempt.php
示例12: print_continue
}
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">
<tr>
开发者ID:veritech,项目名称:pare-project,代码行数:31,代码来源:export.php
示例13: rss_get_link
} else {
$userid = $USER->id;
}
//Get html code for RSS link
$row[] = rss_get_link($course->id, $userid, "forum", $forum->id, $tooltiptext);
}
$learningtable->data[] = $row;
}
}
}
/// Output the page
$navlinks = array();
$navlinks[] = array('name' => $strforums, 'link' => '', 'type' => 'activity');
print_header("{$course->shortname}: {$strforums}", $course->fullname, build_navigation($navlinks), "", "", true, $searchform, navmenu($course));
if (!isguest()) {
print_box_start('subscription');
echo '<span class="helplink">';
echo '<a href="index.php?id=' . $course->id . '&subscribe=1">' . get_string('allsubscribe', 'forum') . '</a>';
echo '</span><br /><span class="helplink">';
echo '<a href="index.php?id=' . $course->id . '&subscribe=0">' . get_string('allunsubscribe', 'forum') . '</a>';
echo '</span>';
print_box_end();
print_box(' ', 'clearer');
}
if ($generalforums) {
print_heading(get_string("generalforums", "forum"));
print_table($generaltable);
}
if ($learningforums) {
print_heading(get_string("learningforums", "forum"));
print_table($learningtable);
开发者ID:BackupTheBerlios,项目名称:samouk-svn,代码行数:31,代码来源:index.php
示例14: feedback_print_errors
/**
* print some errors to inform users about this.
* @return void
*/
function feedback_print_errors()
{
global $SESSION;
if (empty($SESSION->feedback->errors)) {
return;
}
// print_simple_box_start("center", "60%", "#FFAAAA", 20, "noticebox");
print_box_start('generalbox errorboxcontent boxaligncenter boxwidthnormal');
print_heading(get_string('handling_error', 'feedback'));
echo '<p align="center"><b><font color="black"><pre>';
print_r($SESSION->feedback->errors) . "\n";
echo '</pre></font></b></p>';
// print_simple_box_end();
print_box_end();
echo '<br /><br />';
$SESSION->feedback->errors = array();
//remove errors
}
开发者ID:nadavkav,项目名称:MoodleTAO,代码行数:22,代码来源:lib.php
示例15: tag_print_user_box
/**
* Prints an individual user box
*
* @param $user user object (contains the following fields: id, firstname, lastname and picture)
* @param $return if true return html string
*/
function tag_print_user_box($user, $return = false)
{
global $CFG;
$textlib = textlib_get_instance();
$usercontext = get_context_instance(CONTEXT_USER, $user->id);
$profilelink = '';
if (has_capability('moodle/user:viewdetails', $usercontext) || isteacherinanycourse($user->id)) {
$profilelink = $CFG->wwwroot . '/user/view.php?id=' . $user->id;
}
$output = print_box_start('user-box', 'user' . $user->id, true);
$fullname = fullname($user);
$alt = '';
if (!empty($profilelink)) {
$output .= '<a href="' . $profilelink . '">';
$alt = $fullname;
}
//print user image - if image is only content of link it needs ALT text!
if ($user->picture) {
$output .= '<img alt="' . $alt . '" class="user-image" src="' . $CFG->wwwroot . '/user/pix.php/' . $user->id . '/f1.jpg" />';
} else {
$output .= '<img alt="' . $alt . '" class="user-image" src="' . $CFG->wwwroot . '/pix/u/f1.png" />';
}
$output .= '<br />';
if (!empty($profilelink)) {
$output .= '</a>';
}
//truncate name if it's too big
if ($textlib->strlen($fullname) > 26) {
$fullname = $textlib->substr($fullname, 0, 26) . '...';
}
$output .= '<strong>' . $fullname . '</strong>';
$output .= print_box_end(true);
if ($return) {
return $output;
} else {
echo $output;
}
}
开发者ID:edwinphillips,项目名称:moodle-485cb39,代码行数:44,代码来源:locallib.php
示例16: foreach
foreach ($availablelangs as $alang) {
if ($alang[0] == $parent) {
if (substr($alang[0], -5) == '_utf8') {
//Remove the _utf8 suffix from the lang to show
$shortlang = substr($alang[0], 0, -5);
} else {
$shortlang = $alang[0];
}
$a->parent = $alang[2] . ' (' . $shortlang . ')';
}
}
$info = get_string('missinglangparent', 'admin', $a);
notify($info, 'notifyproblem');
}
}
print_box_start();
echo '<table summary="">';
echo '<tr><td align="center" valign="top">';
echo '<form id="uninstallform" action="langimport.php?mode=' . DELETION_OF_SELECTED_LANG . '" method="post">';
echo '<fieldset class="invisiblefieldset">';
echo '<input name="sesskey" type="hidden" value="' . sesskey() . '" />';
/// display installed langs here
echo '<label for="uninstalllang">' . get_string('installedlangs', 'admin') . "</label><br />\n";
echo '<select name="uninstalllang" id="uninstalllang" size="15">';
foreach ($installedlangs as $clang => $ilang) {
echo '<option value="' . $clang . '">' . $ilang . '</option>';
}
echo '</select>';
echo '<br /><input type="submit" value="' . get_string('uninstall', 'admin') . '" />';
echo '</fieldset>';
echo '</form>';
开发者ID:nadavkav,项目名称:MoodleTAO,代码行数:31,代码来源:langimport.php
示例17: print_error
$fileoldmark = ' (old?)';
// mark to add to filenames in selection form if the English version is newer
$filetemplate = '';
// template for new files, e.g. CVS identification
if (isset($_POST['currentfile'])) {
// Save a file
if (!confirm_sesskey()) {
print_error('confirmsesskeybad', 'error');
}
if (lang_help_save_file($saveto, $currentfile, $_POST['filedata'])) {
notify(get_string("changessaved") . " ({$saveto}/{$currentfile})", "notifysuccess");
} else {
error("Could not save the file '{$currentfile}'!", "lang.php?mode=helpfiles&currentfile={$currentfile}&sesskey={$USER->sesskey}");
}
}
print_box_start('generalbox editstrings');
$menufiles = array();
$menufiles_coregrp = 1;
$origlocation = '';
// the location of the currentfile's English source will be stored here
$origplugin = '';
// dtto plugin
foreach ($helpfiles as $helppath => $helpfile) {
$item_key = $helpfile['filename'];
$item_label = $helpfile['filename'];
if (!file_exists($saveto . '/' . $helpfile['filename']) || filesize($saveto . '/' . $helpfile['filename']) == 0) {
$item_label .= $filemissingmark;
} else {
if (filemtime($saveto . '/' . $helpfile['filename']) < filemtime($helppath)) {
$item_label .= $fileoldmark;
}
开发者ID:r007,项目名称:PMoodle,代码行数:31,代码来源:lang.php
示例18: get_string
echo '<form name="frm" action="' . $CFG->wwwroot . '/course/view.php?id=' . $courseid . '" method="post" onsubmit=" ">';
} else {
if ($course->id == SITEID) {
echo '<form name="frm" action="' . $CFG->wwwroot . '" method="post" onsubmit=" ">';
} else {
echo '<form name="frm" action="' . $CFG->wwwroot . '/course/view.php?id=' . $course->id . '" method="post" onsubmit=" ">';
}
}
echo '<input type="hidden" name="sesskey" value="' . $USER->sesskey . '" />';
echo '<input type="hidden" name="courseid" value="' . $courseid . '" />';
echo '<button type="submit">' . get_string('cancel') . '</button>';
echo '</form>';
echo '</div>';
$SESSION->feedback->is_started = true;
// print_simple_box_end();
print_box_end();
}
}
} else {
// print_simple_box_start('center');
print_box_start('generalbox boxaligncenter');
echo '<h2><font color="red">' . get_string('this_feedback_is_already_submitted', 'feedback') . '</font></h2>';
print_continue($CFG->wwwroot . '/course/view.php?id=' . $course->id);
// print_simple_box_end();
print_box_end();
}
/// Finish the page
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
print_footer($course);
开发者ID:kai707,项目名称:ITSA-backup,代码行数:31,代码来源:complete.php
示例19: question_showbank
/**
* Shows the question bank editing interface.
*
* The function also processes a number of actions:
*
* Actions affecting the question pool:
* move Moves a question to a different category
* deleteselected Deletes the selected questions from the category
* Other actions:
* category Chooses the category
* displayoptions Sets display options
*
* @author Martin Dougiamas and many others. This has recently been extensively
* rewritten by Gustav Delius and other members of the Serving Mathematics project
* {@link http://maths.york.ac.uk/serving_maths}
* @param moodle_url $pageurl object representing this pages url.
*/
function question_showbank($tabname, $contexts, $pageurl, $cm, $page, $perpage, $sortorder, $sortorderdecoded, $cat, $recurse, $showhidden, $showquestiontext)
{
global $COURSE;
if (optional_param('deleteselected', false, PARAM_BOOL)) {
// teacher still has to confirm
// make a list of all the questions that are selected
$rawquestions = $_REQUEST;
// This code is called by both POST forms and GET links, so cannot use data_submitted.
$questionlist = '';
// comma separated list of ids of questions to be deleted
$questionnames = '';
// string with names of questions separated by <br /> with
// an asterix in front of those that are in use
$inuse = false;
// set to true if at least one of the questions is in use
foreach ($rawquestions as $key => $value) {
// Parse input for question ids
if (preg_match('!^q([0-9]+)$!', $key, $matches)) {
$key = $matches[1];
$questionlist .= $key . ',';
question_require_capability_on($key, 'edit');
if (record_exists('quiz_question_instances', 'question', $key)) {
$questionnames .= '* ';
$inuse = true;
}
$questionnames .= get_field('question', 'name', 'id', $key) . '<br />';
}
}
if (!$questionlist) {
// no questions were selected
redirect($pageurl->out());
}
$questionlist = rtrim($questionlist, ',');
// Add an explanation about questions in use
if ($inuse) {
$questionnames .= '<br />' . get_string('questionsinuse', 'quiz');
}
notice_yesno(get_string("deletequestionscheck", "quiz", $questionnames), $pageurl->out_action(), $pageurl->out(true), array('deleteselected' => $questionlist, 'confirm' => md5($questionlist)), $pageurl->params(), 'post', 'get');
echo '</td></tr>';
echo '</table>';
print_footer($COURSE);
exit;
}
// starts with category selection form
print_box_start('generalbox questionbank');
print_heading(get_string('questionbank', 'question'), '', 2);
question_category_form($contexts->having_one_edit_tab_cap($tabname), $pageurl, $cat, $recurse, $showhidden, $showquestiontext);
// continues with list of questions
question_list($contexts->having_one_edit_tab_cap($tabname), $pageurl, $cat, isset($cm) ? $cm : null, $recurse, $page, $perpage, $showhidden, $sortorder, $sortorderdecoded, $showquestiontext, $contexts->having_cap('moodle/question:add'));
print_box_end();
}
开发者ID:edwinphillips,< |
请发表评论