Zum Inhalt springen

Tabelle im BE in der Extension auslesen?

Erstellt am 14. August 2007 · 8 Antworten · letzte Antwort am 15. August 2007

Tags: Frage

manuelone ·

Hallo,
wie kann ich eine Spalte einer Tabelle die ich im Kickstarter angelegt habe im BE in der Extension (Seiteninhalt) auslesen und nicht im FE?

manuelone ·

Ok danke,
das hat mich schonmal wesentlich näher an mein Ziel gebracht.
Ich bin jetzt soweit das ich in meinem Plugin eine Dropdown Liste habe wo ich wie indem Beispiel Option 1 oder Option 2 auswählen kann.
Jetzt fehlt mir aber noch, wie ich beim speichern des Plugins die Option bzw. das Value in meine Tabelle bekomme?

Momentan sieht meine PHP Datei noch wie im Beispiel aus:

class tx_user_products_addFieldsToFlexForm {
 function addFields ($config) {
   $optionList = array();
   // add first option
   $optionList[0] = array(0 => 'option1', 1 => 'value1');
   // add second option
   $optionList[1] = array(0 => 'option2', 1 => 'value2');
   $config['items'] = array_merge($config['items'],$optionList);
   return $config;
 }
}
steffenk ·

warum machst Du nicht erstmal ne einfache Flexform ohne Userfunktion?
Wenn dann Fragen auftauchen, kannst Du die Flexform ja mal posten.

manuelone ·

Hm? #paralyzed#
Also ich hab die Flexform so übernommen wie in dem Beispiel und habe das überflüssige Zeug rausgeschmissen. Hab nur ein neuen Teil mit den Options reingenommen, bis dahin läuft ja auch alles nur, muss die Selectbox mit den "Options" auch eine Funktion erfüllen...
Verstehe jetzt nicht so ganz was ich da einfacher machen soll?

Gruß

manuelone ·

Wenn das weiterhilft hier auch nochmal mein Flexform:

<T3DataStructure>
 <meta>
       <langDisable>1</langDisable>
 </meta>
 <sheets>
  <sDEF>
   <ROOT>
    <TCEforms>
     <sheetTitle>LLL:EXT:user_products/locallang_db.php:tt_content.pi_flexform.sheet_general</sheetTitle>
    </TCEforms>
    <type>array</type>
     <el>
      <pages>
       <TCEforms>
        <exclude>1</exclude>
        <label>LLL:EXT:lang/locallang_general.php:LGL.startingpoint</label>
        <config>
         <type>group</type>
         <internal_type>db</internal_type>
         <allowed>pages</allowed>
         <size>3</size>
         <maxitems>22</maxitems>
         <minitems>0</minitems>
         <show_thumbs>1</show_thumbs>
        </config>
       </TCEforms>
      </pages>
            <dynField>
              <TCEforms>
               <label>LLL:EXT:user_products/locallang_db.php:user_products.pi_flexform.dynField</label>
               <config>
                <type>select</type>
                 <itemsProcFunc>tx_user_products_addFieldsToFlexForm->addFields</itemsProcFunc>
               </config>
               </TCEforms>
            </dynField>
      <recursive>
       <TCEforms>
        <label>LLL:EXT:lang/locallang_general.php:LGL.recursive</label>
        <config>
         <type>select</type>
         <items type="array">
          <numIndex index="0" type="array">
           <numIndex index="0"></numIndex>
           <numIndex index="1"></numIndex>
          </numIndex>
          <numIndex index="1" type="array">
           <numIndex index="0">LLL:EXT:cms/locallang_ttc.php:recursive.I.1</numIndex>
           <numIndex index="1">1</numIndex>
           </numIndex>
          <numIndex index="2" type="array">
           <numIndex index="0">LLL:EXT:cms/locallang_ttc.php:recursive.I.2</numIndex>
           <numIndex index="1">2</numIndex>
          </numIndex>
          <numIndex index="3" type="array">
           <numIndex index="0">LLL:EXT:cms/locallang_ttc.php:recursive.I.3</numIndex>
           <numIndex index="1">3</numIndex>
          </numIndex>
          <numIndex index="4" type="array">
           <numIndex index="0">LLL:EXT:cms/locallang_ttc.php:recursive.I.4</numIndex>
           <numIndex index="1">4</numIndex>
          </numIndex>
          <numIndex index="5" type="array">
           <numIndex index="0">LLL:EXT:cms/locallang_ttc.php:recursive.I.5</numIndex>
           <numIndex index="1">250</numIndex>
          </numIndex>
         </items>
         <minitems>0</minitems>
         <maxitems>1</maxitems>
         <size>1</size>
        </config>
       </TCEforms>
      </recursive>
     </el>
    </ROOT>
   </sDEF>

   <error>
    <ROOT>
     <TCEforms>
      <sheetTitle>LLL:EXT:user_products/locallang_db.php:tt_content.pi_flexform.sheet_error</sheetTitle>
     </TCEforms>
     <type>array</type>
     <el>
      <show_errors>
       <TCEforms>
        <label>LLL:EXT:user_products/locallang_db.php:tt_content.pi_flexform.show_errors</label>
        <config>
         <type>check</type>
        </config>
       </TCEforms>
      </show_errors>
      <prepend_text>
       <TCEforms>
        <label>LLL:EXT:user_products/locallang_db.php:tt_content.pi_flexform.prepend_text</label>
        <config>
         <type>input</type>
         <size>30</size>
        </config>
       </TCEforms>
      </prepend_text>       
     </el>
    </ROOT>
   </error>
  </sheets>
</T3DataStructure>
steffenk ·

wenn Du speicherst, wird die gesamte Flexform im feld pi_flexform des tt_content-records abgespeichert.
Auslesen hab ich hier beschrieben: #66787