當前位置: 首頁>>代碼示例>>PHP>>正文


PHP wiki_parse_content函數代碼示例

本文整理匯總了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);
}
開發者ID:esyacelga,項目名稱:sisadmaca,代碼行數:18,代碼來源:locallib.php

示例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>';
 }
開發者ID:jackdaniels79,項目名稱:moodle,代碼行數:14,代碼來源:pagelib.php

示例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>';
    }
開發者ID:Burick,項目名稱:moodle,代碼行數:9,代碼來源:pagelib.php

示例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);
    }
}
開發者ID:hmatulis,項目名稱:RTL-BIDI-Hebrew-Moodle-Plugins,代碼行數:18,代碼來源:locallib.php


注:本文中的wiki_parse_content函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。