-
Notifications
You must be signed in to change notification settings - Fork 2
/
browsefile.php
70 lines (59 loc) · 1.7 KB
/
browsefile.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
/**
* Browse view (for files).
*
* Copyright 1999-2017 Horde LLC (http://www.horde.org/)
*
* See the enclosed file LICENSE for license information (GPL). If you
* did not receive this file, see http://www.horde.org/licenses/gpl.
*
* @author Anil Madhavapeddy <[email protected]>
* @author Chuck Hagenbuch <[email protected]>
* @category Horde
* @license http://www.horde.org/licenses/gpl GPL
* @package Chora
*/
require_once __DIR__ . '/lib/Application.php';
Horde_Registry::appInit('chora');
if ($atdir) {
require CHORA_BASE . '/browsedir.php';
exit;
}
$onb = Horde_Util::getFormData('onb');
try {
$fl = $VC->getFile($where, array('branch' => $onb));
$fl->applySort(Horde_Vcs::SORT_AGE);
} catch (Horde_Vcs_Exception $e) {
Chora::fatal($e);
}
$title = _("Logs for:");
$logs = $fl->getLog();
$first = end($logs);
$diffValueLeft = $first->getRevision();
$diffValueRight = $fl->getRevision();
$sel = '';
foreach ($fl->getTags() as $sm => $rv) {
$sel .= '<option value="' . $rv . '">' . $sm . '</option>';
}
$branches = array();
if ($VC->hasFeature('branches')) {
$branches = $fl->getBranches();
}
$page_output->addScriptFile('revlog.js');
Chora::header($title);
echo Chora::getHistoryViews($where)->render('browsefile');
require CHORA_TEMPLATES . '/log/header.inc';
$view = $injector->createInstance('Horde_View');
$currentDay = null;
echo '<div class="commit-list">';
reset($logs);
foreach ($logs as $log) {
$day = date('Y-m-d', $log->getDate());
if ($day != $currentDay) {
echo '<h3>' . $day . '</h3>';
$currentDay = $day;
}
echo $view->renderPartial('app/views/logMessage', array('object' => $log->toHash()));
}
echo '</div>';
$page_output->footer();