Fix server, now returns files that are in the docs folder

This commit is contained in:
Stéphane Goetz
2015-04-27 12:47:10 +02:00
parent 36c663ac41
commit 3e374c7585
6 changed files with 155 additions and 13 deletions

View File

@ -61,22 +61,27 @@ abstract class Entry
$this->index_page = $index_page;
}
/**
* @return Entry
*/
public function getFirstPage()
{
if ($this->first_page) {
return $this->first_page;
}
foreach ($this->value as $node) {
if ($node instanceof Content && $node->title != 'index') {
$this->first_page = $node;
return $node;
if ($this instanceof Directory) {
foreach ($this->value as $node) {
if ($node instanceof Content && $node->title != 'index') {
$this->first_page = $node;
return $node;
}
}
}
foreach ($this->value as $node) {
if ($node instanceof Directory && $page = $node->getFirstPage()) {
$this->first_page = $page;
return $page;
foreach ($this->value as $node) {
if ($node instanceof Directory && $page = $node->getFirstPage()) {
$this->first_page = $page;
return $page;
}
}
}
return false;