本文整理汇总了PHP中getRevisionInfo函数的典型用法代码示例。如果您正苦于以下问题:PHP getRevisionInfo函数的具体用法?PHP getRevisionInfo怎么用?PHP getRevisionInfo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getRevisionInfo函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: pageVersions
/**
* Returns a list of available revisions of a given wiki page
*
* @author Michael Klier <[email protected]>
*/
function pageVersions($id, $first)
{
$id = $this->resolvePageId($id);
if (auth_quickaclcheck($id) < AUTH_READ) {
throw new RemoteAccessDeniedException('You are not allowed to read this page', 111);
}
global $conf;
$versions = array();
if (empty($id)) {
throw new RemoteException('Empty page ID', 131);
}
$revisions = getRevisions($id, $first, $conf['recent'] + 1);
if (count($revisions) == 0 && $first != 0) {
$first = 0;
$revisions = getRevisions($id, $first, $conf['recent'] + 1);
}
if (count($revisions) > 0 && $first == 0) {
array_unshift($revisions, '');
// include current revision
array_pop($revisions);
// remove extra log entry
}
if (count($revisions) > $conf['recent']) {
array_pop($revisions);
// remove extra log entry
}
if (!empty($revisions)) {
foreach ($revisions as $rev) {
$file = wikiFN($id, $rev);
$time = @filemtime($file);
// we check if the page actually exists, if this is not the
// case this can lead to less pages being returned than
// specified via $conf['recent']
if ($time) {
$info = getRevisionInfo($id, $time, 1024);
if (!empty($info)) {
$data['user'] = $info['user'];
$data['ip'] = $info['ip'];
$data['type'] = $info['type'];
$data['sum'] = $info['sum'];
$data['modified'] = $this->api->toDate($info['date']);
$data['version'] = $info['date'];
array_push($versions, $data);
}
}
}
return $versions;
} else {
return array();
}
}
开发者ID:neosunchess,项目名称:dokuwiki,代码行数:56,代码来源:RemoteAPICore.php
示例2: html_diff_head
function html_diff_head($l_rev, $r_rev, $id = null, $media = false)
{
global $lang;
if ($id === null) {
global $ID;
$id = $ID;
}
$media_or_wikiFN = $media ? 'mediaFN' : 'wikiFN';
$ml_or_wl = $media ? 'ml' : 'wl';
$l_minor = $r_minor = '';
if (!$l_rev) {
$l_head = '—';
} else {
$l_info = getRevisionInfo($id, $l_rev, true, $media);
if ($l_info['user']) {
$l_user = editorinfo($l_info['user']);
if (auth_ismanager()) {
$l_user .= ' (' . $l_info['ip'] . ')';
}
} else {
$l_user = $l_info['ip'];
}
$l_user = '<span class="user">' . $l_user . '</span>';
$l_sum = $l_info['sum'] ? '<span class="sum">' . hsc($l_info['sum']) . '</span>' : '';
if ($l_info['type'] === DOKU_CHANGE_TYPE_MINOR_EDIT) {
$l_minor = 'class="minor"';
}
$l_head_title = $media ? dformat($l_rev) : $id . ' [' . dformat($l_rev) . ']';
$l_head = '<a class="wikilink1" href="' . $ml_or_wl($id, "rev={$l_rev}") . '">' . $l_head_title . '</a>' . '<br />' . $l_user . ' ' . $l_sum;
}
if ($r_rev) {
$r_info = getRevisionInfo($id, $r_rev, true, $media);
if ($r_info['user']) {
$r_user = editorinfo($r_info['user']);
if (auth_ismanager()) {
$r_user .= ' (' . $r_info['ip'] . ')';
}
} else {
$r_user = $r_info['ip'];
}
$r_user = '<span class="user">' . $r_user . '</span>';
$r_sum = $r_info['sum'] ? '<span class="sum">' . hsc($r_info['sum']) . '</span>' : '';
if ($r_info['type'] === DOKU_CHANGE_TYPE_MINOR_EDIT) {
$r_minor = 'class="minor"';
}
$r_head_title = $media ? dformat($r_rev) : $id . ' [' . dformat($r_rev) . ']';
$r_head = '<a class="wikilink1" href="' . $ml_or_wl($id, "rev={$r_rev}") . '">' . $r_head_title . '</a>' . '<br />' . $r_user . ' ' . $r_sum;
} elseif ($_rev = @filemtime($media_or_wikiFN($id))) {
$_info = getRevisionInfo($id, $_rev, true, $media);
if ($_info['user']) {
$_user = editorinfo($_info['user']);
if (auth_ismanager()) {
$_user .= ' (' . $_info['ip'] . ')';
}
} else {
$_user = $_info['ip'];
}
$_user = '<span class="user">' . $_user . '</span>';
$_sum = $_info['sum'] ? '<span class="sum">' . hsc($_info['sum']) . '</span>' : '';
if ($_info['type'] === DOKU_CHANGE_TYPE_MINOR_EDIT) {
$r_minor = 'class="minor"';
}
$r_head_title = $media ? dformat($_rev) : $id . ' [' . dformat($_rev) . ']';
$r_head = '<a class="wikilink1" href="' . $ml_or_wl($id) . '">' . $r_head_title . '</a> ' . '(' . $lang['current'] . ')' . '<br />' . $_user . ' ' . $_sum;
} else {
$r_head = '— (' . $lang['current'] . ')';
}
return array($l_head, $r_head, $l_minor, $r_minor);
}
开发者ID:nefercheprure,项目名称:dokuwiki,代码行数:69,代码来源:html.php
示例3: pageinfo
/**
* Return info about the current document as associative
* array.
*
* @author Andreas Gohr <[email protected]>
*/
function pageinfo()
{
global $ID;
global $REV;
global $USERINFO;
global $conf;
// include ID & REV not redundant, as some parts of DokuWiki may temporarily change $ID, e.g. p_wiki_xhtml
// FIXME ... perhaps it would be better to ensure the temporary changes weren't necessary
$info['id'] = $ID;
$info['rev'] = $REV;
if ($_SERVER['REMOTE_USER']) {
$info['userinfo'] = $USERINFO;
$info['perm'] = auth_quickaclcheck($ID);
$info['subscribed'] = is_subscribed($ID, $_SERVER['REMOTE_USER']);
$info['client'] = $_SERVER['REMOTE_USER'];
// if some outside auth were used only REMOTE_USER is set
if (!$info['userinfo']['name']) {
$info['userinfo']['name'] = $_SERVER['REMOTE_USER'];
}
} else {
$info['perm'] = auth_aclcheck($ID, '', null);
$info['subscribed'] = false;
$info['client'] = clientIP(true);
}
$info['namespace'] = getNS($ID);
$info['locked'] = checklock($ID);
$info['filepath'] = realpath(wikiFN($ID));
$info['exists'] = @file_exists($info['filepath']);
if ($REV) {
//check if current revision was meant
if ($info['exists'] && @filemtime($info['filepath']) == $REV) {
$REV = '';
} else {
//really use old revision
$info['filepath'] = realpath(wikiFN($ID, $REV));
$info['exists'] = @file_exists($info['filepath']);
}
}
$info['rev'] = $REV;
if ($info['exists']) {
$info['writable'] = is_writable($info['filepath']) && $info['perm'] >= AUTH_EDIT;
} else {
$info['writable'] = $info['perm'] >= AUTH_CREATE;
}
$info['editable'] = $info['writable'] && empty($info['lock']);
$info['lastmod'] = @filemtime($info['filepath']);
//load page meta data
$info['meta'] = p_get_metadata($ID);
//who's the editor
if ($REV) {
$revinfo = getRevisionInfo($ID, $REV, 1024);
} else {
$revinfo = isset($info['meta']['last_change']) ? $info['meta']['last_change'] : getRevisionInfo($ID, $info['lastmod'], 1024);
}
$info['ip'] = $revinfo['ip'];
$info['user'] = $revinfo['user'];
$info['sum'] = $revinfo['sum'];
// See also $INFO['meta']['last_change'] which is the most recent log line for page $ID.
// Use $INFO['meta']['last_change']['type']==='e' in place of $info['minor'].
if ($revinfo['user']) {
$info['editor'] = $revinfo['user'];
} else {
$info['editor'] = $revinfo['ip'];
}
// draft
$draft = getCacheName($info['client'] . $ID, '.draft');
if (@file_exists($draft)) {
if (@filemtime($draft) < @filemtime(wikiFN($ID))) {
// remove stale draft
@unlink($draft);
} else {
$info['draft'] = $draft;
}
}
return $info;
}
开发者ID:manishkhanchandani,项目名称:mkgxy,代码行数:82,代码来源:common.php
示例4: pageinfo
/**
* Return info about the current document as associative
* array.
*
* @author Andreas Gohr <[email protected]>
*/
function pageinfo()
{
global $ID;
global $REV;
global $RANGE;
global $USERINFO;
global $lang;
// include ID & REV not redundant, as some parts of DokuWiki may temporarily change $ID, e.g. p_wiki_xhtml
// FIXME ... perhaps it would be better to ensure the temporary changes weren't necessary
$info['id'] = $ID;
$info['rev'] = $REV;
// set info about manager/admin status.
$info['isadmin'] = false;
$info['ismanager'] = false;
if (isset($_SERVER['REMOTE_USER'])) {
$info['userinfo'] = $USERINFO;
$info['perm'] = auth_quickaclcheck($ID);
$info['subscribed'] = get_info_subscribed();
$info['client'] = $_SERVER['REMOTE_USER'];
if ($info['perm'] == AUTH_ADMIN) {
$info['isadmin'] = true;
$info['ismanager'] = true;
} elseif (auth_ismanager()) {
$info['ismanager'] = true;
}
// if some outside auth were used only REMOTE_USER is set
if (!$info['userinfo']['name']) {
$info['userinfo']['name'] = $_SERVER['REMOTE_USER'];
}
} else {
$info['perm'] = auth_aclcheck($ID, '', null);
$info['subscribed'] = false;
$info['client'] = clientIP(true);
}
$info['namespace'] = getNS($ID);
$info['locked'] = checklock($ID);
$info['filepath'] = fullpath(wikiFN($ID));
$info['exists'] = @file_exists($info['filepath']);
if ($REV) {
//check if current revision was meant
if ($info['exists'] && @filemtime($info['filepath']) == $REV) {
$REV = '';
} elseif ($RANGE) {
//section editing does not work with old revisions!
$REV = '';
$RANGE = '';
msg($lang['nosecedit'], 0);
} else {
//really use old revision
$info['filepath'] = fullpath(wikiFN($ID, $REV));
$info['exists'] = @file_exists($info['filepath']);
}
}
$info['rev'] = $REV;
if ($info['exists']) {
$info['writable'] = is_writable($info['filepath']) && $info['perm'] >= AUTH_EDIT;
} else {
$info['writable'] = $info['perm'] >= AUTH_CREATE;
}
$info['editable'] = $info['writable'] && empty($info['locked']);
$info['lastmod'] = @filemtime($info['filepath']);
//load page meta data
$info['meta'] = p_get_metadata($ID);
//who's the editor
if ($REV) {
$revinfo = getRevisionInfo($ID, $REV, 1024);
} else {
if (is_array($info['meta']['last_change'])) {
$revinfo = $info['meta']['last_change'];
} else {
$revinfo = getRevisionInfo($ID, $info['lastmod'], 1024);
// cache most recent changelog line in metadata if missing and still valid
if ($revinfo !== false) {
$info['meta']['last_change'] = $revinfo;
p_set_metadata($ID, array('last_change' => $revinfo));
}
}
}
//and check for an external edit
if ($revinfo !== false && $revinfo['date'] != $info['lastmod']) {
// cached changelog line no longer valid
$revinfo = false;
$info['meta']['last_change'] = $revinfo;
p_set_metadata($ID, array('last_change' => $revinfo));
}
$info['ip'] = $revinfo['ip'];
$info['user'] = $revinfo['user'];
$info['sum'] = $revinfo['sum'];
// See also $INFO['meta']['last_change'] which is the most recent log line for page $ID.
// Use $INFO['meta']['last_change']['type']===DOKU_CHANGE_TYPE_MINOR_EDIT in place of $info['minor'].
if ($revinfo['user']) {
$info['editor'] = $revinfo['user'];
} else {
$info['editor'] = $revinfo['ip'];
//.........这里部分代码省略.........
开发者ID:nextghost,项目名称:dokuwiki,代码行数:101,代码来源:common.php
示例5: html_diff
/**
* show diff
*
* @author Andreas Gohr <[email protected]>
*/
function html_diff($text = '', $intro = true)
{
require_once DOKU_INC . 'inc/DifferenceEngine.php';
global $ID;
global $REV;
global $lang;
global $conf;
// we're trying to be clever here, revisions to compare can be either
// given as rev and rev2 parameters, with rev2 being optional. Or in an
// array in rev2.
$rev1 = $REV;
if (is_array($_REQUEST['rev2'])) {
$rev1 = (int) $_REQUEST['rev2'][0];
$rev2 = (int) $_REQUEST['rev2'][1];
if (!$rev1) {
$rev1 = $rev2;
unset($rev2);
}
} else {
$rev2 = (int) $_REQUEST['rev2'];
}
if ($text) {
// compare text to the most current revision
$l_rev = '';
$l_text = rawWiki($ID, '');
$l_head = '<a class="wikilink1" href="' . wl($ID) . '">' . $ID . ' ' . strftime($conf['dformat'], @filemtime(wikiFN($ID))) . '</a> ' . $lang['current'];
$r_rev = '';
$r_text = cleanText($text);
$r_head = $lang['yours'];
} else {
if ($rev1 && $rev2) {
// two specific revisions wanted
// make sure order is correct (older on the left)
if ($rev1 < $rev2) {
$l_rev = $rev1;
$r_rev = $rev2;
} else {
$l_rev = $rev2;
$r_rev = $rev1;
}
} elseif ($rev1) {
// single revision given, compare to current
$r_rev = '';
$l_rev = $rev1;
} else {
// no revision was given, compare previous to current
$r_rev = '';
$revs = getRevisions($ID, 0, 1);
$l_rev = $revs[0];
}
// when both revisions are empty then the page was created just now
if (!$l_rev && !$r_rev) {
$l_text = '';
} else {
$l_text = rawWiki($ID, $l_rev);
}
$r_text = rawWiki($ID, $r_rev);
if (!$l_rev) {
$l_head = '—';
} else {
$l_info = getRevisionInfo($ID, $l_rev, true);
if ($l_info['user']) {
$l_user = editorinfo($l_info['user']);
if (auth_ismanager()) {
$l_user .= ' (' . $l_info['ip'] . ')';
}
} else {
$l_user = $l_info['ip'];
}
$l_user = '<span class="user">' . $l_user . '</span>';
$l_sum = $l_info['sum'] ? '<span class="sum">' . hsc($l_info['sum']) . '</span>' : '';
if ($l_info['type'] === DOKU_CHANGE_TYPE_MINOR_EDIT) {
$l_minor = 'class="minor"';
}
$l_head = '<a class="wikilink1" href="' . wl($ID, "rev={$l_rev}") . '">' . $ID . ' [' . strftime($conf['dformat'], $l_rev) . ']</a>' . '<br />' . $l_user . ' ' . $l_sum;
}
if ($r_rev) {
$r_info = getRevisionInfo($ID, $r_rev, true);
if ($r_info['user']) {
$r_user = editorinfo($r_info['user']);
if (auth_ismanager()) {
$r_user .= ' (' . $r_info['ip'] . ')';
}
} else {
$r_user = $r_info['ip'];
}
$r_user = '<span class="user">' . $r_user . '</span>';
$r_sum = $r_info['sum'] ? '<span class="sum">' . hsc($r_info['sum']) . '</span>' : '';
if ($r_info['type'] === DOKU_CHANGE_TYPE_MINOR_EDIT) {
$r_minor = 'class="minor"';
}
$r_head = '<a class="wikilink1" href="' . wl($ID, "rev={$r_rev}") . '">' . $ID . ' [' . strftime($conf['dformat'], $r_rev) . ']</a>' . '<br />' . $r_user . ' ' . $r_sum;
} elseif ($_rev = @filemtime(wikiFN($ID))) {
$_info = getRevisionInfo($ID, $_rev, true);
if ($_info['user']) {
//.........这里部分代码省略.........
开发者ID:jalemanyf,项目名称:wsnlocalizationscala,代码行数:101,代码来源:html.php
示例6: pageVersions
/**
* Returns a list of available revisions of a given wiki page
*
* @author Michael Klier <[email protected]>
*/
function pageVersions($id, $first)
{
global $conf;
$versions = array();
if (empty($id)) {
return new IXR_Error(1, 'Empty page ID');
}
require_once DOKU_INC . 'inc/changelog.php';
$revisions = getRevisions($id, $first, $conf['recent'] + 1);
if (count($revisions) == 0 && $first != 0) {
$first = 0;
$revisions = getRevisions($id, $first, $conf['recent'] + 1);
}
if (count($revisions) > 0 && $first == 0) {
array_unshift($revisions, '');
// include current revision
array_pop($revisions);
// remove extra log entry
}
$hasNext = false;
if (count($revisions) > $conf['recent']) {
$hasNext = true;
array_pop($revisions);
// remove extra log entry
}
if (!empty($revisions)) {
foreach ($revisions as $rev) {
$file = wikiFN($id, $rev);
$time = @filemtime($file);
// we check if the page actually exists, if this is not the
// case this can lead to less pages being returned than
// specified via $conf['recent']
if ($time) {
$info = getRevisionInfo($id, $time, 1024);
if (!empty($info)) {
$data['user'] = $info['user'];
$data['ip'] = $info['ip'];
$data['type'] = $info['type'];
$data['sum'] = $info['sum'];
$data['modified'] = new IXR_Date($info['date']);
$data['version'] = $info['date'];
array_push($versions, $data);
}
}
}
return $versions;
} else {
return array();
}
}
开发者ID:jalemanyf,项目名称:wsnlocalizationscala,代码行数:55,代码来源:xmlrpc.php
示例7: getPageUser
/**
* Pull the user that modified the page from metadata
*
* @param string $page_id The page ID
* @param string $revision_id The revision ID, or "" if current revision
*
* @return string The name of the user responsible for the revision, or "" if the user
* could not be determined
*/
function getPageUser($page_id, $revision_id)
{
if ($revision_id == "") {
// Try to pull the user from the last_change metadata
$metadata = p_get_metadata($page_id);
if (array_key_exists("last_change", $metadata)) {
return $metadata["last_change"]["user"];
}
// There's no data as to who updated this, return empty user
return "";
} else {
// Return user associated with revision
return getRevisionInfo($page_id, $revision_id)["user"];
}
}
开发者ID:Jocai,项目名称:Door43,代码行数:24,代码来源:utils.php
示例8: media_saveOldRevision
/**
* Moves the current version of media file to the media_attic
* directory
*
* @author Kate Arzamastseva <[email protected]>
* @param string $id
* @return int - revision date
*/
function media_saveOldRevision($id)
{
global $conf, $lang;
$oldf = mediaFN($id);
if (!@file_exists($oldf)) {
return '';
}
$date = filemtime($oldf);
if (!$conf['mediarevisions']) {
return $date;
}
if (!getRevisionInfo($id, $date, 8192, true)) {
// there was an external edit,
// there is no log entry for current version of file
if (!@file_exists(mediaMetaFN($id, '.changes'))) {
addMediaLogEntry($date, $id, DOKU_CHANGE_TYPE_CREATE, $lang['created']);
} else {
addMediaLogEntry($date, $id, DOKU_CHANGE_TYPE_EDIT);
}
}
$newf = mediaFN($id, $date);
io_makeFileDir($newf);
if (copy($oldf, $newf)) {
// Set the correct permission here.
// Always chmod media because they may be saved with different permissions than expected from the php umask.
// (Should normally chmod to $conf['fperm'] only if $conf['fperm'] is set.)
chmod($newf, $conf['fmode']);
}
return $date;
}
开发者ID:omusico,项目名称:isle-web-framework,代码行数:38,代码来源:media.php
示例9: html_revisions
/**
* list old revisions
*
* @author Andreas Gohr <[email protected]>
* @author Ben Coburn <[email protected]>
*/
function html_revisions($first = 0)
{
global $ID;
global $INFO;
global $conf;
global $lang;
/* we need to get one additionally log entry to be able to
* decide if this is the last page or is there another one.
* see html_recent()
*/
$revisions = getRevisions($ID, $first, $conf['recent'] + 1);
if (count($revisions) == 0 && $first != 0) {
$first = 0;
$revisions = getRevisions($ID, $first, $conf['recent'] + 1);
}
$hasNext = false;
if (count($revisions) > $conf['recent']) {
$hasNext = true;
array_pop($revisions);
// remove extra log entry
}
$date = @date($conf['dformat'], $INFO['lastmod']);
print p_locale_xhtml('revisions');
print '<ul>';
if ($INFO['exists'] && $first == 0) {
print isset($INFO['meta']) && isset($INFO['meta']['last_change']) && $INFO['meta']['last_change']['type'] === 'e' ? '<li class="minor">' : '<li>';
print '<div class="li">';
print $date;
print ' <img src="' . DOKU_BASE . 'lib/images/blank.gif" width="15" height="11" alt="" /> ';
print '<a class="wikilink1" href="' . wl($ID) . '">' . $ID . '</a> ';
print ' – ';
print $INFO['sum'];
print ' <span class="user">';
print $INFO['editor'];
print '</span> ';
print '(' . $lang['current'] . ')';
print '</div>';
print '</li>';
}
foreach ($revisions as $rev) {
$date = date($conf['dformat'], $rev);
$info = getRevisionInfo($ID, $rev, true);
print $info['type'] === 'e' ? '<li class="minor">' : '<li>';
print '<div class="li">';
print $date;
if (@file_exists(wikiFN($ID, $rev))) {
print ' <a href="' . wl($ID, "rev={$rev},do=diff") . '">';
$p = array();
$p['src'] = DOKU_BASE . 'lib/images/diff.png';
$p['width'] = 15;
$p['height'] = 11;
$p['title'] = $lang['diff'];
$p['alt'] = $lang['diff'];
$att = buildAttributes($p);
print "<img {$att} />";
print '</a> ';
print '<a class="wikilink1" href="' . wl($ID, "rev={$rev}") . '">' . $ID . '</a>';
} else {
print ' <img src="' . DOKU_BASE . 'lib/images/blank.gif" width="15" height="11" alt="" /> ';
print $ID;
}
print ' – ';
print htmlspecialchars($info['sum']);
print ' <span class="user">';
if ($info['user']) {
print $info['user'];
} else {
print $info['ip'];
}
print '</span>';
print '</div>';
print '</li>';
}
print '</ul>';
print '<div class="pagenav">';
$last = $first + $conf['recent'];
if ($first > 0) {
$first -= $conf['recent'];
if ($first < 0) {
$first = 0;
}
print '<div class="pagenav-prev">';
print html_btn('newer', $ID, "p", array('do' => 'revisions', 'first' => $first));
print '</div>';
}
if ($hasNext) {
print '<div class="pagenav-next">';
print html_btn('older', $ID, "n", array('do' => 'revisions', 'first' => $last));
print '</div>';
}
print '</div>';
}
开发者ID:canneverbe,项目名称:flyspray,代码行数:98,代码来源:html.php
示例10: html_diff
/**
* show diff
*
* @author Andreas Gohr <[email protected]>
* @param string $text - compare with this text with most current version
* @param bool $intr - display the intro text
*/
function html_diff($text = '', $intro = true, $type = null)
{
global $ID;
global $REV;
global $lang;
global $conf;
if (!$type) {
$type = $_REQUEST['difftype'];
}
if ($type != 'inline') {
$type = 'sidebyside';
}
// we're trying to be clever here, revisions to compare can be either
// given as rev and rev2 parameters, with rev2 being optional. Or in an
// array in rev2.
$rev1 = $REV;
if (is_array($_REQUEST['rev2'])) {
$rev1 = (int) $_REQUEST['rev2'][0];
$rev2 = (int) $_REQUEST['rev2'][1];
if (!$rev1) {
$rev1 = $rev2;
unset($rev2);
}
} else {
$rev2 = (int) $_REQUEST['rev2'];
}
$r_minor = '';
$l_minor = '';
if ($text) {
// compare text to the most current revision
$l_rev = '';
$l_text = rawWiki($ID, '');
$l_head = '<a class="wikilink1" href="' . wl($ID) . '">' . $ID . ' ' . dformat((int) @filemtime(wikiFN($ID))) . '</a> ' . $lang['current'];
$r_rev = '';
$r_text = cleanText($text);
$r_head = $lang['yours'];
} else {
if ($rev1 && $rev2) {
// two specific revisions wanted
// make sure order is correct (older on the left)
if ($rev1 < $rev2) {
$l_rev = $rev1;
$r_rev = $rev2;
} else {
$l_rev = $rev2;
$r_rev = $rev1;
}
} elseif ($rev1) {
// single revision given, compare to current
$r_rev = '';
$l_rev = $rev1;
} else {
// no revision was given, compare previous to current
$r_rev = '';
$revs = getRevisions($ID, 0, 1);
$l_rev = $revs[0];
$REV = $l_rev;
// store revision back in $REV
}
// when both revisions are empty then the page was created just now
if (!$l_rev && !$r_rev) {
$l_text = '';
} else {
$l_text = rawWiki($ID, $l_rev);
}
$r_text = rawWiki($ID, $r_rev);
if (!$l_rev) {
$l_head = '—';
} else {
$l_info = getRevisionInfo($ID, $l_rev, true);
if ($l_info['user']) {
$l_user = editorinfo($l_info['user']);
if (auth_ismanager()) {
$l_user .= ' (' . $l_info['ip'] . ')';
}
} else {
$l_user = $l_info['ip'];
}
$l_user = '<span class="user">' . $l_user . '</span>';
$l_sum = $l_info['sum'] ? '<span class="sum">' . hsc($l_info['sum']) . '</span>' : '';
if ($l_info['type'] === DOKU_CHANGE_TYPE_MINOR_EDIT) {
$l_minor = 'class="minor"';
}
$l_head = '<a class="wikilink1" href="' . wl($ID, "rev={$l_rev}") . '">' . $ID . ' [' . dformat($l_rev) . ']</a>' . '<br />' . $l_user . ' ' . $l_sum;
}
if ($r_rev) {
$r_info = getRevisionInfo($ID, $r_rev, true);
if ($r_info['user']) {
$r_user = editorinfo($r_info['user']);
if (auth_ismanager()) {
$r_user .= ' (' . $r_info['ip'] . ')';
}
} else {
//.........这里部分代码省略.........
开发者ID:rezlemic,项目名称:dokuwiki-jQuery,代码行数:101,代码来源:html.php
示例11: test_chuncksizetrue
/**
* sometimes chuncksize is set to true
*/
function test_chuncksizetrue()
{
$rev = 1362525899;
$infoexpected = parseChangelogLine($this->logline);
$info = getRevisionInfo($this->pageid, $rev, true);
$this->assertEquals($infoexpected, $info);
}
开发者ID:rsnitsch,项目名称:dokuwiki,代码行数:10,代码来源:changelog_getrevisioninfo.test.php
注:本文中的getRevisionInfo函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论