Cleanups
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 29 Jan 2009 08:11:45 +0000 (01:11 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 29 Jan 2009 08:12:55 +0000 (01:12 -0700)
chora/browse.php
chora/lib/api.php

index 3ba7155..5d5f30a 100644 (file)
@@ -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';
index 151ea88..e1b05d2 100644 (file)
@@ -17,6 +17,7 @@ $_services['perms'] = array(
 function _chora_perms()
 {
     static $perms = array();
+
     if (!empty($perms)) {
         return $perms;
     }