Refactor the tree system

Each element of the tree now only has one parent, not a parent array.

- Creating an elements doesn't necessarily rely on an existing file
- Moving elements unregisters elements from the previous parent
- Moved some helpers to the builder instead of Entry
This commit is contained in:
Stéphane Goetz
2015-07-18 20:52:14 +02:00
bovenliggende 3235c49acd
commit aa5602a0fb
7 gewijzigde bestanden met toevoegingen van 210 en 134 verwijderingen

Bestand weergeven

@ -11,8 +11,7 @@ class MarkdownPage extends \Todaymade\Daux\Format\Base\MarkdownPage
if ($this->title === 'index') {
$minimum_parent_dir_size = ($this->params['multilanguage']) ? 2 : 1;
if (count($this->file->getParents()) >= $minimum_parent_dir_size) {
$parents = $this->file->getParents();
$this->title = end($parents)->getTitle();
$this->title = $this->file->getParent()->getTitle();
} else {
$this->homepage = ($this->file->getName() === '_index');
$this->title = $this->params['title'];