[TYPO3-dev] Select box in typo3 Frontend ?

Elmar Hinz elmar.DOT.hinz at team.MINUS.red.DOT.net
Fri Dec 30 20:29:02 CET 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> I search for build a select box in Typo3 Frontend extension. Is there a
> class for automatic building that ?
> 



function makeSelection($name, $labels, $selection, $emptyLabel = '',
$allLabel = ''){
    if($emptyLabel)
      $options .= '<option value="">' . $emptyLabel . '</option>';
    if($allLabel)
      $options .= '<option value="all">' . $allLabel . '</option>';
    foreach ($labels as $value => $label){
      $selected = ($value == $selection) ? 'selected="1" ' : '';
      $options .= '<option value="' . $value . '"' . $selected . '>' .
$label . '</option>';
    }
    return '<select id="' .$this->prefixId . '_' . $name . '" name="'.
$this->prefixId . '[' . $name  . ']">' . $options . '</select>';
  }



- --
Climate change 2005: Mexico, Guatemala, New Orleans, Sahel, Bangladesh,
Spain, Portugal, Austria, Swiss, France, ...
Production of CO2 is killing people.
Production of CO2 just for fun is killing people just for fun.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDtYp+O976RNoy/18RAo06AJ9z5VXYhAt70u6eBlFYQVotQ9QT9wCfTFb8
+P7r+Vkc9/uKTtJ/Sxxm7oc=
=hNV2
-----END PGP SIGNATURE-----




More information about the TYPO3-dev mailing list