|
|
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
|
|
namespace Meramo\Begriffmgt\Controller;
|
|
|
|
|
|
use Meramo\Begriffmgt\Domain\Repository\TypeRepository;
|
|
|
+use Meramo\Begriffmgt\Domain\Repository\UrlRepository;
|
|
|
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
|
|
|
use Meramo\Begriffmgt\Domain\Repository\TermRepository;
|
|
|
use Meramo\Begriffmgt\Domain\Repository\CategoryRepository;
|
|
|
@@ -17,6 +18,8 @@ class DashboardController extends ActionController
|
|
|
protected $categoryController;
|
|
|
protected $typeRepository;
|
|
|
protected $typeController;
|
|
|
+ protected $urlRepository;
|
|
|
+ protected $urlController;
|
|
|
|
|
|
public function __construct(
|
|
|
TermRepository $termRepository,
|
|
|
@@ -24,6 +27,8 @@ class DashboardController extends ActionController
|
|
|
CategoryController $categoryController,
|
|
|
TypeRepository $typeRepository,
|
|
|
TypeController $typeController,
|
|
|
+ UrlRepository $urlRepository,
|
|
|
+ UrlController $urlController,
|
|
|
TermController $termController
|
|
|
) {
|
|
|
$this->termRepository = $termRepository;
|
|
|
@@ -32,15 +37,21 @@ class DashboardController extends ActionController
|
|
|
$this->termController = $termController;
|
|
|
$this->typeRepository = $typeRepository;
|
|
|
$this->typeController = $typeController;
|
|
|
+ $this->urlRepository = $urlRepository;
|
|
|
+ $this->urlController = $urlController;
|
|
|
}
|
|
|
|
|
|
public function indexAction(): void
|
|
|
{
|
|
|
$terms = $this->termRepository->findAll();
|
|
|
$categories = $this->categoryRepository->findAll();
|
|
|
+ $types = $this->typeRepository->findAll();
|
|
|
+ $urls = $this->urlRepository->findAll();
|
|
|
$this->view->assignMultiple([
|
|
|
'terms' => $terms,
|
|
|
'categories' => $categories,
|
|
|
+ 'types' => $types,
|
|
|
+ 'urls' => $urls
|
|
|
]);
|
|
|
}
|
|
|
|
|
|
@@ -52,13 +63,15 @@ class DashboardController extends ActionController
|
|
|
$this->view->assign('terms', $terms);
|
|
|
}
|
|
|
|
|
|
- public function createAction(string $termList, string $categoryTitle, string $typeTitle): void {
|
|
|
+ public function createAction(string $termList, string $categoryTitle, string $typeTitle, string $urlTitle): void {
|
|
|
$terms = array_map('trim', explode(',', $termList));
|
|
|
$category = $this->categoryController->createAction($categoryTitle);
|
|
|
$categoryObj = $this->categoryRepository->findByUid($category);
|
|
|
$type = $this->typeController->createAction($typeTitle);
|
|
|
$typeObj = $this->typeRepository->findByUid($type);
|
|
|
- $this->termController->createAction($terms, $categoryObj, $typeObj);
|
|
|
+ $url = $this->urlController->createAction($urlTitle);
|
|
|
+ $urlObj = $this->urlRepository->findByUid($url);
|
|
|
+ $this->termController->createAction($terms, $categoryObj, $typeObj, $urlObj);
|
|
|
$this->redirect('index');
|
|
|
}
|
|
|
}
|