Quellcode durchsuchen

add models for categories and types and update view

ksieren vor 2 Jahren
Ursprung
Commit
2759eee5cb

+ 52 - 35
Classes/Controller/DashboardController.php

@@ -4,46 +4,63 @@ declare(strict_types=1);
 
 namespace Meramo\Begriffmgt\Controller;
 
+
+use Meramo\Begriffmgt\Domain\Model\Category;
 use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
 use Meramo\Begriffmgt\Domain\Repository\TermRepository;
-use TYPO3\CMS\Extbase\Persistence\QueryInterface;
-use TYPO3\CMS\Extbase\Utility\DebuggerUtility;
 use Meramo\Begriffmgt\Domain\Model\Term;
+use Meramo\Begriffmgt\Domain\Repository\CategoryRepository;
+use TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager;
 
 
-/**
- * Determines what happens when the Module Buttom/Link is clicked
- */
 class DashboardController extends ActionController
 {
-  /**
-   * @var TermRepository $termRepository
-   */
-  protected $termRepository;
-
-  /**
-   * Set Sort order of Data in List Module
-   */
-  protected $defaultOrderings = ['uid' => QueryInterface::ORDER_ASCENDING];
-
-  /**
-   * @param TermRepository $termRepository
-   */
-  public function injectTermRepository(TermRepository $termRepository): void
-  {
-    $this->termRepository = $termRepository;
-  }
-
-  public function indexAction()
-  {
-
-    $terms = $this->termRepository->findAll();
-    // DebuggerUtility::var_dump($terms);
-    $query = $terms->getQuery();
-    // DebuggerUtility::var_dump($query);
-    $query->setOrderings(['uid' => QueryInterface::ORDER_ASCENDING]);
-
-    $this->view->assign('terms', $query->execute());
-
-  }
+    protected $termRepository;
+    protected $categoryRepository;
+
+    public function __construct(TermRepository $termRepository, CategoryRepository $categoryRepository) {
+        $this->termRepository = $termRepository;
+        $this->categoryRepository = $categoryRepository;
+    }
+
+    public function indexAction(): void
+    {
+        $terms = $this->termRepository->findAll();
+        $categories = $this->categoryRepository->findAll();
+        $this->view->assignMultiple([
+            'terms' => $terms,
+            'categories' => $categories,
+        ]);
+    }
+
+    public function newAction(): void {
+    }
+
+    public function listAction(): void {
+        $terms = $this->termRepository->findAll();
+        $this->view->assign('terms', $terms);
+    }
+
+    public function createAction(string $termList, string $categoryTitle): void {
+        $terms = array_map('trim', explode(',', $termList));
+        $category = $this->createCategoryAction($categoryTitle);
+
+        $categoryObj = $this->categoryRepository->findByUid($category);
+        foreach ($terms as $term) {
+            $termObj = new Term();
+            $termObj->setTerm($term);
+            $termObj->setCategory($categoryObj);
+            $this->termRepository->add($termObj);
+        }
+        $this->redirect('index');
+    }
+
+    public function createCategoryAction(string $title) {
+        $category = new Category();
+        $category->setTitle($title);
+        $this->categoryRepository->add($category);
+        $this->objectManager->get(PersistenceManager::class)->persistAll();
+        return $category->getUid();
+    }
+
 }

+ 43 - 0
Classes/Domain/Model/Category.php

@@ -0,0 +1,43 @@
+<?php
+
+namespace Meramo\Begriffmgt\Domain\Model;
+
+use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
+use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
+
+class Category extends AbstractEntity
+{
+    protected $uid;
+    protected string $title = '';
+    protected ObjectStorage $terms;
+
+    public function __construct()
+    {
+        $this->terms = new ObjectStorage();
+    }
+
+    public function getUid(): int
+    {
+        return $this->uid;
+    }
+
+    public function getTitle(): string
+    {
+        return $this->title;
+    }
+
+    public function setTitle(string $title): void
+    {
+        $this->title = $title;
+    }
+
+    public function getTerms(): ObjectStorage
+    {
+        return $this->terms;
+    }
+
+    public function setTerms(ObjectStorage $terms): void
+    {
+        $this->terms = $terms;
+    }
+}

+ 17 - 103
Classes/Domain/Model/Term.php

@@ -1,136 +1,50 @@
 <?php
 
-#declare(strict_types=1);
+declare(strict_types=1);
 
 namespace Meramo\Begriffmgt\Domain\Model;
 
 
 use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
 
-/**
- * This file is part of the "Chatbot Term Management" Extension for TYPO3 CMS.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * (c) 2023 Meramo Developer <development@meramo.de>, Meramo Verlag GmbH
- */
-
-/**
- * Table is used to manage chatbot terms
- */
 class Term extends AbstractEntity
 {
+    protected string $url = '';
 
-    /**
-     * chatbotType
-     *
-     * @var string
-     */
-    protected $type = '';
-
-    /**
-     * chatbotCategory
-     *
-     * @var string
-     */
-    protected $category = '';
-
-    /**
-     * chatbotTerms
-     *
-     * @var string
-     */
-    protected $terms = '';
-
-    /**
-     * chatbotUrl
-     *
-     * @var string
-     */
-    protected $url = '';
+    protected string $term = '';
+    protected ?Category $category = null;
+    protected ?Type $type = null;
 
-    /**
-     * Returns the chatbotType
-     *
-     * @return string
-     */
-    public function getType()
-    {
-        return $this->type;
+    public function getTerm(): string {
+        return $this->term;
     }
 
-    /**
-     * Sets the chatbotType
-     *
-     * @param string $type
-     * @return void
-     */
-    public function setType(int $type)
-    {
-        $this->type = $type;
+    public function setTerm(string $term): void {
+        $this->term = $term;
     }
 
-    /**
-     * Returns the category
-     *
-     * @return string
-     */
-    public function getCategory()
-    {
+    public function getCategory(): ?Category {
         return $this->category;
     }
 
-    /**
-     * Sets the category
-     *
-     * @param string $category
-     * @return void
-     */
-    public function setCategory(int $category)
-    {
+    public function setCategory(?Category $category): void {
         $this->category = $category;
     }
 
-
-    /**
-     * Returns Terms
-     *
-     * @return string
-     */
-    public function getTerms()
-    {
-        return $this->terms;
+    public function getType(): ?Type {
+        return $this->type;
     }
 
-    /**
-     * Sets the chatbotTerms
-     *
-     * @param string $terms
-     * @return void
-     */
-    public function setTerms(string $terms)
-    {
-        $this->terms = $terms;
+    public function setType(?Type $type): void {
+        $this->type = $type;
     }
 
-    /**
-     * Returns the url
-     *
-     * @return string
-     */
-    public function getUrl()
+    public function getUrl(): string
     {
         return $this->url;
     }
 
-    /**
-     * Sets the chatbot_url
-     *
-     * @param string $Url
-     * @return void
-     */
-    public function setUrl(string $url)
+    public function setUrl($url): void
     {
         $this->url = $url;
     }

+ 43 - 0
Classes/Domain/Model/Type.php

@@ -0,0 +1,43 @@
+<?php
+
+namespace Meramo\Begriffmgt\Domain\Model;
+use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
+use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
+
+
+class Type extends AbstractEntity
+{
+    protected $uid;
+    protected string $title = '';
+    protected ObjectStorage $terms;
+
+    public function __construct()
+    {
+        $this->terms = new ObjectStorage();
+    }
+
+    public function getUid(): int
+    {
+        return $this->uid;
+    }
+
+    public function getTitle(): string
+    {
+        return $this->title;
+    }
+
+    public function setTitle(string $title): void
+    {
+        $this->title = $title;
+    }
+
+    public function getTerms(): ObjectStorage
+    {
+        return $this->terms;
+    }
+
+    public function setTerms(ObjectStorage $terms): void
+    {
+        $this->terms = $terms;
+    }
+}

+ 9 - 0
Classes/Domain/Repository/CategoryRepository.php

@@ -0,0 +1,9 @@
+<?php
+
+namespace Meramo\Begriffmgt\Domain\Repository;
+
+use TYPO3\CMS\Extbase\Persistence\Repository;
+
+class CategoryRepository extends Repository {
+    // Add any custom methods or queries for the Category repository if needed.
+}

+ 2 - 2
Classes/Domain/Repository/TermRepository.php

@@ -1,4 +1,4 @@
-<?php 
+<?php
 
   declare(strict_types=1);
 
@@ -15,4 +15,4 @@
       $this->setDefaultQuerySettings($querySettings);
    }
 
-  }
+  }

+ 10 - 0
Classes/Domain/Repository/TypeRepository.php

@@ -0,0 +1,10 @@
+<?php
+
+namespace Meramo\Begriffmgt\Domain\Repository;
+
+use TYPO3\CMS\Extbase\Persistence\Repository;
+
+class TypeRepository extends Repository
+{
+    // Add any custom methods or queries for the Type repository if needed.
+}

+ 58 - 0
Configuration/TCA/tx_begriffmgt_domain_model_category.php

@@ -0,0 +1,58 @@
+<?php
+
+return [
+    'ctrl' => [
+        'title' => 'LLL:EXT:begriffmgt/Resources/Private/Language/locallang.xlf:tx_begriffmgt_domain_model_category',
+        'label' => 'title',
+        'tstamp' => 'tstamp',
+        'crdate' => 'crdate',
+        'cruser_id' => 'cruser_id',
+        'versioningWS' => true,
+        'origUid' => 't3_origuid',
+        'languageField' => 'sys_language_uid',
+        'transOrigPointerField' => 'l10n_parent',
+        'transOrigDiffSourceField' => 'l10n_diffsource',
+        'delete' => 'deleted',
+        'enablecolumns' => [
+            'disabled' => 'hidden',
+            'starttime' => 'starttime',
+            'endtime' => 'endtime',
+        ],
+        'searchFields' => 'title',
+        'iconfile' => 'EXT:begriffmgt/Resources/Public/Icons/chatbot.svg',
+    ],
+    'interface' => [
+        'showRecordFieldList' => 'title, terms',
+    ],
+    'types' => [
+        '1' => ['showitem' => 'title, terms'],
+    ],
+    'columns' => [
+        'title' => [
+            'exclude' => 0,
+            'label' => 'LLL:EXT:begriffmgt/Resources/Private/Language/locallang.xlf:tx_begriffmgt_domain_model_category.title',
+            'config' => [
+                'type' => 'input',
+                'size' => 30,
+                'eval' => 'trim,required'
+            ],
+        ],
+        'terms' => [
+            'exclude' => 1,
+            'label' => 'Terms',
+            'config' => [
+                'type' => 'inline',
+                'foreign_table' => 'tx_begriffmgt_domain_model_term',
+                'foreign_field' => 'category',
+                'maxitems' => 9999,
+                'appearance' => [
+                    'collapseAll' => 1,
+                    'levelLinksPosition' => 'top',
+                    'showSynchronizationLink' => 1,
+                    'showPossibleLocalizationRecords' => 1,
+                    'showAllLocalizationLink' => 1
+                ],
+            ],
+        ],
+    ],
+];

+ 36 - 66
Configuration/TCA/tx_begriffmgt_domain_model_term.php

@@ -15,19 +15,19 @@ return [
             'starttime' => 'starttime',
             'endtime' => 'endtime',
         ],
-        'searchFields' => 'type,category,terms,url',
+        'searchFields' => 'type,category,term,url',
         'typeicon_classes' => [
           'default' => 'begriffe_list_record_icon',
         ],
         'iconfile' => 'EXT:begriffmgt/Resources/Public/Icons/book.png'
     ],
     'interface' => [
-        'showRecordFieldList' => 'type,category,terms,url',
+        'showRecordFieldList' => 'type,category,term,url',
     ],
     'types' => [
         '0' => [
           'showitem' => '
-              --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general,type, category, terms,url,
+              --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general,type, category, term,url,
               --div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:access, hidden, starttime, endtime'
         ],
     ],
@@ -47,6 +47,39 @@ return [
                 ],
             ],
         ],
+        'category' => [
+            'exclude' => 0,
+            'label' => 'Category',
+            'config' => [
+                'type' => 'select',
+                'renderType' => 'selectSingle',
+                'foreign_table' => 'tx_begriffmgt_domain_model_category',
+                'minitems' => 0,
+                'maxitems' => 1,
+            ],
+        ],
+        'type' => [
+            'exclude' => 0,
+            'label' => 'Type',
+            'config' => [
+                'type' => 'select',
+                'renderType' => 'selectSingle',
+                'foreign_table' => 'tx_begriffmgt_domain_model_type',
+                'minitems' => 0,
+                'maxitems' => 1,
+            ],
+        ],
+        'term' => [
+            'exclude' => true,
+            'label' => 'Begriffe Einfügen (Komma getrennt)',
+            'config' => [
+                'type' => 'text',
+                'cols' => 60,
+                'rows' => 150,
+                'eval' => 'trim',
+                'default' => ''
+            ]
+        ],
         'starttime' => [
             'exclude' => true,
             'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.starttime',
@@ -76,69 +109,6 @@ return [
                 ]
             ],
         ],
-
-        'type' => [
-            'exclude' => true,
-            'label' => 'Typ',
-            'config' => [
-                'type' => 'select',
-                'renderType' => 'selectSingle',
-                'items' => [
-                    ['Auswählen', 0],
-                    ['Direct', 'direct'],
-                    ['Medical', 'medical'],
-                    ['Bewerbung', 'bewerbung'],
-                    ['Weiterbildung', 'weiterbildung'],
-                    ['Reverse', 'reverse'],
-                    ['Middlewords', 'middlewords'],
-                    ['Studiumwords', 'studiumword'],
-                    ['Ausbildungwords', 'ausbildungwords'],
-                    ['Unknown', 'unknown'],
-                ],
-                'size' => 1,
-                'maxitems' => 1,
-                'eval' => ''
-            ],
-        ],
-        'category' => [
-            'exclude' => true,
-            'label' => 'Kategorie',
-            'config' => [
-                'type' => 'select',
-                'renderType' => 'selectSingle',
-                'items' => [
-                    ['Auswählen', 0],
-                    ['Ausbildung', 'ausbildung'], 
-                    ['Studium', 'studium'],
-                    ['Adverbien', 'adverbien'],
-                    ['Verben', 'verben'],
-                    ['Substantiven', 'substantiven'],
-                    ['Konjuktionen', 'konjuktionen'],
-                    ['Pronomen', 'pronomen'],
-                    ['Relativpronomen', 'relativpronomen'],
-                    ['Indefinitpronomen', 'indefinitpronomen'],
-                    ['Indefinitpronomen', 'indefinitpronomen'],
-                    ['Numerale', 'Numerale'],
-                    ['Nomen', 'nomen'],
-                    ['Adjektive', 'adjektive'],
-                    ['Artikel', 'artikel']
-                ],
-                'size' => 1,
-                'maxitems' => 1,
-                'eval' => ''
-            ],
-        ],
-        'terms' => [
-            'exclude' => true,
-            'label' => 'Begriffe Einfügen (Komma getrennt)',
-            'config' => [
-                'type' => 'text',
-                'cols' => 60,
-                'rows' => 150,
-                'eval' => 'trim',
-                'default' => ''
-            ]
-        ],
         'url' => [
           'exclude' => true,
           'label' => 'Link',

+ 58 - 0
Configuration/TCA/tx_begriffmgt_domain_model_type.php

@@ -0,0 +1,58 @@
+<?php
+
+return [
+    'ctrl' => [
+        'title' => 'LLL:EXT:begriffmgt/Resources/Private/Language/locallang.xlf:tx_begriffmgt_domain_model_type',
+        'label' => 'title',
+        'tstamp' => 'tstamp',
+        'crdate' => 'crdate',
+        'cruser_id' => 'cruser_id',
+        'versioningWS' => true,
+        'origUid' => 't3_origuid',
+        'languageField' => 'sys_language_uid',
+        'transOrigPointerField' => 'l10n_parent',
+        'transOrigDiffSourceField' => 'l10n_diffsource',
+        'delete' => 'deleted',
+        'enablecolumns' => [
+            'disabled' => 'hidden',
+            'starttime' => 'starttime',
+            'endtime' => 'endtime',
+        ],
+        'searchFields' => 'title',
+        'iconfile' => 'EXT:begriffmgt/Resources/Public/Icons/chatbot.svg',
+    ],
+    'interface' => [
+        'showRecordFieldList' => 'title, terms',
+    ],
+    'types' => [
+        '1' => ['showitem' => 'title, terms'],
+    ],
+    'columns' => [
+        'title' => [
+            'exclude' => 0,
+            'label' => 'LLL:EXT:begriffmgt/Resources/Private/Language/locallang.xlf:tx_begriffmgt_domain_model_type.title',
+            'config' => [
+                'type' => 'input',
+                'size' => 30,
+                'eval' => 'trim,required'
+            ],
+        ],
+        'terms' => [
+            'exclude' => 1,
+            'label' => 'Terms',
+            'config' => [
+                'type' => 'inline',
+                'foreign_table' => 'tx_begriffmgt_domain_model_term',
+                'foreign_field' => 'type',
+                'maxitems' => 9999,
+                'appearance' => [
+                    'collapseAll' => 1,
+                    'levelLinksPosition' => 'top',
+                    'showSynchronizationLink' => 1,
+                    'showPossibleLocalizationRecords' => 1,
+                    'showAllLocalizationLink' => 1
+                ],
+            ],
+        ],
+    ],
+];

+ 0 - 17
Resources/Language/locallang_mod.xlf

@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xliff version="1.2" xmlns:t3="http://typo3.org/schemas/xliff" xmlns="urn:oasis:names:tc:xliff:document:1.2">
-	<file source-language="en" original="EXT:examples/Resources/Private/Language/Module/locallang_mod.xlf" datatype="plaintext" product-name="begriffmgt" date="2023-03-20T18:44:02+02:00">
-		<header></header>
-		<body>
-			<trans-unit id="mlang_labels_tabdescr" resname="mlang_labels_tabdescr">
-				<source>Chatbot Verwaltung</source>
-			</trans-unit>
-			<trans-unit id="mlang_labels_tablabel" resname="mlang_labels_tablabel">
-				<source>Chatbot Verwaltung</source>
-			</trans-unit>
-			<trans-unit id="mlang_tabs_tab" resname="mlang_tabs_tab">
-				<source>Chatbot Verwaltung</source>
-			</trans-unit>
-		</body>
-	</file>
-</xliff>

+ 1 - 1
Resources/Private/Language/locallang_mod.xlf

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
-	<file source-language="en" datatype="plaintext" original="EXT:mrmbe_posts/Resources/Private/Language/locallang_mod.xlf" date="2021-11-06T30:10:22Z" product-name="mrmbepages">
+	<file source-language="en" datatype="plaintext" original="EXT:begriffmgt/Resources/Private/Language/locallang_mod.xlf" date="2023-03-30T30:10:22Z" product-name="begriffmgt">
 		<header/>
 		<body>
 			<trans-unit id="mlang_labels_tablabel">

+ 29 - 0
Resources/Private/Layouts/Backend.html

@@ -0,0 +1,29 @@
+<html
+    xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
+    xmlns:be="http://typo3.org/ns/TYPO3/CMS/Backend/ViewHelpers"
+    data-namespace-typo3-fluid="true">
+
+<be:moduleLayout>
+    <f:be.pageRenderer
+        includeRequireJsModules="{
+            0:'TYPO3/CMS/Backend/ContextMenu',
+            1:'TYPO3/CMS/Backend/Modal',
+            2:'TYPO3/CMS/Beuser/BackendUserListing'
+        }"
+    />
+
+    <be:moduleLayout.menu identifier="BegriffmgtModalMenu">
+        <be:moduleLayout.menuItem label="Liste ChatbotBegriffe" uri="{f:uri.action(controller: 'Dashboard', action: 'index')}"/>
+    </be:moduleLayout.menu>
+
+ 
+    <be:moduleLayout.button.shortcutButton displayName="Add" />
+
+    <div id="begriffe-main-content">
+        <f:render section="List" />
+    </div>
+
+</be:moduleLayout>
+
+</html>
+

+ 5 - 1
Resources/Private/Layouts/Default.html

@@ -20,7 +20,11 @@
     <be:moduleLayout.button.shortcutButton displayName="Add" />
 
     <div id="begriffe-main-content">
-        <f:render section="Content" />
+        <f:render section="Create" />
+        <f:render section="List" />
+
+
+        <f:render section="Overview" />
     </div>
 
 </be:moduleLayout>

+ 58 - 56
Resources/Private/Templates/Dashboard/Index.html

@@ -4,62 +4,64 @@
     xmlns:be="http://typo3.org/ns/TYPO3/CMS/Backend/ViewHelpers"
     data-namespace-typo3-fluid="true">
 
-<f:layout name="Default" />
+<f:layout name="Backend" />
 
-<f:section name="Content">
-    <h1>Auflistung Chatbot Begriffe</h1>
-    <f:if condition="{terms}">
-      <div class="table-fit">
-        <table id="chatbotbegriffmgt-terms" class="table table-striped table-hover table-vertical-top">
-          <thead>
-            <tr>
-              <td><b>Typ<b></td>
-              <td><b>Kategorie</b></td>
-              <td><b>Begriffe</b></td>
-              <td><b>Link</b></td>
-              <td></td>
-            </tr>
-          </thead>
-          <tbody>
-            <f:for each="{terms}" as="term">
-              <tr>
-                <td>
-                  {term.type}
-                  </a>
-                </td>
-                <f:if condition="{term.category} != '0' ">
-                  <f:then>
-                    <td>
-                      {term.category}
-                    </td>
-                  </f:then>
-                  <f:else>
-                    <td></td>
-                  </f:else>
-                </f:if>
-                <td>
-                  {term.terms -> f:format.crop(maxCharacters: 25)}
-                </td>
-                <f:if condition="{term.url} != '0' ">
-                  <f:then>
-                    <td>{term.url}</td>
-                  </f:then>
-                  <f:else>
-                    <td></td>
-                  </f:else>
-                </f:if>
-                <td class="col-control">
-                  <div class="btn-group" role="group">
-                    <be:link.editRecord class="btn btn-default" table="tx_begriffmgt_domain_model_term" uid="{term.uid}" title="Bearbeiten">
-                        <core:icon identifier="actions-open" />
-                    </be:link.editRecord>
-                </div>
-                </td>
-              </tr>
-            </f:for>
-          </tbody>
-        </table>
-      </div>
-    </f:if>
+
+<f:section name="List">
+  <h1>Dashboard</h1>
+
+  <h2>Add words (comma-separated) with a category</h2>
+  <f:flashMessages />
+  <f:form action="create">
+    <label for="termList">Terms:</label>
+    <f:form.textfield name="termList" /><br>
+    <label for="categoryTitle">Category:</label>
+    <f:form.textfield name="categoryTitle" /><br>
+<!--    <f:form.select name="category" options="{categories}" optionValueField="uid" optionLabelField="title" /><br>-->
+    <f:form.submit value="Save" />
+  </f:form>
+
+
+  <h2>List of categories</h2>
+  <table>
+    <thead>
+    <tr>
+      <th>ID</th>
+      <th>Title</th>
+    </tr>
+    </thead>
+    <tbody>
+    <f:for each="{categories}" as="category">
+      <tr>
+        <td>{category.uid}</td>
+        <td>{category.title}</td>
+      </tr>
+    </f:for>
+    </tbody>
+  </table>
+
+
+  <h2>List of terms</h2>
+  <table>
+    <thead>
+    <tr>
+      <th>ID</th>
+      <th>Type</th>
+      <th>Category</th>
+      <th>Term</th>
+    </tr>
+    </thead>
+    <tbody>
+    <f:for each="{terms}" as="term">
+      <tr>
+        <td>{term.uid}</td>
+        <td>{term.type}</td>
+        <td>{term.category.title}</td>
+        <td>{term.term}</td>
+      </tr>
+    </f:for>
+    </tbody>
+  </table>
 </f:section>
+
 </html>

+ 6 - 3
ext_localconf.php

@@ -1,21 +1,24 @@
 <?php
 
+use TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider;
+use TYPO3\CMS\Core\Imaging\IconRegistry;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 
+defined('TYPO3_MODE') || die();
 
 call_user_func(
   function () {
-      $iconRegistry = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class);
+      $iconRegistry = GeneralUtility::makeInstance(IconRegistry::class);
       
       $iconRegistry->registerIcon(
           'begriffe_list_record_icon',
-          \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
+          SvgIconProvider::class,
           ['source' => 'EXT:begriffmgt/Resources/Public/Icons/book.png']
       );
 
       $iconRegistry->registerIcon(
         'begriffe_module_icon',
-        \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
+        SvgIconProvider::class,
         ['source' => 'EXT:begriffmgt/Resources/Public/Icons/chatbot.svg']
     );
   }

+ 8 - 4
ext_tables.php

@@ -1,14 +1,18 @@
-<?php 
+<?php
+
+use Meramo\Begriffmgt\Controller\DashboardController;
+use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
+use TYPO3\CMS\Extbase\Utility\ExtensionUtility;
 
 call_user_func(function()
 {
-  \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerModule(
+  ExtensionUtility::registerModule(
     'begriffmgt',
     'tools',
     'ChatbotBegriffManagement',
     'top',
     [
-      \Meramo\Begriffmgt\Controller\DashboardController::class => 'index',
+        DashboardController::class => 'index, list, create',
     ],
     [
       'access' => 'user,admin',
@@ -20,4 +24,4 @@ call_user_func(function()
 });
 
 // Add Static file
-\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile('begriffmgt', 'Configuration/TypoScript', 'Chatbot Management');
+ExtensionManagementUtility::addStaticFile('begriffmgt', 'Configuration/TypoScript', 'Chatbot Management');

+ 30 - 3
ext_tables.sql

@@ -6,9 +6,36 @@ CREATE TABLE tx_begriffmgt_domain_model_term (
     cruser_id int(11) DEFAULT '0' NOT NULL,
     deleted tinyint(1) unsigned DEFAULT '0' NOT NULL,
     hidden tinyint(1) unsigned DEFAULT '0' NOT NULL,
-	type VARCHAR(255) DEFAULT '' NOT NULL,
-	category VARCHAR(255) DEFAULT '',
-	terms text NOT NULL DEFAULT '',
+	type int(11) DEFAULT '0' NOT NULL,
+    category int(11) DEFAULT '0' NOT NULL,
+	term text NOT NULL DEFAULT '',
 	url varchar(255) DEFAULT '',
     PRIMARY KEY (uid)
 );
+
+CREATE TABLE tx_begriffmgt_domain_model_category (
+     uid int(11) unsigned NOT NULL AUTO_INCREMENT,
+     pid int(11) DEFAULT '0' NOT NULL,
+     tstamp int(11) unsigned DEFAULT '0' NOT NULL,
+     crdate int(11) unsigned DEFAULT '0' NOT NULL,
+     cruser_id int(11) DEFAULT '0' NOT NULL,
+     deleted tinyint(1) unsigned DEFAULT '0' NOT NULL,
+     hidden tinyint(1) unsigned DEFAULT '0' NOT NULL,
+     title varchar(255) NOT NULL,
+     terms text DEFAULT '',
+     PRIMARY KEY (uid)
+);
+
+
+CREATE TABLE tx_begriffmgt_domain_model_type (
+     uid int(11) unsigned NOT NULL AUTO_INCREMENT,
+     pid int(11) DEFAULT '0' NOT NULL,
+     tstamp int(11) unsigned DEFAULT '0' NOT NULL,
+     crdate int(11) unsigned DEFAULT '0' NOT NULL,
+     cruser_id int(11) DEFAULT '0' NOT NULL,
+     deleted tinyint(1) unsigned DEFAULT '0' NOT NULL,
+     hidden tinyint(1) unsigned DEFAULT '0' NOT NULL,
+     title varchar(255) NOT NULL,
+     terms text DEFAULT '',
+     PRIMARY KEY (uid)
+);