Просмотр исходного кода

Domain Model created and TCA configuration created

jabongwa 2 лет назад
Родитель
Сommit
c8544e3fb4

+ 0 - 0
Classes/Controller/DashboardController.php


+ 0 - 0
Classes/Controller/TermController.php


+ 137 - 0
Classes/Domain/Model/Term.php

@@ -0,0 +1,137 @@
+<?php
+
+#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 ChatbotTerm extends AbstractEntity
+{
+
+    /**
+     * chatbotType
+     *
+     * @var int
+     */
+    protected $chatbot_type = 0;
+
+    /**
+     * chatbotCategory
+     *
+     * @var int
+     */
+    protected $chatbot_category = 0;
+
+    /**
+     * chatbotTerms
+     *
+     * @var string
+     */
+    protected $chatbot_terms = '';
+
+    /**
+     * chatbotUrl
+     *
+     * @var string
+     */
+    protected $chatbot_url = '';
+
+    /**
+     * Returns the chatbotType
+     *
+     * @return int
+     */
+    public function getChatbotType()
+    {
+        return $this->chatbot_type;
+    }
+
+    /**
+     * Sets the chatbotType
+     *
+     * @param int $chatbotType
+     * @return void
+     */
+    public function setChatbotType(int $chatbot_type)
+    {
+        $this->chatbot_type = $chatbot_type;
+    }
+
+    /**
+     * Returns the chatbot_category
+     *
+     * @return int
+     */
+    public function getChatbotCategory()
+    {
+        return $this->chatbot_category;
+    }
+
+    /**
+     * Sets the chatbot_category
+     *
+     * @param int $chatbot_category
+     * @return void
+     */
+    public function setChatbotCategory(int $chatbot_category)
+    {
+        $this->chatbot_category = $chatbot_category;
+    }
+
+
+    /**
+     * Returns the chatbotTerms
+     *
+     * @return string
+     */
+    public function getChatbotTerms()
+    {
+        return $this->chatbot_terms;
+    }
+
+    /**
+     * Sets the chatbotTerms
+     *
+     * @param string $chatbot_terms
+     * @return void
+     */
+    public function setChatbotTerms(string $chatbot_terms)
+    {
+        $this->chatbot_terms = $chatbot_terms;
+    }
+
+    /**
+     * Returns the chatbot_url
+     *
+     * @return string
+     */
+    public function getChatbotUrl()
+    {
+        return $this->chatbot_url;
+    }
+
+    /**
+     * Sets the chatbot_url
+     *
+     * @param string $chatbotUrl
+     * @return void
+     */
+    public function setChatbotUrl(string $chatbot_url)
+    {
+        $this->chatbot_url = $chatbot_url;
+    }
+}

+ 0 - 0
Configuration/TCA/Overrides/pluging.php


+ 40 - 31
Configuration/TCA/tx_begriffmgt_domain_model_term.php

@@ -1,8 +1,10 @@
 <?php
 return [
     'ctrl' => [
-        'title' => 'Chatbot Begriffe',
-        'label' => 'title',
+        'title' => 'Chatbot Begriffe Management',
+        'label' => 'Chatbot Begriffe',
+        'label_alt' => 'chatbot_type',
+        'label_alt_force' => true,
         'tstamp' => 'tstamp',
         'crdate' => 'crdate',
         'cruser_id' => 'cruser_id',
@@ -13,7 +15,10 @@ return [
             'endtime' => 'endtime',
         ],
         'searchFields' => 'chatbot_terms,chatbot_category,chatbot_subcategory,chatbot_url',
-        'iconfile' => 'EXT:begriffe/Resources/Public/Icons/book.png'
+        'typeicon_classes' => [
+          'default' => 'mimetypes-x-sys_note',
+        ],
+        'iconfile' => 'EXT:begriffmgt/Resources/Public/Icons/book.png'
     ],
     'types' => [
         '0' => [
@@ -82,7 +87,9 @@ return [
                     ['Weiterbildung', 4],
                     ['Reverse', 5],
                     ['Middlewords', 6],
-                    ['Unknown', 7],
+                    ['Studiumwords', 7],
+                    ['Ausbildungwords', 8],
+                    ['Unknown', 9],
                 ],
                 'size' => 1,
                 'maxitems' => 1,
@@ -90,7 +97,6 @@ return [
             ],
         ],
         'chatbot_url' => [
-           'displayCond' => 'FIELD:chatbot_type:=:1',
            'exclude' => true,
            'label' => 'Link',
            'config' => [
@@ -99,7 +105,6 @@ return [
            ],
        ],
         'chatbot_category' => [
-            'displayCond' => 'FIELD:chatbot_type:=:5',
             'exclude' => true,
             'label' => 'Kategorie',
             'config' => [
@@ -108,37 +113,41 @@ return [
                 'items' => [
                     ['Auswählen', 0],
                     ['Ausbildung', 1], 
-                    ['Studium', 3],
-                    ['Studium', 4],
-                    ['Studium', 3],
+                    ['Studium', 2],
+                    ['Adverbien', 3],
+                    ['Verben', 4],
+                    ['Substantiven', 5],
+                    ['Konjuktionen', 6],
+                    ['Pronomen', 7],
+                    ['Relativpronomen', 8],
                 ],
                 'size' => 1,
                 'maxitems' => 1,
                 'eval' => ''
             ],
         ],
-        'chatbot_subcategory' => [
-          //'displayCond' => 'FIELD:chatbot_type:=:5',
-          'exclude' => true,
-          'label' => 'Unterkategorie',
-          'config' => [
-              'type' => 'select',
-              'renderType' => 'selectSingle',
-              'items' => [
-                  ['Ausbildung', 0],
-                  ['Studium', 2],
-                  ['Adverbien', 3],
-                  ['Verben', 4],
-                  ['Substantiven', 5],
-                  ['Konjuktionen', 6],
-                  ['Pronomen', 7],
-                  ['Relativpronomen', 8],
-              ],
-              'size' => 1,
-              'maxitems' => 1,
-              'eval' => ''
-          ],
-      ],
+      //   'chatbot_subcategory' => [
+      //     'exclude' => true,
+      //     'label' => 'Unterkategorie',
+      //     'config' => [
+      //         'type' => 'select',
+      //         'renderType' => 'selectSingle',
+      //         'items' => [
+      //             ['Auswählen', 0],
+      //             ['Ausbildung', 1],
+      //             ['Studium', 2],
+      //             ['Adverbien', 3],
+      //             ['Verben', 4],
+      //             ['Substantiven', 5],
+      //             ['Konjuktionen', 6],
+      //             ['Pronomen', 7],
+      //             ['Relativpronomen', 8],
+      //         ],
+      //         'size' => 1,
+      //         'maxitems' => 1,
+      //         'eval' => ''
+      //     ],
+      // ],
         'chatbot_terms' => [
             'exclude' => true,
             'label' => 'Begriffe Einfügen (Komma getrennt)',

+ 14 - 0
Configuration/Typoscript/constants_typoscript

@@ -0,0 +1,14 @@
+module.begriffmgt {
+    view {
+        # cat=module.begriffmgt/file; type=string; label=Path to template root (BE)
+        templateRootPath = EXT:begriffmgt/Resources/Private/Templates/
+        # cat=module.begriffmgt/file; type=string; label=Path to template partials (BE)
+        partialRootPath = EXT:begriffmgt/Resources/Private/Partials/
+        # cat=module.begriffmgt/file; type=string; label=Path to template layouts (BE)
+        layoutRootPath = EXT:begriffmgt/Resources/Private/Layouts/
+    }
+    persistence {
+        # cat=module.begriffmgt//a; type=string; label=Default storage PID
+        storagePid =
+    }
+}

+ 14 - 0
Configuration/Typoscript/settings.typoscript

@@ -0,0 +1,14 @@
+# Module configuration
+module.begriffmgt {
+    persistence {
+        storagePid = {$module.begriffmgt.persistence.storagePid}
+    }
+    view {
+        templateRootPaths.0 = EXT:begriffmgt/Resources/Private/Templates/
+        templateRootPaths.1 = {$module.begriffmgt.view.templateRootPath}
+        partialRootPaths.0 = EXT:begriffmgt/Resources/Private/Partials/
+        partialRootPaths.1 = {$module.begriffmgt.view.partialRootPath}
+        layoutRootPaths.0 = EXT:chatbotsearchterms/Resources/Private/Layouts/
+        layoutRootPaths.1 = {$module.begriffmgt.view.layoutRootPath}
+    }
+}

+ 9 - 3
ext_localconf.php

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

+ 0 - 1
ext_tables.sql

@@ -1,7 +1,6 @@
 CREATE TABLE tx_begriffmgt_domain_model_term (
 	chatbot_type VARCHAR(255) DEFAULT '' NOT NULL,
 	chatbot_category VARCHAR(255) DEFAULT '',
-  chatbot_subcategory VARCHAR(255) DEFAULT '',
 	chatbot_terms text NOT NULL DEFAULT '',
 	chatbot_url varchar(255) DEFAULT ''
 );