fix repos containing supplementary .md files
[mdref/mdref] / mdref / Entry.php
index 5292fff4660dcbb3fd4796044350a591b051ae2b..db858a9c2d2a207ba694ed8b4a2518c427ff405d 100644 (file)
@@ -82,6 +82,14 @@ class Entry implements \IteratorAggregate {
                return $this->file;
        }
        
+       /**
+        * Get edit URL 
+        * @return string
+        */
+       public function getEditUrl() {
+               return $this->repo->getEditUrl($this->name);
+       }
+       
        /**
         * Read the title of the ref entry file
         * @return string
@@ -145,7 +153,11 @@ class Entry implements \IteratorAggregate {
         * @return \mdref\Entry
         */
        public function getParent() {
-               if ("." !== ($dirn = dirname($this->name))) {
+               switch ($dirn = dirname($this->name)) {
+               case ".":
+               case "/":
+                       break;
+               default:
                        return $this->repo->getEntry($dirn);
                }
        }