本文整理汇总了PHP中wiki_parse_content函数的典型用法代码示例。如果您正苦于以下问题:PHP wiki_parse_content函数的具体用法?PHP wiki_parse_content怎么用?PHP wiki_parse_content使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wiki_parse_content函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: wiki_refresh_cachedcontent
function wiki_refresh_cachedcontent($page, $newcontent = null)
{
global $DB;
$version = wiki_get_current_version($page->id);
if (empty($version)) {
return null;
}
if (!isset($newcontent)) {
$newcontent = $version->content;
}
$options = array('swid' => $page->subwikiid, 'pageid' => $page->id);
$parseroutput = wiki_parse_content($version->contentformat, $newcontent, $options);
$page->cachedcontent = $parseroutput['toc'] . $parseroutput['parsed_text'];
$page->timerendered = time();
$DB->update_record('wiki_pages', $page);
wiki_refresh_page_links($page, $parseroutput['link_count']);
return array('page' => $page, 'sections' => $parseroutput['repeated_sections'], 'version' => $version->version);
}
示例2: print_pretty_view
private function print_pretty_view()
{
$version = wiki_get_current_version($this->page->id);
$content = wiki_parse_content($version->contentformat, $version->content, array('printable' => true, 'swid' => $this->subwiki->id, 'pageid' => $this->page->id, 'pretty_print' => true));
$html = $content['parsed_text'];
$id = $this->subwiki->wikiid;
if ($cm = get_coursemodule_from_instance("wiki", $id)) {
$context = context_module::instance($cm->id);
$html = file_rewrite_pluginfile_urls($html, 'pluginfile.php', $context->id, 'mod_wiki', 'attachments', $this->subwiki->id);
}
echo '<div id="wiki_printable_content">';
echo format_text($html, FORMAT_HTML);
echo '</div>';
}
示例3: print_pretty_view
private function print_pretty_view() {
$version = wiki_get_current_version($this->page->id);
$content = wiki_parse_content($version->contentformat, $version->content, array('printable' => true, 'swid' => $this->subwiki->id, 'pageid' => $this->page->id, 'pretty_print' => true));
echo '<div id="wiki_printable_content">';
echo format_text($content['parsed_text'], FORMAT_HTML);
echo '</div>';
}
示例4: wiki_print_page_content
function wiki_print_page_content(&$text, &$WS)
{
global $CFG;
echo wiki_parse_content($text, $WS);
// display attached files, if any :-) (nadavkav)
if ($WS->upload_bar or $WS->dfperms['attach'] and count($WS->dfdir->content) != 0) {
//Scritp WIKI_TREE
$prop = null;
$prop->type = 'text/javascript';
if (isset($WS->dfcourse)) {
$prop->src = '../mod/wiki/editor/wiki_tree.js';
} else {
$prop->src = 'editor/wiki_tree.js';
}
wiki_script('', $prop);
wiki_print_view_uploaded($WS);
}
}