$url[$key] = Chora::url('browsedir', $where . '/', $arg);
}
+if ($VC->hasFeature('branches')) {
+ $branches = $dir->getBranches();
+}
+
/* Print out the directory header. */
$printAllCols = count($fileList);
+$sortdirclass = $acts['sbt'] ? 'sortdown' : 'sortup';
Horde::addScriptFile('prototype.js', 'horde', true);
Horde::addScriptFile('tables.js', 'horde', true);
Chora::isRestricted($currFile->queryName())) {
continue;
}
+
$lg = $currFile->queryLastLog();
$realname = $currFile->queryName();
$mimeType = Horde_Mime_Magic::filenameToMIME($realname);
$icon = Horde_Mime_Viewer::getIcon($mimeType);
$author = Chora::showAuthorName($lg->queryAuthor());
- $head = $currFile->queryHead();
+ $filerev = $lg->queryRevision();
$date = $lg->queryDate();
$log = $lg->queryLog();
$attic = $currFile->isDeleted();
<?php if ($conf['filename_linkto'] == 'revlog'): ?>
<a href="<?php echo $url ?>">
<?php else: ?>
- <a href="<?php echo Chora::url('co', $fileName, array('r' => $head)) ?>">
+ <a href="<?php echo Chora::url('co', $fileName, array('r' => $filerev)) ?>">
<?php endif; ?>
<?php echo $name ?></a>
</td>
<td>
<strong>
<?php if ($conf['filename_linkto'] == 'revlog'): ?>
- <a href="<?php echo Chora::url('co', $fileName, array('r' => $head)) ?>" title="<?php echo htmlspecialchars($head) ?>">
+ <a href="<?php echo Chora::url('co', $fileName, array('r' => $filerev)) ?>" title="<?php echo htmlspecialchars($filerev) ?>">
<?php else: ?>
- <a href="<?php echo $url ?>" title="<?php echo htmlspecialchars($head) ?>">
+ <a href="<?php echo $url ?>" title="<?php echo htmlspecialchars($filerev) ?>">
<?php endif; ?>
-<?php echo htmlspecialchars($VC->abbrev($head)) ?></a></strong>
+<?php echo htmlspecialchars($VC->abbrev($filerev)) ?></a></strong>
</td>
<?php else: ?>
<td>
<?php endif; ?>
<?php echo $name ?>
</td>
- <td><strong><?php echo htmlspecialchars($VC->abbrev($head)) ?></strong></td>
+ <td><strong><?php echo htmlspecialchars($VC->abbrev($filerev)) ?></strong></td>
<?php endif; ?>
<td><?php echo $author ?></td>
<td sortval="<?php echo (int)$date ?>">
-<?php $sortdirclass = $acts['sbt'] ? 'sortdown' : 'sortup' ?>
+<?php if (count($branches) > 1): ?>
+<table class="options" cellspacing="0">
+ <tr>
+ <td>
+ <form method="get" action="browsedir.php">
+ <?php echo _("View Branch:") ?>
+ <?php echo Chora::formInputs() ?>
+ <input type="hidden" name="f" value="<?php echo htmlspecialchars(Util::getFormData('f')) ?>" />
+ <select name="rev" onchange="this.form.submit()">
+<?php foreach (array_map('htmlspecialchars', $branches) as $val): ?>
+ <option value="<?php echo $val ?>"<?php echo ($val == $rev) ? ' selected="selected"' : '' ?>><?php echo $val ?></option>
+<?php endforeach; ?>
+ </select>
+ <noscript><input class="button" type="submit" value="<?php echo _("View") ?>" /></noscript>
+ </form>
+ </td>
+ </tr>
+</table>
+<?php endif; ?>
+
<table id="browse" cellspacing="0" class="browse sortable striped nowrap">
<thead>
<tr>