MultiSelectWizard: Unterschied zwischen den Versionen

Aus Contao Community Documentation

(Die Seite wurde neu angelegt: „blubb“)
 
Zeile 1: Zeile 1:
blubb
+
Dieses Widget ist dafür gedacht, mehrere Select-Inputs nebeneinander zu definieren.
 +
Das Widget ist eigentlich das gleiche wie der [[MultiTextWizard]] nur halt mit Dropdownfeldern.
 +
 
 +
Version: 2.7.0 - 2.9.3
 +
Entwickler: Yanick Witschi (Toflar)
 +
Firma: certo web & design GmbH [http://www.certo-net.ch]
 +
Lizenz: LGPL
 +
Wendet sich an: Entwickler
 +
 
 +
- Wie sieht's aus? -
 +
Das Modul sieht haargenau gleich aus wie der ModuleWizard vom Contao-Core. Das Problem bei diesem Wizard ist nur, dass die Quellen alle hardgecodet sind und es deshalb für Drittentwickler unbrauchbar ist.
 +
[[Datei:Beispiel.jpg]]
 +
 
 +
- Verwendung -
 +
Es gibt zwei Verwendungsmöglichkeiten. Entweder direkt mit der Angabe von "columnsData" im "eval"-Array oder mit einem Callback.
 +
 
 +
-- "columnsData" --
 +
[phpcode]
 +
$GLOBALS['TL_DCA']['tl_table']['fields']['anything'] = array
 +
(
 +
'label'                => &$GLOBALS['TL_LANG']['tl_table']['anything'],
 +
'exclude' => true,
 +
'inputType' => 'multiSelectWizard',
 +
'eval' => array
 +
  (
 +
  'mandatory'=>true,
 +
  'columnsData'=> array
 +
(
 +
'columns' => array
 +
(
 +
'key' => 'language',
 +
'label' => $GLOBALS['TL_LANG']['MSC']['mylanguagelabel'],
 +
'source' => $this->getLanguages(),
 +
'style' => 'width:200px'
 +
),
 +
array
 +
(
 +
'key' => 'secondcolumn',
 +
'label' => $GLOBALS['TL_LANG']['MSC']['secondcolumn'],
 +
'source' => array
 +
(
 +
'option1' => $GLOBALS['TL_LANG']['MSC']['option1'],
 +
'option2' => $GLOBALS['TL_LANG']['MSC']['option2'],
 +
'option3' => $GLOBALS['TL_LANG']['MSC']['option3']
 +
),
 +
'style' => 'width:100px'
 +
)
 +
)
 +
)
 +
);
 +
[/phpcode]
 +
 
 +
-- Callback --
 +
[phpcode]
 +
$GLOBALS['TL_DCA']['tl_table']['fields']['anything'] = array
 +
(
 +
'label'                => &$GLOBALS['TL_LANG']['tl_table']['anything'],
 +
'exclude' => true,
 +
'inputType' => 'multiSelectWizard',
 +
'eval' => array('mandatory'=>true,'columnsCallback'=>array('Class', 'Method'))
 +
 +
);
 +
[/phpcode]
 +
 
 +
Wobei natürlich der Return-Wert genau das selbe Array sein muss, wie bei der "columnsData"-Variante.

Version vom 22. Februar 2011, 02:57 Uhr

Dieses Widget ist dafür gedacht, mehrere Select-Inputs nebeneinander zu definieren. Das Widget ist eigentlich das gleiche wie der MultiTextWizard nur halt mit Dropdownfeldern.

Version: 2.7.0 - 2.9.3 Entwickler: Yanick Witschi (Toflar) Firma: certo web & design GmbH [1] Lizenz: LGPL Wendet sich an: Entwickler

- Wie sieht's aus? - Das Modul sieht haargenau gleich aus wie der ModuleWizard vom Contao-Core. Das Problem bei diesem Wizard ist nur, dass die Quellen alle hardgecodet sind und es deshalb für Drittentwickler unbrauchbar ist. Datei:Beispiel.jpg

- Verwendung - Es gibt zwei Verwendungsmöglichkeiten. Entweder direkt mit der Angabe von "columnsData" im "eval"-Array oder mit einem Callback.

-- "columnsData" -- [phpcode] $GLOBALS['TL_DCA']['tl_table']['fields']['anything'] = array ( 'label' => &$GLOBALS['TL_LANG']['tl_table']['anything'], 'exclude' => true, 'inputType' => 'multiSelectWizard', 'eval' => array ( 'mandatory'=>true, 'columnsData'=> array ( 'columns' => array ( 'key' => 'language', 'label' => $GLOBALS['TL_LANG']['MSC']['mylanguagelabel'], 'source' => $this->getLanguages(), 'style' => 'width:200px' ), array ( 'key' => 'secondcolumn', 'label' => $GLOBALS['TL_LANG']['MSC']['secondcolumn'], 'source' => array ( 'option1' => $GLOBALS['TL_LANG']['MSC']['option1'], 'option2' => $GLOBALS['TL_LANG']['MSC']['option2'], 'option3' => $GLOBALS['TL_LANG']['MSC']['option3'] ), 'style' => 'width:100px' ) ) ) ); [/phpcode]

-- Callback -- [phpcode] $GLOBALS['TL_DCA']['tl_table']['fields']['anything'] = array ( 'label' => &$GLOBALS['TL_LANG']['tl_table']['anything'], 'exclude' => true, 'inputType' => 'multiSelectWizard', 'eval' => array('mandatory'=>true,'columnsCallback'=>array('Class', 'Method'))

); [/phpcode]

Wobei natürlich der Return-Wert genau das selbe Array sein muss, wie bei der "columnsData"-Variante.

Ansichten
Meine Werkzeuge

Contao Community Documentation

Nein, der Hangout ist noch nicht vorbei, wir schweigen nur. Es heisst ja auch hangout und nicht bryll out.

Christian Schiffler
Navigation
Verstehen
Verwenden
Entwickeln
Verschiedenes
Werkzeuge