当前位置: 首页>>代码示例>>PHP>>正文


PHP ouwiki_diff_html函数代码示例

本文整理汇总了PHP中ouwiki_diff_html函数的典型用法代码示例。如果您正苦于以下问题:PHP ouwiki_diff_html函数的具体用法?PHP ouwiki_diff_html怎么用?PHP ouwiki_diff_html使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ouwiki_diff_html函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: ouwiki_get_annotations

if ($numchanges == 0) {
    $annotations = ouwiki_get_annotations($pageversion2);
    if (count($annotations) === 0) {
        $advice = get_string('diff_nochanges', 'ouwiki');
    } else {
        $advice = get_string('diff_someannotations', 'ouwiki');
    }
} else {
    $advice = get_string('advice_diff', 'ouwiki');
}
print '<p class="ouw_advice">' . $advice . ' ' . get_string('returntohistory', 'ouwiki', 'history.php?' . ouwiki_display_wiki_parameters($pagename, $subwiki, $cm)) . '</p>';
// Obtain pluginfile urls.
$pageversion1->xhtml = file_rewrite_pluginfile_urls($pageversion1->xhtml, 'pluginfile.php', $context->id, 'mod_ouwiki', 'content', $pageversion1->versionid);
$pageversion2->xhtml = file_rewrite_pluginfile_urls($pageversion2->xhtml, 'pluginfile.php', $context->id, 'mod_ouwiki', 'content', $pageversion2->versionid);
// Obtain difference between two versions
list($diff1, $diff2) = ouwiki_diff_html($pageversion1->xhtml, $pageversion2->xhtml);
// To make it look like a user object
$pageversion1->id = $pageversion1->userid;
$v1name = ouwiki_display_user($pageversion1, $course->id);
$pageversion2->id = $pageversion2->userid;
$v2name = ouwiki_display_user($pageversion2, $course->id);
// Disply the two versions
$v1 = new StdClass();
$v1->version = get_string('olderversion', 'ouwiki');
$v1->date = userdate($pageversion1->timecreated);
$v1->savedby = get_string('savedby', 'ouwiki', $v1name);
$v1->content = $diff1;
$v1->attachments = $attachdiff1;
$v2 = new StdClass();
$v2->version = get_string('olderversion', 'ouwiki');
$v2->date = userdate($pageversion2->timecreated);
开发者ID:ndunand,项目名称:moodle-mod_ouwiki,代码行数:31,代码来源:diff.php

示例2: print_diff_content

    /**
     * Given two versions of a page, prints a page displaying the differences between them.
     *
     * @global object $CFG
     * @global object $OUTPUT
     * @global object $PAGE
     */
    private function print_diff_content() {
        global $CFG, $OUTPUT, $PAGE;

        $pageid = $this->page->id;
        $total = wiki_count_wiki_page_versions($pageid) - 1;

        $oldversion = wiki_get_wiki_page_version($pageid, $this->compare);

        $newversion = wiki_get_wiki_page_version($pageid, $this->comparewith);

        if ($oldversion && $newversion) {

            $oldtext = format_text(file_rewrite_pluginfile_urls($oldversion->content, 'pluginfile.php', $this->modcontext->id, 'mod_wiki', 'attachments', $this->subwiki->id));
            $newtext = format_text(file_rewrite_pluginfile_urls($newversion->content, 'pluginfile.php', $this->modcontext->id, 'mod_wiki', 'attachments', $this->subwiki->id));
            list($diff1, $diff2) = ouwiki_diff_html($oldtext, $newtext);
            $oldversion->diff = $diff1;
            $oldversion->user = wiki_get_user_info($oldversion->userid);
            $newversion->diff = $diff2;
            $newversion->user = wiki_get_user_info($newversion->userid);

            echo $this->wikioutput->diff($pageid, $oldversion, $newversion, array('total' => $total));
        } else {
            print_error('versionerror', 'wiki');
        }
    }
开发者ID:Burick,项目名称:moodle,代码行数:32,代码来源:pagelib.php

示例3: test_diff_html

 public function test_diff_html()
 {
     list($result1, $result2, $changes) = ouwiki_diff_html($this->html1, $this->html2);
     $this->assertEquals(13, $changes);
 }
开发者ID:michaudg,项目名称:moodle-mod_ouwiki,代码行数:5,代码来源:diff_test.php


注:本文中的ouwiki_diff_html函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。