Zum Inhalt springen

DAM in eigene Extension einbinden - II

Erstellt am 29. Juli 2008 · Noch keine Antworten

Tags: Frage

DocMcFly ·

Hallo,

Ich bin gerade beim Code aufräumen auf folgendes Problem gestoßen und kann es nicht dingfest machen:

Ich wollte eine DAM-Image-Kommentar-Extension schreiben, in der die Kommentare auch ganz brav in einem Systemordner im BE angezeigt werden.

Dazu habe ich

"dam_uid" => txdam_getMediaTCA('image_field','dam_small_gallery')

genutzt, um im BE die DAM-Bilder auszusuchen zu denen der Kommentar gehört.

Nach dem Aufräumen habe ich aus der SQL-Tabelle die Spalte "dam_uid" rausgeschmissen, weil die ja nach meinem Verständnis nicht mehr benötigt wird.

Wenn ich dann aber im BE einen Datensatz speichern will, fehlt Typo3 die Spalte "dam_uid". Jetzt bin ich in der Zwickmühle... Soll ich sinnloserweise(?) eine solche Spalte hinzufügen oder kann ich das irgendwie Typo3 beibringen, dass "dam_uid" nur eine virtuelle Spalte ist?

Vielen Dank fürs Lesen und helfen...

Gruß Clemens

<?php
if (!defined ('TYPO3_MODE'))  die ('Access denied.');

require_once(t3lib_extMgm::extPath('div') . 'class.tx_div.php');
require_once(t3lib_extMgm::extPath('dam') . 'tca_media_field.php'); 
  
$TCA["tx_damsmallgallery_comments"] = array (
  "ctrl" => $TCA["tx_damsmallgallery_comments"]["ctrl"],
  "interface" => array (
    "showRecordFieldList" => "hidden,comment,dam_uid"
  ),
  "feInterface" => $TCA["tx_damsmallgallery_comments"]["feInterface"],
  "columns" => array (
    'hidden' => array (   
      'exclude' => 1,
      'label'   => 'LLL:EXT:lang/locallang_general.xml:LGL.hidden',
      'config'  => array (
        'type'    => 'check',
        'default' => '0'
      )
    ),
    "comment" => Array (    
      "exclude" => 1,   
      "label" => "LLL:EXT:dam_small_gallery/locallang_db.xml:tx_damsmallgallery_comments.comment",    
      "config" => Array (
        "type" => "text",
        "cols" => "30", 
        "rows" => "5",
      )
    ),
    "dam_uid" => txdam_getMediaTCA('image_field','dam_small_gallery')       
  ),
  "types" => array (
    "0" => array("showitem" => "hidden;;1;;1-1-1, comment, dam_uid")
  ),
  "palettes" => array (
    "1" => array("showitem" => "")
  )
);
?>
#
# Table structure for table 'tx_damsmallgallery_comments'
#
CREATE TABLE tx_damsmallgallery_comments (
  uid int(11) NOT NULL auto_increment,
  pid int(11) DEFAULT '0' NOT NULL,
  tstamp int(11) DEFAULT '0' NOT NULL,
  crdate int(11) DEFAULT '0' NOT NULL,
  cruser_id int(11) DEFAULT '0' NOT NULL,
  deleted tinyint(4) DEFAULT '0' NOT NULL,
  hidden tinyint(4) DEFAULT '0' NOT NULL,
  comment text NOT NULL,
  
  PRIMARY KEY (uid),
  KEY parent (pid)
);