From: Michael M Slusarz Date: Fri, 19 Jun 2009 18:23:34 +0000 (-0600) Subject: Correctly pass branch between browse screens X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=afb243b5f24581b460250fa092b6748426ff5a30;p=horde.git Correctly pass branch between browse screens --- diff --git a/chora/browsedir.php b/chora/browsedir.php index 99f2e4e8d..18e9ae16b 100644 --- a/chora/browsedir.php +++ b/chora/browsedir.php @@ -17,13 +17,13 @@ if (!$atdir) { exit; } -$rev = $VC->hasFeature('snapshots') - ? Horde_Util::getFormData('rev') +$onb = $VC->hasFeature('snapshots') + ? Horde_Util::getFormData('onb') : null; try { $atticFlags = (bool)$acts['sa']; - $dir = $VC->getDirObject($where, array('quicklog' => true, 'rev' => $rev, 'showattic' => $atticFlags)); + $dir = $VC->getDirObject($where, array('quicklog' => true, 'rev' => $onb, 'showattic' => $atticFlags)); $dir->applySort($acts['sbt'], $acts['ord']); $dirList = $dir->queryDirList(); $fileList = $dir->queryFileList($atticFlags); @@ -37,7 +37,7 @@ $title = ($where == '') : sprintf(_("Source Directory of /%s"), $where); $extraLink = $VC->hasFeature('deleted') - ? Horde::widget(Chora::url('browsedir', $where . '/', array('rev' => $rev, 'sa' => ($acts['sa'] ? 0 : 1))), $acts['sa'] ? _("Hide Deleted Files") : _("Show Deleted Files"), 'widget', '', '', $acts['sa'] ? _("Hide _Deleted Files") : _("Show _Deleted Files")) + ? Horde::widget(Chora::url('browsedir', $where . '/', array('onb' => $onb, 'sa' => ($acts['sa'] ? 0 : 1))), $acts['sa'] ? _("Hide Deleted Files") : _("Show Deleted Files"), 'widget', '', '', $acts['sa'] ? _("Hide _Deleted Files") : _("Show _Deleted Files")) : ''; $umap = array( @@ -52,14 +52,14 @@ foreach ($umap as $key => $val) { if ($acts['sbt'] == $val) { $arg['ord'] = !$acts['ord']; } - $url[$key] = Chora::url('browsedir', $where . '/', $arg, array('rev' => $rev)); + $url[$key] = Chora::url('browsedir', $where . '/', $arg, array('onb' => $onb)); } $branches = array(); if ($VC->hasFeature('branches')) { $branches = $dir->getBranches(); - if (is_null($rev)) { - $rev = $VC->getDefaultBranch(); + if (is_null($onb)) { + $onb = $VC->getDefaultBranch(); } } @@ -76,7 +76,7 @@ require CHORA_TEMPLATES . '/directory/header.inc'; /* Unless we're at the top, display the 'back' bar. */ if ($where != '') { - $url = Chora::url('browsedir', preg_replace('|[^/]+$|', '', $where), array('rev' => $rev)); + $url = Chora::url('browsedir', preg_replace('|[^/]+$|', '', $where), array('onb' => $onb)); require CHORA_TEMPLATES . '/directory/back.inc'; } @@ -87,7 +87,7 @@ if ($dirList) { if ($conf['hide_restricted'] && Chora::isRestricted($currentDir)) { continue; } - $url = Chora::url('browsedir', $where . '/' . $currentDir . '/', array('rev' => $rev)); + $url = Chora::url('browsedir', $where . '/' . $currentDir . '/', array('onb' => $onb)); $currDir = Horde_Text_Filter::filter($currentDir, 'space2html', array('charset' => NLS::getCharset(), 'encode' => true, 'encode_all' => true)); require CHORA_TEMPLATES . '/directory/dir.inc'; } @@ -116,7 +116,7 @@ if ($fileList) { $attic = $currFile->isDeleted(); $fileName = $where . ($attic ? '/' . 'Attic' : '') . '/' . $realname; $name = Horde_Text_Filter::filter($realname, 'space2html', array('charset' => NLS::getCharset(), 'encode' => true, 'encode_all' => true)); - $url = Chora::url('browsefile', $fileName, array('onb' => $rev)); + $url = Chora::url('browsefile', $fileName, array('onb' => $onb)); $readableDate = Chora::readableTime($date); if ($log) { $shortLog = str_replace("\n", ' ', trim(substr($log, 0, $conf['options']['shortLogLength'] - 1))); diff --git a/chora/co.php b/chora/co.php index 6d0495914..d93e6e0c8 100644 --- a/chora/co.php +++ b/chora/co.php @@ -75,7 +75,7 @@ if (!$plain) { ); if ($VC->hasFeature('snapshots')) { $snapdir = dirname($file->queryPath()); - $views[] = Horde::widget(Chora::url('browsedir', $snapdir == '.' ? '' : $snapdir . '/', array('rev' => $r)), _("Snapshot"), 'widget', '', '', _("_Snapshot")); + $views[] = Horde::widget(Chora::url('browsedir', $snapdir == '.' ? '' : $snapdir . '/', array('onb' => $r)), _("Snapshot"), 'widget', '', '', _("_Snapshot")); } $extraLink = _("View:") . ' ' . implode(' | ', $views); diff --git a/chora/lib/Chora.php b/chora/lib/Chora.php index bbcb2a522..e20a5b850 100644 --- a/chora/lib/Chora.php +++ b/chora/lib/Chora.php @@ -185,10 +185,12 @@ class Chora * Create the breadcrumb directory listing. * * @param string $where The current filepath. + * @param string $onb If not null, the branch to add to the generated + * URLs. * * @return string The directory string. */ - static public function whereMenu($where) + static public function whereMenu($where, $onb = null) { $bar = ''; $dirs = explode('/', $where); @@ -201,7 +203,11 @@ class Chora } $path .= $dir; if (!empty($dir)) { - $bar .= '/ '. Horde_Text_Filter::filter($dir, 'space2html', array('charset' => NLS::getCharset(), 'encode' => true, 'encode_all' => true)) . ' '; + $url = self::url('browsedir', $path . ($i == $dir_count && !$GLOBALS['atdir'] ? '' : '/')); + if (!empty($onb)) { + $url = Horde_Util::addParameter($url, array('onb' => $onb)); + } + $bar .= '/ '. Horde_Text_Filter::filter($dir, 'space2html', array('charset' => NLS::getCharset(), 'encode' => true, 'encode_all' => true)) . ' '; } } diff --git a/chora/templates/directory/header.inc b/chora/templates/directory/header.inc index 1b5950c5b..e2ff29da3 100644 --- a/chora/templates/directory/header.inc +++ b/chora/templates/directory/header.inc @@ -5,9 +5,9 @@ - - + diff --git a/chora/templates/headerbar.inc b/chora/templates/headerbar.inc index 7a3b52712..08d7bb1b3 100644 --- a/chora/templates/headerbar.inc +++ b/chora/templates/headerbar.inc @@ -4,7 +4,7 @@ [ ] - + :