X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/1801380d62ab693e819f17706a9530679a1add1e..ee9702f9ff640f0108e52490d256c789acb09433:/article.inc.php diff --git a/article.inc.php b/article.inc.php index 2396f2b..7f8e622 100644 --- a/article.inc.php +++ b/article.inc.php @@ -65,6 +65,18 @@ class ArchiveArticle return; } + function index() + { + $this->handler; + if (empty($this->handler)) { + return; + } + $User = NULL; + $Page = $this; + $res = include "./{$this->handler}/index.php"; + return $res; + } + function restricted() { $this->handler; @@ -264,12 +276,12 @@ class PageSearch function files() { # order alphabetically by link - $dir = iterator_to_array(new RecursiveIteratorIterator($this->iterator)); - array_walk($dir, function (&$row, $name) { - # prepare values for sorting (directory index first) - $row = preg_replace('{/index\.html$}', '', $name); - }); - asort($dir); + $dir = []; + foreach (new RecursiveIteratorIterator($this->iterator) as $name) { + $article = new ArchiveArticle($name); + $dir[$article->link] = $article; + } + ksort($dir); return $dir; } }