本文整理汇总了PHP中glossary_print_attachments函数的典型用法代码示例。如果您正苦于以下问题:PHP glossary_print_attachments函数的具体用法?PHP glossary_print_attachments怎么用?PHP glossary_print_attachments使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了glossary_print_attachments函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: glossary_print_entry_attachment
/**
* @todo Document this function
*/
function glossary_print_entry_attachment($entry, $cm, $format=NULL, $align="right", $insidetable=true) {
/// valid format values: html : Return the HTML link for the attachment as an icon
/// text : Return the HTML link for tha attachment as text
/// blank : Print the output to the screen
if ($entry->attachment) {
if ($insidetable) {
echo "<table border=\"0\" width=\"100%\" align=\"$align\"><tr><td align=\"$align\" nowrap=\"nowrap\">\n";
}
echo glossary_print_attachments($entry, $cm, $format, $align);
if ($insidetable) {
echo "</td></tr></table>\n";
}
}
}
示例2: glossary_print_entry_attachment
function glossary_print_entry_attachment($entry, $format = NULL, $align = "right", $insidetable = true)
{
/// valid format values: html : Return the HTML link for the attachment as an icon
/// text : Return the HTML link for tha attachment as text
/// blank : Print the output to the screen
if ($entry->attachment) {
$glossary = get_record("glossary", "id", $entry->glossaryid);
$entry->course = $glossary->course;
//used inside print_attachment
if ($insidetable) {
echo "<table border=\"0\" width=\"100%\" align=\"{$align}\"><tr><td align=\"{$align}\" nowrap=\"nowrap\">\n";
}
echo glossary_print_attachments($entry, $format, $align);
if ($insidetable) {
echo "</td></tr></table>\n";
}
}
}
示例3: glossary_print_entry_attachment
/**
* Print the list of attachments for this glossary entry
*
* @param object $entry
* @param object $cm The coursemodule
* @param string $format The format for this view (html, or text)
* @param string $unused1 This parameter is no longer used
* @param string $unused2 This parameter is no longer used
*/
function glossary_print_entry_attachment($entry, $cm, $format = null, $unused1 = null, $unused2 = null) {
// Valid format values: html: The HTML link for the attachment is an icon; and
// text: The HTML link for the attachment is text.
if ($entry->attachment) {
echo '<div class="attachments">';
echo glossary_print_attachments($entry, $cm, $format);
echo '</div>';
}
if ($unused1) {
debugging('The align parameter is deprecated, please use appropriate CSS instead', DEBUG_DEVELOPER);
}
if ($unused2 !== null) {
debugging('The insidetable parameter is deprecated, please use appropriate CSS instead', DEBUG_DEVELOPER);
}
}
示例4: unset
if (!has_capability('mod/glossary:approve', $context)) {
unset($entries[$key]);
continue;
}
}
// Make sure entry is not autolinking itself.
$GLOSSARY_EXCLUDEENTRY = $entry->id;
$context = context_module::instance($entry->cmid);
$definition = file_rewrite_pluginfile_urls($entry->definition, 'pluginfile.php', $context->id, 'mod_glossary', 'entry', $entry->id);
$options = new stdClass();
$options->para = false;
$options->trusted = $entry->definitiontrust;
$options->context = $context;
$entries[$key]->definition = format_text($definition, $entry->definitionformat, $options);
$entries[$key]->attachments = '';
if (!empty($entries[$key]->attachment)) {
$attachments = glossary_print_attachments($entry, $cm, 'html');
$entries[$key]->attachments = html_writer::tag('p', $attachments);
}
$entries[$key]->footer = "<p style=\"text-align:right\">» <a href=\"{$CFG->wwwroot}/mod/glossary/view.php?g={$entry->glossaryid}\">" . format_string($entry->glossaryname, true) . "</a></p>";
$event = \mod_glossary\event\entry_viewed::create(array('objectid' => $entry->id, 'context' => $modinfo->cms[$entry->cmid]->context));
$event->add_record_snapshot('glossary_entries', $entry);
$event->trigger();
}
}
echo $OUTPUT->header();
$result = new stdClass();
$result->success = true;
$result->entries = $entries;
echo json_encode($result);
echo $OUTPUT->footer();