Bläddra i källkod

add fields 'roof' and 'red_status' to table pages

ksieren 2 år sedan
förälder
incheckning
3ad1a26455
3 ändrade filer med 41 tillägg och 0 borttagningar
  1. 31 0
      Configuration/TCA/Overrides/pages.php
  2. 6 0
      Resources/Private/Language/locallang_db.xlf
  3. 4 0
      ext_tables.sql

+ 31 - 0
Configuration/TCA/Overrides/pages.php

@@ -0,0 +1,31 @@
+<?php
+defined('TYPO3_MODE') or die();
+
+use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
+
+call_user_func(function () {
+    $additionalColumns = [
+        'roof' => [
+            'exclude' => true,
+            'label' => 'LLL:EXT:pagemanager/Resources/Private/Language/locallang_db.xlf:pages.roof',
+            'config' => [
+                'type' => 'input',
+                'size' => 30,
+                'eval' => 'trim',
+            ],
+        ],
+        'red_status' => [
+            'exclude' => true,
+            'label' => 'LLL:EXT:pagemanager/Resources/Private/Language/locallang_db.xlf:pages.red_status',
+            'config' => [
+                'type' => 'input',
+                'size' => 30,
+                'eval' => 'trim',
+            ],
+        ],
+    ];
+
+    ExtensionManagementUtility::addTCAcolumns('pages', $additionalColumns);
+    ExtensionManagementUtility::addToAllTCAtypes('pages', 'roof');
+    ExtensionManagementUtility::addToAllTCAtypes('pages', 'red_status');
+});

+ 6 - 0
Resources/Private/Language/locallang_db.xlf

@@ -21,6 +21,12 @@
 			<trans-unit id="tx_pagemanager_domain_model_activepage.full_name" resname="tx_pagemanager_domain_model_activepage.full_name">
 				<source>Full Name</source>
 			</trans-unit>
+			<trans-unit id="pages.roof">
+				<source>Roof</source>
+			</trans-unit>
+			<trans-unit id="pages.red_status">
+				<source>Red Status</source>
+			</trans-unit>
 		</body>
 	</file>
 </xliff>

+ 4 - 0
ext_tables.sql

@@ -0,0 +1,4 @@
+CREATE TABLE pages (
+    roof varchar(255) DEFAULT '' NOT NULL,
+    red_status varchar(255) DEFAULT '' NOT NULL
+);