Single file editing
[phorkie.git] / src / phorkie / Repository.php
index 7428c8a0c093abd7f0d20a474dda6c7c028f1ed4..467456b96821e81cd919927c734f098e2212bdb0 100644 (file)
@@ -144,7 +144,7 @@ class Repository
     /**
      * Loads the list of files in this repository
      *
-     * @return File[] Array of files
+     * @return File[] Array of file objects
      */
     public function getFiles()
     {
@@ -186,6 +186,11 @@ class Repository
         return $name;
     }
 
+    /**
+     * Return array with all file paths in this repository
+     *
+     * @return array
+     */
     protected function getFilePaths()
     {
         if ($this->hash === null) {
@@ -316,6 +321,9 @@ class Repository
     {
         if ($type == 'edit') {
             $link = $this->id . '/edit';
+            if ($option !== null) {
+                $link .= '/' . urlencode($option);
+            }
         } else if ($type == 'display') {
             $link = $this->id;
         } else if ($type == 'fork') {
@@ -326,8 +334,12 @@ class Repository
             $link = $this->id . '/delete';
         } else if ($type == 'delete-confirm') {
             $link = $this->id . '/delete/confirm';
+        } else if ($type == 'remotefork') {
+            return 'web+fork:' . $this->getLink('display', null, true);
         } else if ($type == 'revision') {
             $link = $this->id . '/rev/' . $option;
+        } else if ($type == 'linkback') {
+            $link = $this->id . '/linkback';
         } else {
             throw new Exception('Unknown link type');
         }