本文整理汇总了PHP中print_string函数的典型用法代码示例。如果您正苦于以下问题:PHP print_string函数的具体用法?PHP print_string怎么用?PHP print_string使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了print_string函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: view
function view()
{
global $USER, $OUTPUT, $DB, $CFG;
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
echo $OUTPUT->box_start('generalbox boxaligncenter', 'intro');
print_string('notavailableyet', 'assignment');
echo $OUTPUT->box_end();
} else {
$this->view_intro();
}
$this->view_dates();
$coversheet_filename = false;
$coversheet_url = false;
$fs = get_file_storage();
$files = $fs->get_area_files($this->context->id, 'mod_assignment', 'coversheet', false, '', false);
if (!empty($files)) {
$coversheet_filename = array_shift($files);
$coversheet_filename = $coversheet_filename->get_filename();
$coversheet_url = file_encode_url($CFG->wwwroot . '/pluginfile.php', '/' . $this->context->id . '/mod_assignment/coversheet/0/' . $coversheet_filename);
}
if (has_capability('mod/assignment:submit', $this->context)) {
$submission = $this->get_submission($USER->id);
$filecount = $submission ? $this->count_user_files($submission->id) : 0;
$this->view_feedback();
$this->view_final_submission();
if ($this->is_finalized($submission)) {
echo $OUTPUT->heading(get_string('submission', 'assignment'), 3);
} else {
echo $OUTPUT->heading(get_string('submissiondraft', 'assignment'), 3);
if ($coversheet_filename) {
echo '<p>' . get_string('coversheetnotice', 'assignment_uploadpdf') . ': ';
echo '<a href="' . $coversheet_url . '" target="_blank">' . $coversheet_filename . '</a></p>';
}
}
if ($filecount and $submission) {
echo $OUTPUT->box($this->print_user_files($USER->id, true), 'generalbox boxaligncenter', 'userfiles');
} else {
if ($this->is_finalized($submission)) {
echo $OUTPUT->box(get_string('nofiles', 'assignment'), 'generalbox boxaligncenter nofiles', 'userfiles');
} else {
echo $OUTPUT->box(get_string('nofilesyet', 'assignment'), 'generalbox boxaligncenter nofiles', 'userfiles');
}
}
$this->view_upload_form();
if ($this->notes_allowed()) {
echo $OUTPUT->heading(get_string('notes', 'assignment'), 3);
$this->view_notes();
}
} else {
if ($coversheet_filename) {
echo '<p>' . get_string('coversheetnotice', 'assignment_uploadpdf') . ': ';
echo '<a href="' . $coversheet_url . '" target="_blank">' . $coversheet_filename . '</a></p>';
}
}
$this->view_footer();
}
开发者ID:margeauxphillips,项目名称:moodle-uploadpdf,代码行数:60,代码来源:assignment.class.php
示例2: glossary_show_entry_entrylist
function glossary_show_entry_entrylist($course, $cm, $glossary, $entry, $mode = '', $hook = '', $printicons = 1, $aliases = true)
{
global $USER, $OUTPUT;
$return = false;
echo '<table class="glossarypost entrylist" cellspacing="0">';
echo '<tr valign="top">';
echo '<td class="entry">';
if ($entry) {
glossary_print_entry_approval($cm, $entry, $mode);
$anchortagcontents = glossary_print_entry_concept($entry, true);
$link = "/mod/glossary/showentry.php?courseid={$course->id}&eid={$entry->id}&displayformat=dictionary";
$action = new popup_action('click', $link . '&popup=1', 'entry', array('title' => 'entry', 'width' => 600, 'height' => 450));
$anchor = $OUTPUT->action_link($link, $anchortagcontents, $action);
echo "<div class=\"concept\">{$anchor}</div> ";
echo '</td><td align="right" class="entrylowersection">';
if ($printicons) {
glossary_print_entry_icons($course, $cm, $glossary, $entry, $mode, $hook, 'print');
}
if (!empty($entry->rating)) {
echo '<br />';
echo '<span class="ratings">';
$return = glossary_print_entry_ratings($course, $entry);
echo '</span>';
}
echo '<br />';
} else {
echo '<div style="text-align:center">';
print_string('noentry', 'glossary');
echo '</div>';
}
echo '</td></tr>';
echo "</table>\n";
return $return;
}
开发者ID:vuchannguyen,项目名称:web,代码行数:34,代码来源:entrylist_format.php
示例3: block_exabis_eportfolio_print_extcomments
function block_exabis_eportfolio_print_extcomments($itemid)
{
$stredit = get_string('edit');
$strdelete = get_string('delete');
$comments = get_records("block_exabeporitemcomm", "itemid", $itemid, 'timemodified DESC');
if (!$comments) {
return;
}
foreach ($comments as $comment) {
$user = get_record('user', 'id', $comment->userid);
echo '<table cellspacing="0" class="forumpost blogpost blog" width="100%">';
echo '<tr class="header"><td class="picture left">';
print_user_picture($comment->userid, SITEID, $user->picture);
echo '</td>';
echo '<td class="topic starter"><div class="author">';
$fullname = fullname($user, $comment->userid);
$by = new object();
$by->name = $fullname;
$by->date = userdate($comment->timemodified);
print_string('bynameondate', 'forum', $by);
echo '</div></td></tr>';
echo '<tr><td class="left side">';
echo '</td><td class="content">' . "\n";
echo format_text($comment->entry);
echo '</td></tr></table>' . "\n\n";
}
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:27,代码来源:externlib.php
示例4: glossary_show_entry_entrylist
function glossary_show_entry_entrylist($course, $cm, $glossary, $entry, $mode = '', $hook = '', $printicons = 1, $aliases = true)
{
global $USER, $OUTPUT;
$return = false;
echo '<table class="glossarypost entrylist" cellspacing="0">';
echo '<tr valign="top">';
echo '<td class="entry">';
if ($entry) {
glossary_print_entry_approval($cm, $entry, $mode);
$anchortagcontents = glossary_print_entry_concept($entry, true);
$link = new moodle_url('/mod/glossary/showentry.php', array('courseid' => $course->id, 'eid' => $entry->id, 'displayformat' => 'dictionary'));
$anchor = html_writer::link($link, $anchortagcontents);
echo "<div class=\"concept\">{$anchor}</div> ";
echo '</td><td align="right" class="entrylowersection">';
if ($printicons) {
glossary_print_entry_icons($course, $cm, $glossary, $entry, $mode, $hook, 'print');
}
if (!empty($entry->rating)) {
echo '<br />';
echo '<span class="ratings">';
$return = glossary_print_entry_ratings($course, $entry);
echo '</span>';
}
echo '<br />';
} else {
echo '<div style="text-align:center">';
print_string('noentry', 'glossary');
echo '</div>';
}
echo '</td></tr>';
echo "</table>\n";
return $return;
}
开发者ID:nmicha,项目名称:moodle,代码行数:33,代码来源:entrylist_format.php
示例5: glossary_show_entry_entrylist
function glossary_show_entry_entrylist($course, $cm, $glossary, $entry, $mode = '', $hook = '', $printicons = 1, $ratings = NULL, $aliases = true)
{
global $USER;
$return = false;
echo '<table class="glossarypost entrylist" cellspacing="0">';
echo '<tr valign="top">';
echo '<td class="entry">';
if ($entry) {
glossary_print_entry_approval($cm, $entry, $mode);
echo "<span class=\"concept\"><a href=\"showentry.php?courseid={$course->id}&eid={$entry->id}&displayformat=dictionary\" target=\"_blank\" onClick=\"return openpopup('/mod/glossary/showentry.php?courseid={$course->id}&eid={$entry->id}&displayformat=dictionary', 'entry', 'menubar=0,location=0,scrollbars,resizable,width=600,height=450', 0);\">";
glossary_print_entry_concept($entry);
echo '</a></span> ';
echo '</td><td align="right" class="entrylowersection">';
if ($printicons) {
glossary_print_entry_icons($course, $cm, $glossary, $entry, $mode, $hook, 'print');
}
if ($ratings) {
echo '<br />';
echo '<span class="ratings">';
$return = glossary_print_entry_ratings($course, $entry, $ratings);
echo '</span>';
}
echo '<br />';
} else {
echo '<div style="text-align:center">';
print_string('noentry', 'glossary');
echo '</div>';
}
echo '</td></tr>';
echo "</table>\n";
return $return;
}
开发者ID:BackupTheBerlios,项目名称:samouk-svn,代码行数:32,代码来源:entrylist_format.php
示例6: glossary_show_entry_fullwithoutauthor
function glossary_show_entry_fullwithoutauthor($course, $cm, $glossary, $entry, $mode = "", $hook = "", $printicons = 1, $ratings = NULL, $aliases = true)
{
global $CFG, $USER;
$return = false;
if ($entry) {
echo '<table class="glossarypost fullwithoutauthor" cellspacing="0">';
echo '<tr valign="top">';
echo '<th class="entryheader">';
echo '<div class="concept">';
glossary_print_entry_concept($entry);
echo '</div>';
echo '<span class="time">(' . get_string('lastedited') . ': ' . userdate($entry->timemodified) . ')</span>';
echo '</th>';
echo '<td class="entryattachment">';
glossary_print_entry_approval($cm, $entry, $mode);
glossary_print_entry_attachment($entry, $cm, 'html', 'right');
echo '</td>';
echo '</tr>';
echo '<tr valign="top">';
echo '<td width="100%" colspan="2" class="entry">';
glossary_print_entry_definition($entry, $glossary, $cm);
echo '</td></tr>';
echo '<tr valign="top"><td colspan="2" class="entrylowersection">';
$return = glossary_print_entry_lower_section($course, $cm, $glossary, $entry, $mode, $hook, $printicons, $ratings, $aliases);
echo ' ';
echo '</td></tr>';
echo "</table>\n";
} else {
echo '<center>';
print_string('noentry', 'glossary');
echo '</center>';
}
return $return;
}
开发者ID:ajv,项目名称:Offline-Caching,代码行数:34,代码来源:fullwithoutauthor_format.php
示例7: showform
function showform()
{
$id = required_param('id', PARAM_NUMBER);
// action
?>
<form name="form" method="post" action="create.php">
<center>
<table cellpadding="5">
<tr valign="top">
<td align="right"><b><?php
echo get_string('sudoku_create_count', 'game');
?>
:</b></td>
<td>
<input type="text" name="count" size="6" value="2" /><br>
</td>
</tr>
<tr><td colspan=2><center><br><input type="submit" value="<?php
print_string('sudoku_create_start', 'game');
?>
" /></td></tr>
</table>
<input type="hidden" name=action value="create" >
<input type="hidden" name=level1 value="1" >
<input type="hidden" name=level2 value="10" >
<input type="hidden" name=id value="<?php
echo $id;
?>
" />
</form>
<?php
}
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:33,代码来源:create.php
示例8: glossary_show_entry_faq
function glossary_show_entry_faq($course, $cm, $glossary, $entry, $mode = "", $hook = "", $printicons = 1, $aliases = true)
{
global $USER;
if ($entry) {
echo '<table class="glossarypost faq" cellspacing="0">';
echo '<tr valign="top">';
echo '<th class="entryheader">';
$entry->course = $course->id;
echo '<div class="concept">' . get_string('question', 'glossary') . ': ';
glossary_print_entry_concept($entry);
echo '</div>';
echo '<span class="time">(' . get_string('lastedited') . ': ' . userdate($entry->timemodified) . ')</span>';
echo '</th>';
echo '<td class="entryattachment">';
glossary_print_entry_approval($cm, $entry, $mode);
echo '</td>';
echo '</tr>';
echo "\n<tr>";
echo '<td colspan="2" class="entry">';
echo '<b>' . get_string('answer', 'glossary') . ':</b> ';
glossary_print_entry_definition($entry, $glossary, $cm);
glossary_print_entry_attachment($entry, $cm, 'html');
echo '</td></tr>';
echo '<tr valign="top"><td colspan="3" class="entrylowersection">';
glossary_print_entry_lower_section($course, $cm, $glossary, $entry, $mode, $hook, $printicons, $aliases);
echo '</td></tr></table>';
} else {
echo '<div style="text-align:center">';
print_string('noentry', 'glossary');
echo '</div>';
}
}
开发者ID:evltuma,项目名称:moodle,代码行数:32,代码来源:faq_format.php
示例9: view
function view() {
global $USER, $OUTPUT;
require_capability('mod/assignment:view', $this->context);
$cansubmit = has_capability('mod/assignment:submit', $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) // grading user can see it anytime
and $this->assignment->var3) { // force hiding before available date
echo $OUTPUT->box_start('generalbox boxaligncenter', 'intro');
print_string('notavailableyet', 'assignment');
echo $OUTPUT->box_end();
} else {
$this->view_intro();
}
$this->view_dates();
if (is_enrolled($this->context, $USER)) {
if ($submission = $this->get_submission($USER->id)) {
$filecount = $this->count_user_files($submission->id);
} else {
$filecount = 0;
}
if ($cansubmit or !empty($filecount)) { //if a user has submitted files using a previous role we should still show the files
$this->view_feedback();
if (!$this->drafts_tracked() or !$this->isopen() or $this->is_finalized($submission)) {
echo $OUTPUT->heading(get_string('submission', 'assignment'), 3);
} else {
echo $OUTPUT->heading(get_string('submissiondraft', 'assignment'), 3);
}
if ($filecount and $submission) {
echo $OUTPUT->box($this->print_user_files($USER->id, true), 'generalbox boxaligncenter', 'userfiles');
} else {
if (!$this->isopen() or $this->is_finalized($submission)) {
echo $OUTPUT->box(get_string('nofiles', 'assignment'), 'generalbox boxaligncenter nofiles', 'userfiles');
} else {
echo $OUTPUT->box(get_string('nofilesyet', 'assignment'), 'generalbox boxaligncenter nofiles', 'userfiles');
}
}
$this->view_upload_form();
if ($this->notes_allowed()) {
echo $OUTPUT->heading(get_string('notes', 'assignment'), 3);
$this->view_notes();
}
$this->view_final_submission();
}
}
$this->view_footer();
}
开发者ID:JP-Git,项目名称:moodle,代码行数:59,代码来源:assignment.class.php
示例10: display
function display()
{
global $CFG;
$formatoptions = new object();
$formatoptions->noclean = true;
/// Are we displaying the course blocks?
if ($this->resource->options == 'showblocks') {
parent::display_course_blocks_start();
if (trim(strip_tags($this->resource->alltext))) {
echo format_text($this->resource->alltext, FORMAT_MOODLE, $formatoptions, $this->course->id);
}
parent::display_course_blocks_end();
} else {
/// Set up generic stuff first, including checking for access
parent::display();
/// Set up some shorthand variables
$cm = $this->cm;
$course = $this->course;
$resource = $this->resource;
$pagetitle = strip_tags($course->shortname . ': ' . format_string($resource->name));
$inpopup = optional_param('inpopup', '', PARAM_BOOL);
if ($resource->popup) {
if ($inpopup) {
/// Popup only
add_to_log($course->id, "resource", "view", "view.php?id={$cm->id}", $resource->id, $cm->id);
print_header();
print_simple_box(format_text($resource->alltext, $resource->reference, $formatoptions, $course->id), "center", "", "", "20");
print_footer($course);
} else {
/// Make a page and a pop-up window
print_header($pagetitle, $course->fullname, "{$this->navigation} " . format_string($resource->name), "", "", true, update_module_button($cm->id, $course->id, $this->strresource), navmenu($course, $cm));
echo "\n<script type=\"text/javascript\">";
echo "\n//<![CDATA[\n";
echo "openpopup('/mod/resource/view.php?inpopup=true&id={$cm->id}','resource{$resource->id}','{$resource->popup}');\n";
echo "\n//]]>\n";
echo '</script>';
if (trim(strip_tags($resource->summary))) {
print_simple_box(format_text($resource->summary, FORMAT_MOODLE, $formatoptions, $course->id), "center");
}
$link = "<a href=\"{$CFG->wwwroot}/mod/resource/view.php?inpopup=true&id={$cm->id}\" onclick=\"this.target='resource{$resource->id}'; return openpopup('/mod/resource/view.php?inpopup=true&id={$cm->id}', 'resource{$resource->id}','{$resource->popup}');\">" . format_string($resource->name, true) . "</a>";
echo '<div class="popupnotice">';
print_string('popupresource', 'resource');
echo '<br />';
print_string('popupresourcelink', 'resource', $link);
echo '</div>';
print_footer($course);
}
} else {
/// not a popup at all
add_to_log($course->id, "resource", "view", "view.php?id={$cm->id}", $resource->id, $cm->id);
print_header($pagetitle, $course->fullname, "{$this->navigation} " . format_string($resource->name), "", "", true, update_module_button($cm->id, $course->id, $this->strresource), navmenu($course, $cm));
print_simple_box(format_text($resource->alltext, $resource->reference, $formatoptions, $course->id), "center", "", "", "20");
$strlastmodified = get_string("lastmodified");
echo "<div class=\"modified\">{$strlastmodified}: " . userdate($resource->timemodified) . "</div>";
print_footer($course);
}
}
}
开发者ID:veritech,项目名称:pare-project,代码行数:58,代码来源:resource.class.php
示例11: saml_error
function saml_error($err, $urltogo = false, $logfile = '')
{
global $CFG, $PAGE, $OUTPUT;
if (!isset($CFG->debugdisplay) || !$CFG->debugdisplay) {
$debug = false;
} else {
$debug = true;
}
if ($urltogo != false) {
$site = get_site();
if ($site === false || !isset($site->fullname)) {
$site_name = '';
} else {
$site_name = $site->fullname;
}
$PAGE->set_title($site_name . ':Error SAML Login');
echo $OUTPUT->header();
echo '<div style="margin:20px;font-weight: bold; color: red;">';
}
if (is_array($err)) {
foreach ($err as $key => $messages) {
if (!is_array($messages)) {
if ($urltogo != false && ($debug || $key == 'course_enrollment')) {
echo $messages;
}
$msg = 'Moodle SAML module: ' . $key . ': ' . $messages;
log_saml_error($msg, $logfile);
} else {
foreach ($messages as $message) {
if ($urltogo != false && ($debug || $key == 'course_enrollment')) {
echo $message . '<br>';
}
$msg = 'Moodle SAML module: ' . $key . ': ' . $message;
log_saml_error($msg, $logfile);
}
}
echo '<br>';
}
} else {
if ($urltogo != false) {
echo $err;
}
$msg = 'Moodle SAML module: login: ' . $err;
log_saml_error($msg, $logfile);
}
if ($urltogo != false) {
echo '</div>';
$OUTPUT->continue_button($urltogo);
if ($debug) {
print_string("auth_saml_disable_debugdisplay", "auth_saml");
}
$OUTPUT->footer();
exit;
}
}
开发者ID:blionut,项目名称:elearning,代码行数:55,代码来源:error.php
示例12: glossary_show_entry_encyclopedia
function glossary_show_entry_encyclopedia($course, $cm, $glossary, $entry, $mode = '', $hook = '', $printicons = 1, $ratings = NULL, $aliases = true)
{
global $CFG, $USER, $DB;
$user = $DB->get_record('user', array('id' => $entry->userid));
$strby = get_string('writtenby', 'glossary');
$return = false;
if ($entry) {
echo '<table class="glossarypost encyclopedia" cellspacing="0">';
echo '<tr valign="top">';
echo '<td class="left picture">';
print_user_picture($user, $course->id, $user->picture);
echo '</td>';
echo '<th class="entryheader">';
echo '<div class="concept">';
glossary_print_entry_concept($entry);
echo '</div>';
$fullname = fullname($user);
$by = new object();
$by->name = '<a href="' . $CFG->wwwroot . '/user/view.php?id=' . $user->id . '&course=' . $course->id . '">' . $fullname . '</a>';
$by->date = userdate($entry->timemodified);
echo '<span class="author">' . get_string('bynameondate', 'forum', $by) . '</span>';
echo '</th>';
echo '<td class="entryapproval">';
glossary_print_entry_approval($cm, $entry, $mode);
echo '</td>';
echo '</tr>';
echo '<tr valign="top">';
echo '<td class="left side" rowspan="2"> </td>';
echo '<td colspan="2" class="entry">';
if ($entry->attachment) {
$entry->course = $course->id;
if (strlen($entry->definition) % 2) {
$align = 'right';
} else {
$align = 'left';
}
glossary_print_entry_attachment($entry, $cm, null, $align, false);
}
glossary_print_entry_definition($entry, $glossary, $cm);
if ($printicons or $ratings or $aliases) {
echo '</td></tr>';
echo '<tr>';
echo '<td colspan="2" class="entrylowersection">';
$return = glossary_print_entry_lower_section($course, $cm, $glossary, $entry, $mode, $hook, $printicons, $ratings, $aliases);
echo ' ';
}
echo '</td></tr>';
echo "</table>\n";
} else {
echo '<div style="text-align:center">';
print_string('noentry', 'glossary');
echo '</div>';
}
return $return;
}
开发者ID:nicolasconnault,项目名称:moodle2.0,代码行数:55,代码来源:encyclopedia_format.php
示例13: brainstorm_user_complete
function brainstorm_user_complete($course, $user, $mod, $brainstorm)
{
if ($responses = brainstorm_get_responses($brainstorm->id, $user->id, 0, false)) {
$responses_values = array_values($responses);
/// printing last entered response for that user
$result->info = '"' . $responses_values[count($responses_values) - 1]->response . '"';
$result->time = $responses_values[count($responses_values) - 1]->timemodified;
echo get_string('responded', 'brainstorm') . ": {$result->info} , last updated " . userdate($result->time);
} else {
print_string('notresponded', 'brainstorm');
}
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:12,代码来源:lib.php
示例14: lightboxgallery_user_complete
function lightboxgallery_user_complete($course, $user, $mod, $resource)
{
if ($logs = get_records_select('log', "userid='{$user->id}' AND module='lightboxgallery' AND action='view' AND info='{$resource->id}'", 'time ASC')) {
$numviews = count($logs);
$lastlog = array_pop($logs);
$strmostrecently = get_string('mostrecently');
$strnumviews = get_string('numviews', '', $numviews);
echo $strnumviews . ' - ' . $strmostrecently . ' ' . userdate($lastlog->time);
} else {
print_string('neverseen', 'resource');
}
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:12,代码来源:lib.php
示例15: choice_user_complete
/**
* @global object
* @param object $course
* @param object $user
* @param object $mod
* @param object $choice
* @return string|void
*/
function choice_user_complete($course, $user, $mod, $choice)
{
global $DB;
if ($answer = $DB->get_record('choice_answers', array("choiceid" => $choice->id, "userid" => $user->id))) {
$result = new stdClass();
$result->info = "'" . format_string(choice_get_option_text($choice, $answer->optionid)) . "'";
$result->time = $answer->timemodified;
echo get_string("answered", "choice") . ": {$result->info}. " . get_string("updated", '', userdate($result->time));
} else {
print_string("notanswered", "choice");
}
}
开发者ID:antoniorodrigues,项目名称:redes-digitais,代码行数:20,代码来源:lib.php
示例16: show_edit_radio
function show_edit_radio($item, $usehtmleditor = false)
{
$item->presentation = empty($item->presentation) ? '' : $item->presentation;
?>
<table>
<tr>
<th colspan="2"><?php
print_string('radiobutton', 'feedback');
?>
(<input type="checkbox" name="required" value="1" <?php
$item->required = isset($item->required) ? $item->required : 0;
echo $item->required == 1 ? 'checked="checked"' : '';
?>
/> <?php
print_string('required', 'feedback');
?>
)
</th>
</tr>
<tr>
<td><?php
print_string('item_name', 'feedback');
?>
</td>
<td><input type="text" id="itemname" name="itemname" size="40" maxlength="255" value="<?php
echo isset($item->name) ? stripslashes_safe($item->name) : '';
?>
" /></td>
</tr>
<tr>
<td>
<?php
print_string('radio_values', 'feedback');
?>
<?php
print_string('use_one_line_for_each_value', 'feedback');
?>
</td>
<td>
<?php
$itemvalues = str_replace('|', "\n", stripslashes_safe($item->presentation));
?>
<textarea name="itemvalues" cols="30" rows="5"><?php
echo $itemvalues;
?>
</textarea>
</td>
</tr>
</table>
<?php
}
开发者ID:stokekld,项目名称:TemasMoodleMineria,代码行数:51,代码来源:lib.php
示例17: 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();
}
开发者ID:remotelearner,项目名称:elis.alfresco,代码行数:55,代码来源:assignment.class.php
示例18: choice_user_complete
/**
* Callback for the "Complete" report - prints the activity summary for the given user
*
* @param object $course
* @param object $user
* @param object $mod
* @param object $choice
*/
function choice_user_complete($course, $user, $mod, $choice)
{
global $DB;
if ($answers = $DB->get_records('choice_answers', array("choiceid" => $choice->id, "userid" => $user->id))) {
$info = [];
foreach ($answers as $answer) {
$info[] = "'" . format_string(choice_get_option_text($choice, $answer->optionid)) . "'";
}
core_collator::asort($info);
echo get_string("answered", "choice") . ": " . join(', ', $info) . ". " . get_string("updated", '', userdate($answer->timemodified));
} else {
print_string("notanswered", "choice");
}
}
开发者ID:jackdaniels79,项目名称:moodle,代码行数:22,代码来源:lib.php
示例19: action_default
/**
* List the certificates available to be printed.
* @return unknown_type
*/
function action_default()
{
global $CFG, $USER, $CURMAN;
// This is for a Moodle user, so get the Curriculum user id.
$cuserid = cm_get_crlmuserid($USER->id);
$curasses = curriculumstudent::get_completed_for_user($cuserid);
if (count($curasses) == 0) {
print_string('certificates_none_earned', 'block_curr_admin');
return;
}
print_string('certificates_earned', 'block_curr_admin');
echo "<UL>\n";
foreach ($curasses as $curass) {
echo "<LI><a href=\"certificate.php?id={$curass->id}\">{$curass->curriculum->name}</a>\n";
}
echo "</UL>\n";
}
开发者ID:remotelearner,项目名称:elis.cm,代码行数:21,代码来源:certificatelistpage.class.php
示例20: view
/**
* @param $course
* @param $cm
* @param $forum
* @param context_module $context
* @author Mark Nielsen
*/
public function view($course, $cm, $forum, context_module $context)
{
global $USER, $DB, $OUTPUT;
require_once __DIR__ . '/lib/discussion/sort.php';
$config = get_config('hsuforum');
$mode = optional_param('mode', 0, PARAM_INT);
// Display mode (for single forum)
$page = optional_param('page', 0, PARAM_INT);
// which page to show
$forumicon = "<img src='" . $OUTPUT->pix_url('icon', 'hsuforum') . "' alt='' class='iconlarge activityicon'/> ";
echo '<div id="hsuforum-header"><h2>' . $forumicon . format_string($forum->name) . '</h2>';
if (!empty($forum->intro)) {
echo '<div class="hsuforum_introduction">' . format_module_intro('hsuforum', $forum, $cm->id) . '</div>';
}
echo "</div>";
// Update activity group mode changes here.
groups_get_activity_group($cm, true);
$dsort = hsuforum_lib_discussion_sort::get_from_session($forum, $context);
$dsort->set_key(optional_param('dsortkey', $dsort->get_key(), PARAM_ALPHA));
hsuforum_lib_discussion_sort::set_to_session($dsort);
if (!empty($forum->blockafter) && !empty($forum->blockperiod)) {
$a = new stdClass();
$a->blockafter = $forum->blockafter;
$a->blockperiod = get_string('secondstotime' . $forum->blockperiod);
echo $OUTPUT->notification(get_string('thisforumisthrottled', 'hsuforum', $a));
}
if ($forum->type == 'qanda' && !has_capability('moodle/course:manageactivities', $context)) {
echo $OUTPUT->notification(get_string('qandanotify', 'hsuforum'));
}
switch ($forum->type) {
case 'eachuser':
if (hsuforum_user_can_post_discussion($forum, null, -1, $cm)) {
echo '<p class="mdl-align">';
print_string("allowsdiscussions", "hsuforum");
echo '</p>';
}
// Fall through to following cases.
// Fall through to following cases.
case 'blog':
default:
hsuforum_print_latest_discussions($course, $forum, -1, $dsort->get_sort_sql(), -1, -1, $page, $config->manydiscussions, $cm);
break;
}
}
开发者ID:cdsmith-umn,项目名称:moodle-mod_hsuforum,代码行数:51,代码来源:renderer.php
注:本文中的print_string函数示例整理自Github/MSDocs等源码及 |
请发表评论