* code for task #8653.

This commit is contained in:
wangyidong
2020-12-16 17:26:27 +08:00
parent 687c85c539
commit 79359a5571
12 changed files with 75 additions and 54 deletions
+3 -2
View File
@@ -268,8 +268,9 @@ $filter->repo->default = new stdclass();
$filter->repo->diff = new stdclass();
$filter->repo->view = new stdclass();
$filter->repo->default->get['path'] = 'reg::base64';
$filter->repo->default->get['entry'] = 'reg::base64';
$filter->repo->default->get['repoPath'] = 'reg::base64';
$filter->repo->default->get['path'] = 'reg::base64';
$filter->repo->default->get['entry'] = 'reg::base64';
$filter->repo->default->cookie['repoBranch'] = 'reg::any';
$filter->repo->diff->cookie['arrange'] = 'reg::word';
+2 -2
View File
@@ -44,7 +44,7 @@ class git extends control
{
$entry = $this->repo->encodePath(str_replace($repo->path, '', $path));
$oldRevision = "$revision^";
$this->locate($this->repo->createLink('diff', "repoID=$repo->id&entry=&oldRevision=$oldRevision&revision=$revision", "entry=$entry", 'html', 'true'));
$this->locate($this->repo->createLink('diff', "repoID=$repo->id&entry=$entry&oldRevision=$oldRevision&revision=$revision", 'html', 'true'));
}
}
}
@@ -77,7 +77,7 @@ class git extends control
if(strpos($path, $repo->path) === 0)
{
$entry = $this->repo->encodePath(str_replace($repo->path, '', $path));
$this->locate($this->repo->createLink('view', "repoID=$repo->id&entry=&revision=$revision", "entry=$entry", 'html', true));
$this->locate($this->repo->createLink('view', "repoID=$repo->id&entry=$entry&revision=$revision", 'html', true));
}
}
}
+26 -16
View File
@@ -181,11 +181,19 @@ class repo extends control
*/
public function view($repoID, $entry, $revision = 'HEAD', $showBug = 'false', $encoding = '')
{
if($this->get->entry) $entry = $this->get->entry;
if($this->get->repoPath) $entry = $this->get->repoPath;
$this->repo->setMenu($this->repos, $repoID);
$this->repo->setBackSession('view', $withOtherModule = true);
if($repoID == 0) $repoID = $this->session->repoID;
if($_POST)
{
$oldRevision = isset($this->post->revision[1]) ? $this->post->revision[1] : '';
$newRevision = isset($this->post->revision[0]) ? $this->post->revision[0] : '';
$this->locate($this->repo->createLink('diff', "repoID=$repoID&entry=$entry&oldrevision=$oldRevision&newRevision=$newRevision"));
}
$file = $entry;
$repo = $this->repo->getRepoByID($repoID);
$entry = $this->repo->decodePath($entry);
@@ -193,7 +201,7 @@ class repo extends control
$this->scm->setEngine($repo);
$info = $this->scm->info($entry, $revision);
$path = $entry ? $info->path : '';
if($info->kind == 'dir') $this->locate($this->repo->createLink('browse', "repoID=$repoID&path=&revision=$revision", "path=" . $this->repo->encodePath($path)));
if($info->kind == 'dir') $this->locate($this->repo->createLink('browse', "repoID=$repoID&path=" . $this->repo->encodePath($path) . "&revision=$revision"));
$content = $this->scm->cat($entry, $revision);
$entry = urldecode($entry);
$pathInfo = pathinfo($entry);
@@ -272,7 +280,7 @@ class repo extends control
public function browse($repoID = 0, $path = '', $revision = 'HEAD', $refresh = 0)
{
/* Get path and refresh. */
if($this->get->path) $path = $this->get->path;
if($this->get->repoPath) $path = $this->get->repoPath;
if(empty($refresh) and $this->cookie->repoRefresh) $refresh = $this->cookie->repoRefresh;
/* Set menu and session. */
@@ -298,7 +306,7 @@ class repo extends control
$oldRevision = isset($this->post->revision[1]) ? $this->post->revision[1] : '';
$newRevision = isset($this->post->revision[0]) ? $this->post->revision[0] : '';
$this->locate($this->repo->createLink('diff', "repoID=$repoID&entry=&oldrevision=$oldRevision&newRevision=$newRevision", "path=" . $this->repo->encodePath($path)));
$this->locate($this->repo->createLink('diff', "repoID=$repoID&entry=" . $this->repo->encodePath($path) . "&oldrevision=$oldRevision&newRevision=$newRevision"));
}
/* Cache infos. */
@@ -388,7 +396,7 @@ class repo extends control
*/
public function log($repoID = 0, $entry = '', $revision = 'HEAD', $type = 'dir', $recTotal = 0, $recPerPage = 50, $pageID = 1)
{
if($this->get->entry) $entry = $this->get->entry;
if($this->get->repoPath) $entry = $this->get->repoPath;
$this->repo->setMenu($this->repos, $repoID);
$this->repo->setBackSession('log', $withOtherModule = true);
if($repoID == 0) $repoID = $this->session->repoID;
@@ -405,7 +413,7 @@ class repo extends control
$oldRevision = isset($this->post->revision[1]) ? $this->post->revision[1] : '';
$newRevision = isset($this->post->revision[0]) ? $this->post->revision[0] : '';
$this->locate($this->repo->createLink('diff', "repoID=$repoID&entry=&oldrevision=$oldRevision&newRevision=$newRevision", "entry=" . $this->repo->encodePath($path)));
$this->locate($this->repo->createLink('diff', "repoID=$repoID&entry=" . $this->repo->encodePath($path) . "&oldrevision=$oldRevision&newRevision=$newRevision"));
}
$this->scm->setEngine($repo);
@@ -433,7 +441,7 @@ class repo extends control
*
* @param int $repoID
* @param int $revision
* @param string $path
* @param string $root
* @param string $type
*
* @access public
@@ -441,6 +449,8 @@ class repo extends control
*/
public function revision($repoID, $revision, $root = '', $type = 'dir')
{
if($this->get->repoPath) $root = $this->get->repoPath;
$this->repo->setMenu($this->repos, $repoID);
$this->repo->setBackSession();
if($repoID == 0) $repoID = $this->session->repoID;
@@ -482,13 +492,13 @@ class repo extends control
$encodePath = $this->repo->encodePath($path);
if($change['kind'] == '' or $change['kind'] == 'file')
{
$change['view'] = $viewPriv ? html::a($this->repo->createLink('view', "repoID=$repoID&entry=&revision=$revision", "entry=$encodePath"), $this->lang->repo->viewA) : '';
if($change['action'] == 'M') $change['diff'] = $diffPriv ? html::a($this->repo->createLink('diff', "repoID=$repoID&entry=&oldRevision=$oldRevision&newRevision=$revision", "entry=$encodePath"), $this->lang->repo->diffAB) : '';
$change['view'] = $viewPriv ? html::a($this->repo->createLink('view', "repoID=$repoID&entry=$encodePath&revision=$revision"), $this->lang->repo->viewA) : '';
if($change['action'] == 'M') $change['diff'] = $diffPriv ? html::a($this->repo->createLink('diff', "repoID=$repoID&entry=$encodePath&oldRevision=$oldRevision&newRevision=$revision"), $this->lang->repo->diffAB) : '';
}
else
{
$change['view'] = $viewPriv ? html::a($this->repo->createLink('browse', "repoID=$repoID&path=&revision=$revision", "path=$encodePath"), $this->lang->repo->browse) : '';
if($change['action'] == 'M') $change['diff'] = $diffPriv ? html::a($this->repo->createLink('diff', "repoID=$repoID&entry=&oldRevision=$oldRevision&newRevision=$revision", "entry=$encodePath"), $this->lang->repo->diffAB) : '';
$change['view'] = $viewPriv ? html::a($this->repo->createLink('browse', "repoID=$repoID&path=$encodePath&revision=$revision"), $this->lang->repo->browse) : '';
if($change['action'] == 'M') $change['diff'] = $diffPriv ? html::a($this->repo->createLink('diff', "repoID=$repoID&entry=$encodePath&oldRevision=$oldRevision&newRevision=$revision"), $this->lang->repo->diffAB) : '';
}
$changes[$path] = $change;
}
@@ -534,7 +544,7 @@ class repo extends control
*/
public function blame($repoID, $entry, $revision = 'HEAD', $encoding = '')
{
if($this->get->entry) $entry = $this->get->entry;
if($this->get->repoPath) $entry = $this->get->repoPath;
$this->repo->setMenu($this->repos, $repoID);
if($repoID == 0) $repoID = $this->session->repoID;
$repo = $this->repo->getRepoByID($repoID);
@@ -581,7 +591,7 @@ class repo extends control
*/
public function diff($repoID, $entry = '', $oldRevision = '0', $newRevision = 'HEAD', $showBug = 'false', $encoding = '')
{
if($this->get->entry) $entry = $this->get->entry;
if($this->get->repoPath) $entry = $this->get->repoPath;
$this->repo->setMenu($this->repos, $repoID);
if($repoID == 0) $repoID = $this->session->repoID;
$file = $entry;
@@ -605,7 +615,7 @@ class repo extends control
}
if($this->post->encoding) $encoding = $this->post->encoding;
$this->locate($this->repo->createLink('diff', "repoID=$repoID&entry=&oldrevision=$oldRevision&newRevision=$newRevision&showBug=&encoding=$encoding", 'entry=' . $this->repo->encodePath($entry)));
$this->locate($this->repo->createLink('diff', "repoID=$repoID&entry=" . $this->repo->encodePath($entry) . "&oldrevision=$oldRevision&newRevision=$newRevision&showBug=&encoding=$encoding"));
}
$this->scm->setEngine($repo);
@@ -688,7 +698,7 @@ class repo extends control
*/
public function download($repoID, $path, $fromRevision = 'HEAD', $toRevision = '', $type = 'file')
{
if($this->get->path) $path = $this->get->path;
if($this->get->repoPath) $path = $this->get->repoPath;
$entry = $this->repo->decodePath($path);
$repo = $this->repo->getRepoByID($repoID);
$this->scm->setEngine($repo);
@@ -903,7 +913,7 @@ class repo extends control
*/
public function ajaxSideCommits($repoID, $path, $type = 'dir', $recTotal = 0, $recPerPage = 8, $pageID = 1)
{
if($this->get->path) $path = $this->get->path;
if($this->get->repoPath) $path = $this->get->repoPath;
$this->app->loadClass('pager', $static = true);
$pager = new pager($recTotal, $recPerPage, $pageID);
+19 -9
View File
@@ -791,15 +791,31 @@ class repoModel extends model
*
* @param string $method
* @param string $params
* @param string $pathParams
* @param string $viewType
* @param bool $onlybody
* @access public
* @return string
*/
public function createLink($method, $params = '', $pathParams = '', $viewType = '', $onlybody = false)
public function createLink($method, $params = '', $viewType = '', $onlybody = false)
{
$link = helper::createLink('repo', $method, $params, $viewType, $onlybody);
if($this->config->requestType == 'GET') return helper::createLink('repo', $method, $params, $viewType, $onlybody);
$parsedParams = array();
parse_str($params, $parsedParams);
$pathParams = '';
$pathKey = 'path';
if(isset($parsedParams['entry'])) $pathKey = 'entry';
if(isset($parsedParams['file'])) $pathKey = 'file';
if(isset($parsedParams['root'])) $pathKey = 'root';
if(isset($parsedParams[$pathKey]))
{
$pathParams = 'repoPath=' . $parsedParams[$pathKey];
$parsedParams[$pathKey] = '';
}
$params = http_build_query($parsedParams);
$link = helper::createLink('repo', $method, $params, $viewType, $onlybody);
if(empty($pathParams)) return $link;
$link .= strpos($link, '?') === false ? '?' : '&';
@@ -993,12 +1009,6 @@ class repoModel extends model
{
if(empty($_POST)) return false;
if(strpos($this->post->client, ' '))
{
dao::$errors['client'] = $this->lang->repo->error->clientPath;
return false;
}
$scm = $this->post->SCM;
$client = $this->post->client;
$account = $this->post->account;
+4 -4
View File
@@ -51,15 +51,15 @@ if(isset($entry)) $pathInfo .= '&type=file';
</table>
<div class='table-footer'>
<?php if(common::hasPriv('repo', 'diff')) echo html::submitButton($lang->repo->diff, '', count($revisions) < 2 ? 'disabled btn btn-primary' : 'btn btn-primary')?>
<?php echo html::a($this->repo->createLink('log', "repoID=$repoID&entry=&revision=HEAD&type=$logType", "entry=" . $this->repo->encodePath($path)), $lang->repo->allLog, '', "class='allLogs'");?>
<?php echo html::a($this->repo->createLink('log', "repoID=$repoID&entry=" . $this->repo->encodePath($path) . "&revision=HEAD&type=$logType"), $lang->repo->allLog, '', "class='allLogs'");?>
<div class='pull-right'>
<div class='btn-group'>
<?php
$prePage = $pager->pageID == 1 ? 1 : $pager->pageID - 1;
$nextPage = $pager->pageID == $pager->pageTotal ? $pager->pageID : $pager->pageID + 1;
$params = "repoID=$repoID&path=&type=$logType&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}";
$preLink = $this->repo->createLink('ajaxSideCommits', "$params&pageID=$prePage", "path=" . $this->repo->encodePath($path));
$nextLink = $this->repo->createLink('ajaxSideCommits', "$params&pageID=$nextPage", "path=" . $this->repo->encodePath($path));
$params = "repoID=$repoID&path=" . $this->repo->encodePath($path) . "&type=$logType&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}";
$preLink = $this->repo->createLink('ajaxSideCommits', "$params&pageID=$prePage");
$nextLink = $this->repo->createLink('ajaxSideCommits', "$params&pageID=$nextPage");
echo html::a($preLink, "<i class='icon icon-angle-left'></i>", '', "class='ajaxPager btn" . ($prePage == $pager->pageID ? ' disabled' : '') . "'");
echo html::a($nextLink, "<i class='icon icon-angle-right'></i>", '', "class='ajaxPager btn" . ($nextPage == $pager->pageID ? ' disabled' : '') . "'");
?>
+2 -2
View File
@@ -38,7 +38,7 @@ css::import($jsRoot . 'misc/highlight/styles/github.css');
foreach($paths as $pathName)
{
$postPath .= $pathName . '/';
echo '/' . ' ' . html::a($this->repo->createLink('browse', "repoID=$repoID", "path=" . $this->repo->encodePath($postPath)), trim($pathName, '/'));
echo '/' . ' ' . html::a($this->repo->createLink('browse', "repoID=$repoID&path=" . $this->repo->encodePath($postPath)), trim($pathName, '/'));
}
echo '/' . ' ' . $fileName;
echo " <span class='label label-info'>" . $revisionName . '</span>';
@@ -58,7 +58,7 @@ css::import($jsRoot . 'misc/highlight/styles/github.css');
<?php echo html::commonButton(zget($lang->repo->encodingList, $encoding, $lang->repo->encoding) . "<span class='caret'></span>", "id='encoding' data-toggle='dropdown'", 'btn dropdown-toggle')?>
<ul class='dropdown-menu' role='menu' aria-labelledby='encoding'>
<?php foreach($lang->repo->encodingList as $key => $val):?>
<li><?php echo html::a($this->repo->createLink('blame', "repoID=$repoID&entry=&revision=$revision&encoding=$key", "entry=$encodePath"), $val)?></li>
<li><?php echo html::a($this->repo->createLink('blame', "repoID=$repoID&entry=$encodePath&revision=$revision&encoding=$key"), $val)?></li>
<?php endforeach;?>
</ul>
</div>
+3 -3
View File
@@ -22,7 +22,7 @@
foreach($paths as $pathName)
{
$postPath .= $pathName . '/';
echo '/' . ' ' . html::a($this->repo->createLink('browse', "repoID=$repoID", "path=" . $this->repo->encodePath($postPath) . "&revision=$revision"), trim($pathName, '/'));
echo '/' . ' ' . html::a($this->repo->createLink('browse', "repoID=$repoID&path=" . $this->repo->encodePath($postPath) . "&revision=$revision"), trim($pathName, '/'));
}
}
?>
@@ -31,7 +31,7 @@
</div>
<div class="btn-toolbar pull-right">
<span class='last-sync-time'><?php echo $lang->repo->notice->lastSyncTime . $cacheTime?></span>
<?php echo html::a($this->repo->createLink('browse', "repoID=$repoID&path=&revision=$revision&refresh=1", "path=" . $this->repo->encodePath($path)), "<i class='icon icon-refresh'></i> ". $lang->refresh, '', "class='btn btn-primary'");?>
<?php echo html::a($this->repo->createLink('browse', "repoID=$repoID&path=" . $this->repo->encodePath($path) . "&revision=$revision&refresh=1"), "<i class='icon icon-refresh'></i> ". $lang->refresh, '', "class='btn btn-primary'");?>
</div>
</div>
<div id="mainContent" class="main-row fade">
@@ -57,7 +57,7 @@
<td>
<?php
$infoPath = trim($path . '/' . $info->name, '/');
$link = $info->kind == 'dir' ? $this->repo->createLink('browse', "repoID=$repoID", "path=" . $this->repo->encodePath($infoPath)) : $this->repo->createLink('view', "repoID=$repoID&entry=", 'entry=' . $this->repo->encodePath($infoPath));
$link = $info->kind == 'dir' ? $this->repo->createLink('browse', "repoID=$repoID&path=" . $this->repo->encodePath($infoPath)) : $this->repo->createLink('view', "repoID=$repoID&entry=" . $this->repo->encodePath($infoPath));
echo html::a($link, $info->name, '', "title='{$info->name}'");
?>
</td>
+2 -2
View File
@@ -35,7 +35,7 @@
foreach($paths as $pathName)
{
$postPath .= $pathName . '/';
echo '/' . ' ' . html::a($this->repo->createLink('browse', "repoID=$repoID", "path=" . $this->repo->encodePath($postPath)), trim($pathName, '/'));
echo '/' . ' ' . html::a($this->repo->createLink('browse', "repoID=$repoID&path=" . $this->repo->encodePath($postPath)), trim($pathName, '/'));
}
echo '/' . ' ' . $fileName;
if($repo->SCM == 'Git')
@@ -63,7 +63,7 @@
</div>
<div class='btn-toolbar'>
<div class='btn-group'>
<?php if(common::hasPriv('repo', 'download')) echo html::a($this->repo->createLink('download', "repoID=$repoID&path=&fromRevison=$oldRevision&toRevision=$newRevision&type=path", "path=" . $this->repo->encodePath($entry)), $lang->repo->downloadDiff, 'hiddenwin', "class='btn btn-sm btn-download'");?>
<?php if(common::hasPriv('repo', 'download')) echo html::a($this->repo->createLink('download', "repoID=$repoID&path=" . $this->repo->encodePath($entry) . "&fromRevison=$oldRevision&toRevision=$newRevision&type=path"), $lang->repo->downloadDiff, 'hiddenwin', "class='btn btn-sm btn-download'");?>
<div class='btn-group'>
<?php echo html::commonButton(zget($lang->repo->encodingList, $encoding, $lang->repo->encoding) . "<span class='caret'></span>", "data-toggle='dropdown'", 'btn dropdown-toggle btn-sm')?>
<ul class='dropdown-menu' role='menu'>
+4 -4
View File
@@ -26,7 +26,7 @@
foreach($paths as $pathName)
{
$postPath .= $pathName . '/';
echo '/' . ' ' . html::a($this->repo->createLink('log', "repoID=$repoID", "entry=" . $this->repo->encodePath($postPath)), trim($pathName, '/'));
echo '/' . ' ' . html::a($this->repo->createLink('log', "repoID=$repoID&entry=" . $this->repo->encodePath($postPath)), trim($pathName, '/'));
}
echo '/' . ' ' . $fileName;
?>
@@ -40,10 +40,10 @@
<ul class="nav nav-default">
<?php $encodeEntry = $this->repo->encodePath($entry);?>
<li><a><?php echo $lang->repo->log;?></a></li>
<li><?php echo html::a($this->repo->createLink('view', "repoID=$repoID&entry=&revision=$revision", "entry=$encodeEntry"), $lang->repo->view);?></li>
<li><?php echo html::a($this->repo->createLink('view', "repoID=$repoID&entry=$encodeEntry&revision=$revision"), $lang->repo->view);?></li>
<?php if($info->kind == 'file'):?>
<li><?php echo html::a($this->repo->createLink('blame', "repoID=$repoID&entry=&revision=$revision", "entry=$encodeEntry"), $lang->repo->blame);?></li>
<li><?php echo html::a($this->repo->createLink('download', "repoID=$repoID&path=&fromRevision=$revision", "path=$encodeEntry"), $lang->repo->download, 'hiddenwin');?></li>
<li><?php echo html::a($this->repo->createLink('blame', "repoID=$repoID&entry=$encodeEntry&revision=$revision"), $lang->repo->blame);?></li>
<li><?php echo html::a($this->repo->createLink('download', "repoID=$repoID&path=$encodeEntry&fromRevision=$revision"), $lang->repo->download, 'hiddenwin');?></li>
<?php endif;?>
</ul>
</nav>
+1 -1
View File
@@ -19,7 +19,7 @@ $typeInfo = $type == 'file' ? '&type=file' : '';
<?php include '../../common/view/header.html.php';?>
<div id='mainMenu' class='clearfix'>
<div class='btn-toolbar pull-left'>
<?php echo html::a($this->repo->createLink('browse', "repoID=$repoID", $preDir), "<i class='icon icon-back'></i>" . $lang->goback, '', "class='btn btn-secondary'");?>
<?php echo html::a($this->repo->createLink('browse', "repoID={$repoID}{$preDir}"), "<i class='icon icon-back'></i>" . $lang->goback, '', "class='btn btn-link'");?>
<div class="divider"></div>
<div class="page-title">
<?php echo $lang->repo->revisionA . ' ' . ($repo->SCM == 'Git' ? $this->repo->getGitRevisionName($revision, $log->commit) : $revision);?>
+7 -7
View File
@@ -32,7 +32,7 @@ $version = " <span class=\"label label-info\">$revisionName</span>";
foreach($paths as $pathName)
{
$postPath .= $pathName . '/';
echo '/' . ' ' . html::a($this->repo->createLink('browse', "repoID=$repoID", "path=" . $this->repo->encodePath($postPath)), trim($pathName, '/'));
echo '/' . ' ' . html::a($this->repo->createLink('browse', "repoID=$repoID&path=" . $this->repo->encodePath($postPath)), trim($pathName, '/'));
}
echo '/' . ' ' . $fileName;
echo $version;
@@ -56,15 +56,15 @@ $version = " <span class=\"label label-info\">$revisionName</span>";
<div class='panel-actions'>
<?php if($suffix != 'binary' and strpos($config->repo->images, "|$suffix|") === false):?>
<?php
if(common::hasPriv('repo', 'blame')) echo html::a($this->repo->createLink('blame', "repoID=$repoID&entry=&revision=$revision&encoding=$encoding", "entry=$encodePath"), html::icon('random') . $lang->repo->blame, '', "class='btn btn-sm btn-primary'");
if(common::hasPriv('repo', 'download')) echo html::a($this->repo->createLink('download', "repoID=$repoID&path=&fromRevision=$revision", "path=$encodePath"), html::icon('download-alt') . $lang->repo->download, 'hiddenwin', "class='btn btn-sm btn-primary'");
if(common::hasPriv('repo', 'blame')) echo html::a($this->repo->createLink('blame', "repoID=$repoID&entry=$encodePath&revision=$revision&encoding=$encoding"), html::icon('random') . $lang->repo->blame, '', "class='btn btn-sm btn-primary'");
if(common::hasPriv('repo', 'download')) echo html::a($this->repo->createLink('download', "repoID=$repoID&path=$encodePath&fromRevision=$revision"), html::icon('download-alt') . $lang->repo->download, 'hiddenwin', "class='btn btn-sm btn-primary'");
?>
<?php endif;?>
<div class='btn-group'>
<?php echo html::commonButton(zget($lang->repo->encodingList, $encoding, $lang->repo->encoding) . "<span class='caret'></span>", "id='encoding' data-toggle='dropdown'", 'btn btn-sm btn-primary dropdown-toggle')?>
<ul class='dropdown-menu' role='menu' aria-labelledby='encoding'>
<?php foreach($lang->repo->encodingList as $key => $val):?>
<li><?php echo html::a($this->repo->createLink('view', "repoID=$repoID&entry=&revision=$revision&showBug=$showBug&encoding=$key", "entry=$encodePath", 'html', isonlybody()), $val)?></li>
<li><?php echo html::a($this->repo->createLink('view', "repoID=$repoID&entry=$encodePath&revision=$revision&showBug=$showBug&encoding=$key", 'html', isonlybody()), $val)?></li>
<?php endforeach;?>
</ul>
</div>
@@ -73,7 +73,7 @@ $version = " <span class=\"label label-info\">$revisionName</span>";
<?php if(strpos($config->repo->images, "|$suffix|") !== false):?>
<div class='image'><img src='data:image/<?php echo $suffix?>;base64,<?php echo $content?>' /></div>
<?php elseif($suffix == 'binary'):?>
<div class='binary'><?php echo html::a($this->repo->createLink('download', "repoID=$repoID&path=&fromRevision=$revision", "path=" . $this->repo->encodePath($entry)), "<i class='icon-download'></i>", 'hiddenwin', "title='{$lang->repo->download}'"); ?></div>
<div class='binary'><?php echo html::a($this->repo->createLink('download', "repoID=$repoID&path=" . $this->repo->encodePath($entry) . "&fromRevision=$revision"), "<i class='icon-download'></i>", 'hiddenwin', "title='{$lang->repo->download}'"); ?></div>
<?php else:?>
<pre class="<?php echo $config->program->suffix[$suffix];?>"><?php echo trim(htmlspecialchars($content, defined('ENT_SUBSTITUTE') ? ENT_QUOTES | ENT_SUBSTITUTE : ENT_QUOTES));?></pre>
<?php endif;?>
@@ -91,8 +91,8 @@ $version = " <span class=\"label label-info\">$revisionName</span>";
<?php if(!isonlybody()):?>
<div id="mainActions" class='main-actions'>
<nav class="container">
<?php if(!empty($preAndNext->pre)) echo html::a($this->repo->createLink('view', "repoID=$repoID&entry=&revision={$preAndNext->pre}&showBug=$showBug", "entry=$encodePath", 'html', isonlybody()), "<i class='icon-pre icon-chevron-left'></i>", '', "id='prevPage' class='btn btn-info' title='{$preAndNext->pre}'")?>
<?php if(!empty($preAndNext->next)) echo html::a($this->repo->createLink('view', "repoID=$repoID&entry=&revision={$preAndNext->next}&showBug=$showBug", "entry=$encodePath", 'html', isonlybody()), "<i class='icon-pre icon-chevron-right'></i>", '', "id='nextPage' class='btn btn-info' title='{$preAndNext->next}'")?>
<?php if(!empty($preAndNext->pre)) echo html::a($this->repo->createLink('view', "repoID=$repoID&entry=$encodePath&revision={$preAndNext->pre}&showBug=$showBug", 'html', isonlybody()), "<i class='icon-pre icon-chevron-left'></i>", '', "id='prevPage' class='btn btn-info' title='{$preAndNext->pre}'")?>
<?php if(!empty($preAndNext->next)) echo html::a($this->repo->createLink('view', "repoID=$repoID&entry=$encodePath&revision={$preAndNext->next}&showBug=$showBug", 'html', isonlybody()), "<i class='icon-pre icon-chevron-right'></i>", '', "id='nextPage' class='btn btn-info' title='{$preAndNext->next}'")?>
</nav>
</div>
<?php endif;?>
+2 -2
View File
@@ -44,7 +44,7 @@ class svn extends control
{
$entry = $this->repo->encodePath(str_ireplace($repo->path, '', $url));
$oldRevision = $revision - 1;
$this->locate($this->repo->createLink('diff', "repoID=$repo->id&entry=&oldRevision=$oldRevision&revision=$revision", "entry=$entry", 'html', true));
$this->locate($this->repo->createLink('diff', "repoID=$repo->id&entry=$entry&oldRevision=$oldRevision&revision=$revision", 'html', true));
}
}
}
@@ -77,7 +77,7 @@ class svn extends control
if(strpos(strtolower($url), strtolower($repo->path)) === 0)
{
$entry = $this->repo->encodePath(str_ireplace(strtolower($repo->path), '', $url));
$this->locate($this->repo->createLink('view', "repoID=$repo->id&entry=&revision=$revision", "entry=$entry", 'html', true));
$this->locate($this->repo->createLink('view', "repoID=$repo->id&entry=$entry&revision=$revision", 'html', true));
}
}
}