From: Jan Schneider Date: Tue, 24 Aug 2010 13:32:48 +0000 (+0200) Subject: Use Horde_Url. Always include repository in URL. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=0b5f0fdf9889b1e15a212b9d8aca9e7c38b9eaa2;p=horde.git Use Horde_Url. Always include repository in URL. --- diff --git a/chora/co.php b/chora/co.php index 470b8345f..a42898aa8 100644 --- a/chora/co.php +++ b/chora/co.php @@ -12,7 +12,7 @@ require_once dirname(__FILE__) . '/lib/Application.php'; Horde_Registry::appInit('chora'); -/* If we know we're at a directory, just go to browse.php. */ +/* If we know we're at a directory, just go to browsedir.php. */ if ($atdir) { require CHORA_BASE . '/browsedir.php'; exit; diff --git a/chora/lib/Chora.php b/chora/lib/Chora.php index 55b0efd31..a05a63914 100644 --- a/chora/lib/Chora.php +++ b/chora/lib/Chora.php @@ -58,7 +58,7 @@ class Chora if (!empty($dir)) { $url = self::url('browsedir', $path . ($i == $dir_count && !$GLOBALS['atdir'] ? '' : '/')); if (!empty($onb)) { - $url = Horde_Util::addParameter($url, array('onb' => $onb)); + $url = $url->add('onb', $onb); } $bar .= '/ ' . $GLOBALS['injector']->getInstance('Horde_Text_Filter')->filter($dir, 'space2html', array('encode' => true, 'encode_all' => true)) . ' '; } @@ -105,22 +105,23 @@ class Chora * * @return string The URL, with session information if necessary. */ - static public function url($script, $uri = '', $args = array(), $anchor = '') + static public function url($script, $uri = '', $args = array(), + $anchor = '') { - $arglist = self::_getArgList($GLOBALS['acts'], $GLOBALS['defaultActs'], $args); + $arglist = self::_getArgList($GLOBALS['acts'], + $GLOBALS['defaultActs'], + $args); $script .= '.php'; if ($GLOBALS['conf']['options']['urls'] == 'rewrite') { - if (in_array($script, array('browse.php', 'browsedir.php'))) { + if (in_array($script, array('browsefile.php', 'browsedir.php'))) { if (substr($uri, 0, 1) == '/') { $script = "browse$uri"; } else { $script = "browse/$uri"; } - if (isset($args['rt'])) { - $script = urlencode($arglist['rt']) . "/-/$script"; - unset($arglist['rt']); - } + $script = urlencode(isset($args['rt']) ? $args['rt'] : $GLOBALS['acts']['rt']) . "/-/$script"; + unset($arglist['rt']); } else { $script .= '/' . $uri; } @@ -128,9 +129,8 @@ class Chora $arglist['f'] = $uri; } - $url = Horde_Util::addParameter(Horde::applicationUrl($script), $arglist); + return Horde::applicationUrl($script)->add($arglist)->setAnchor($anchor); - return empty($anchor) ? $url : ($url . '#' . $anchor); } /** @@ -219,7 +219,7 @@ class Chora return '
' . '
'; + implode('', $arr) . ''; } /** @@ -356,7 +356,7 @@ class Chora $tags = array(); foreach ($lg->querySymbolicBranches() as $symb => $bra) { - $tags[] = ''. htmlspecialchars($symb) . ''; + $tags[] = self::url('browsefile', $where, array('onb' => $bra))->link() . htmlspecialchars($symb) . ''; } foreach ($lg->queryTags() as $tag) { diff --git a/chora/patchsets.php b/chora/patchsets.php index b240d3d74..6542b49fc 100644 --- a/chora/patchsets.php +++ b/chora/patchsets.php @@ -70,28 +70,37 @@ $diff_img = Horde::img('diff.png', _("Diff")); reset($patchsets); while (list($id, $patchset) = each($patchsets)) { - $patchset_link = Horde::link(Chora::url('patchsets', $where, array('ps' => $id)), sprintf("Patchset for %s", $id)) . htmlspecialchars($VC->abbrev($id)) . ''; + $patchset_link = Chora::url('patchsets', $where, array('ps' => $id)) + ->link(array('title' => sprintf("Patchset for %s", $id))) + . htmlspecialchars($VC->abbrev($id)) . ''; $files = $tags = array(); foreach ($patchset['members'] as $member) { $file = array(); - $file['file'] = Horde::link(Chora::url('co', $member['file'])) . htmlspecialchars($member['file']) . ''; + $file['file'] = Chora::url('co', $member['file'])->link() + . htmlspecialchars($member['file']) . ''; if ($member['status'] == Horde_Vcs_Patchset::ADDED) { $file['from'] = '' . _("New File") . ''; $file['diff'] = ''; } else { - $file['from'] = Horde::link(Chora::url('co', $member['file'], array('r' => $member['from'])), $member['from']) . htmlspecialchars($VC->abbrev($member['from'])) . ''; - $file['diff'] = Horde::link(Chora::url('diff', $member['file'], array('r1' => $member['from'], 'r2' => $member['to'])), _("Diff")) . ' ' . $diff_img . ''; + $file['from'] = Chora::url('co', $member['file'], array('r' => $member['from'])) + ->link(array('title' => $member['from'])) + . htmlspecialchars($VC->abbrev($member['from'])) . ''; + $file['diff'] = Chora::url('diff', $member['file'], array('r1' => $member['from'], 'r2' => $member['to'])) + ->link(array('title' => _("Diff"))) + . ' ' . $diff_img . ''; } if ($member['status'] == Horde_Vcs_Patchset::DELETED) { $file['to'] = '' . _("Deleted") . ''; $file['diff'] = ''; } else { - $file['to'] = Horde::link(Chora::url('co', $member['file'], array('r' => $member['to'])), $member['to']) . htmlspecialchars($VC->abbrev($member['to'])) . ''; + $file['to'] = Chora::url('co', $member['file'], array('r' => $member['to'])) + ->link(array('title' => $member['to'])) + . htmlspecialchars($VC->abbrev($member['to'])) . ''; } if (isset($member['added'])) { diff --git a/chora/templates/directory/header.inc b/chora/templates/directory/header.inc index 4a70a5734..c8623796c 100644 --- a/chora/templates/directory/header.inc +++ b/chora/templates/directory/header.inc @@ -1,10 +1,8 @@ 1): ?>
-
+ - - +