AW: [Typo3-UG Oesterreich] Shop-Modul und ev. Auftrag
Anatol Mayr
anatol.mayr at eurolab.at
Thu May 13 11:39:06 CEST 2004
Funktioniert einwandfrei. Ich hab' folgende Main-Function geschrieben:
class tx_myext_myfield {
function main (&$params,&$pObj) {
$query = "SELECT ID, BEZ FROM balabala";
$res = mysql(TYPO3_db,$query);
$i=1;
while ($data = mysql_fetch_array($res)) {
$params['items'][$i]= Array ($data[0],$i);
$i++;
}
}
}
Schon sind die gewünschten Daten in der Select-Box verfügbar.
Nochmals besten Dank.
LG,
Anatol
-----Ursprüngliche Nachricht-----
Von: typo3-at-bounces at lists.netfielders.de
[mailto:typo3-at-bounces at lists.netfielders.de] Im Auftrag von Wolfgang
Klinger
Gesendet: Donnerstag, 13. Mai 2004 10:20
An: TYPO3 Usergroup Oesterreich
Betreff: Re: [Typo3-UG Oesterreich] Shop-Modul und ev. Auftrag
Hallo!
Anatol Mayr schrieb folgendes am 13.05.2004:
> weiss jemand, welche Schritte zu tun sind, damit ich im
> Shop-Modul-Backend statt die Artikelnummer in ein Textfeld einzugeben,
> eine Select-Box machen kann, die auf eine bestimmte Tabelle (z.B.
> Artikel aus Warenwirtschaft) zugreift?
Hab' keine Ahnung von tt_shop, aber in etwa so:
In der tca.php vom Shop Modul mußt du die Definition des Feldes umändern
auf z.B.:
---
"myfield" => Array (
"exclude" => 1,
"label" =>
"LLL:EXT:myext/locallang_db.php:tx_myext_stuff.myfield",
"config" => Array (
"type" => "select",
"items" => Array (),
"itemsProcFunc" => "tx_myext_myfield->main",
)
),
---
und tx_myext_myfield->main holt dir dann die Einträge aus der
Datenbank:
---
class tx_myext_myfield {
function main (&$params,&$pObj) {
$params['items'][] = Array ('Bezeichnung', 1,
'Bezeichnung', 2);
}
}
---
Wolfgang
--------------------------------------------------------
Wolfgang Klinger mailto:wolfgang at stufenlos.net
Public Key:
http://www.stufenlos.net/wolfgang/stfl_wolfgang.gpg
--------------------------------------------------------
More information about the TYPO3-at
mailing list