From 25562bc011921a72b97f2198154602e145e691cc Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Thu, 29 Jan 2009 01:11:45 -0700 Subject: [PATCH] Cleanups --- chora/browse.php | 15 +++++++-------- chora/lib/api.php | 1 + 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/chora/browse.php b/chora/browse.php index 3ba7155e0..5d5f30a24 100644 --- a/chora/browse.php +++ b/chora/browse.php @@ -16,12 +16,16 @@ if (!$atdir && !$VC->isFile($fullname)) { Chora::fatal(sprintf(_("$fullname: no such file or directory"), $where), '404 Not Found'); } +/* Scripts needed for both dirs and files. */ +Horde::addScriptFile('prototype.js', 'horde', true); +Horde::addScriptFile('tables.js', 'horde', true); + if ($atdir) { try { $atticFlags = (bool)$acts['sa']; $dir = $VC->getDirObject($where, array('quicklog' => true, 'showattic' => $atticFlags)); $dir->applySort($acts['sbt'], $acts['ord']); - $dirList = &$dir->queryDirList(); + $dirList = $dir->queryDirList(); $fileList = $dir->queryFileList($atticFlags); } catch (Horde_Vcs_Exception $e) { Chora::fatal($e); @@ -54,8 +58,6 @@ if ($atdir) { /* Print out the directory header. */ $printAllCols = count($fileList); - Horde::addScriptFile('prototype.js', 'horde', true); - Horde::addScriptFile('tables.js', 'horde', true); require CHORA_TEMPLATES . '/common-header.inc'; require CHORA_TEMPLATES . '/menu.inc'; require CHORA_TEMPLATES . '/headerbar.inc'; @@ -74,7 +76,7 @@ if ($atdir) { if ($conf['hide_restricted'] && Chora::isRestricted($currentDir)) { continue; } - $url = Chora::url('browse', "$where/$currentDir/"); + $url = Chora::url('browse', '$where' . '/' . $currentDir . '/'); $currDir = Text::htmlAllSpaces($currentDir); require CHORA_TEMPLATES . '/directory/dir.inc'; } @@ -105,8 +107,7 @@ if ($atdir) { $url = Chora::url('browse', $fileName); $readableDate = Chora::readableTime($date); if ($log) { - $shortLog = str_replace("\n", ' ', - trim(substr($log, 0, $conf['options']['shortLogLength'] - 1))); + $shortLog = str_replace("\n", ' ', trim(substr($log, 0, $conf['options']['shortLogLength'] - 1))); if (strlen($log) > 80) { $shortLog .= '...'; } @@ -149,8 +150,6 @@ if ($VC->hasFeature('branches')) { } } -Horde::addScriptFile('prototype.js', 'horde', true); -Horde::addScriptFile('tables.js', 'horde', true); Horde::addScriptFile('QuickFinder.js', 'horde', true); Horde::addScriptFile('revlog.js', 'chora', true); require CHORA_TEMPLATES . '/common-header.inc'; diff --git a/chora/lib/api.php b/chora/lib/api.php index 151ea8891..e1b05d26a 100644 --- a/chora/lib/api.php +++ b/chora/lib/api.php @@ -17,6 +17,7 @@ $_services['perms'] = array( function _chora_perms() { static $perms = array(); + if (!empty($perms)) { return $perms; } -- 2.11.0