Added a basic admin page for categories.

This commit is contained in:
Jan Böhmer 2019-04-20 20:39:06 +02:00
parent 220d600cca
commit 424407f253
6 changed files with 319 additions and 102 deletions

View file

@ -114,6 +114,10 @@ class EntityURLGenerator
return $this->urlGenerator->generate('attachment_type_edit', ['id' => $entity->getID()]);
}
if($entity instanceof Category) {
return $this->urlGenerator->generate("category_edit", ['id' => $entity->getID()]);
}
//Otherwise throw an error
throw new EntityNotSupported('The given entity is not supported yet!');
}
@ -135,6 +139,10 @@ class EntityURLGenerator
return $this->urlGenerator->generate('attachment_type_new');
}
if($entity instanceof Category) {
return $this->urlGenerator->generate('category_new');
}
throw new EntityNotSupported('The given entity is not supported yet!');
}
@ -177,6 +185,10 @@ class EntityURLGenerator
return $this->urlGenerator->generate('attachment_type_delete', ['id' => $entity->getID()]);
}
if($entity instanceof Category) {
return $this->urlGenerator->generate('category_delete', ['id' => $entity->getID()]);
}
throw new EntityNotSupported('The given entity is not supported yet!');
}

View file

@ -61,6 +61,10 @@ class ToolsTreeBuilder
$nodes = array();
$nodes[] = new TreeViewNode($this->translator->trans('tree.tools.edit.attachment_types'),
$this->urlGenerator->generate('attachment_type_new'));
$nodes[] = new TreeViewNode($this->translator->trans('tree.tools.edit.categories'),
$this->urlGenerator->generate('category_new'));
$nodes[] = new TreeViewNode('Node 2');
$tree[] = new TreeViewNode($this->translator->trans('tree.tools.edit'), null, $nodes);