function wiki_print_page_content($page, $context, $subwikiid) { global $OUTPUT, $CFG; if ($page->timerendered + WIKI_REFRESH_CACHE_TIME < time()) { $content = wiki_refresh_cachedcontent($page); $page = $content['page']; } if (isset($content)) { $box = ''; foreach ($content['sections'] as $s) { $box .= '<p>' . get_string('repeatedsection', 'wiki', $s) . '</p>'; } if (!empty($box)) { echo $OUTPUT->box($box); } } $html = file_rewrite_pluginfile_urls($page->cachedcontent, 'pluginfile.php', $context->id, 'mod_wiki', 'attachments', $subwikiid); $html = format_text($html, FORMAT_MOODLE, array('overflowdiv' => true, 'allowid' => true)); echo $OUTPUT->box($html); echo $OUTPUT->tag_list(core_tag_tag::get_item_tags('mod_wiki', 'wiki_pages', $page->id), null, 'wiki-tags'); wiki_increment_pageviews($page); }
function wiki_print_page_content($page, $context, $subwikiid) { global $OUTPUT, $CFG; if ($page->timerendered + WIKI_REFRESH_CACHE_TIME < time()) { $content = wiki_refresh_cachedcontent($page); $page = $content['page']; } if (isset($content)) { $box = ''; foreach ($content['sections'] as $s) { $box .= '<p>' . get_string('repeatedsection', 'wiki', $s) . '</p>'; } if (!empty($box)) { echo $OUTPUT->box($box); } } $html = file_rewrite_pluginfile_urls($page->cachedcontent, 'pluginfile.php', $context->id, 'mod_wiki', 'attachments', $subwikiid); $html = format_text($html, FORMAT_MOODLE, array('overflowdiv' => true)); echo $OUTPUT->box($html); if (!empty($CFG->usetags)) { $tags = tag_get_tags_array('wiki_pages', $page->id); echo $OUTPUT->container_start('wiki-tags'); echo '<span class="wiki-tags-title">' . get_string('tags') . ': </span>'; $links = array(); foreach ($tags as $tagid => $tag) { $url = new moodle_url('/tag/index.php', array('tag' => $tag)); $links[] = html_writer::link($url, $tag, array('title' => get_string('tagtitle', 'wiki', $tag))); } echo join($links, ", "); echo $OUTPUT->container_end(); } wiki_increment_pageviews($page); }
function wiki_print_page_content($page, $context, $subwikiid) { global $OUTPUT, $CFG; if ($page->timerendered + WIKI_REFRESH_CACHE_TIME < time()) { $content = wiki_refresh_cachedcontent($page); $page = $content['page']; } if (isset($content)) { $box = ''; foreach ($content['sections'] as $s) { $box .= '<p>' . get_string('repeatedsection', 'wiki', $s) . '</p>'; } if (!empty($box)) { echo $OUTPUT->box($box); } } $html = file_rewrite_pluginfile_urls($page->cachedcontent, 'pluginfile.php', $context->id, 'mod_wiki', 'attachments', $subwikiid); $html = format_text($html, FORMAT_MOODLE, array('overflowdiv' => true)); echo $OUTPUT->box($html); if (!empty($CFG->usetags)) { $tags = tag_get_tags_array('wiki_pages', $page->id); echo '<p class="wiki-tags"><span>Tags: </span>' . join($tags, ", ") . '</p>'; } wiki_increment_pageviews($page); }