Example #1
0
 /**
  *
  * @author Patrick Kohl
  * @param array $options( value & text)
  * @param string $name option name
  * @param string $defaut defaut value
  * @param string $key option value
  * @param string $text option text
  * @param boolean $zero add  a '0' value in the option
  * return a select list
  */
 public static function select($name, $options, $default = '0', $attrib = "onchange='submit();'", $key = 'value', $text = 'text', $zero = true, $chosenDropDowns = true, $tranlsate = true)
 {
     if ($zero == true) {
         $option = array($key => "0", $text => vmText::_('COM_VIRTUEMART_LIST_EMPTY_OPTION'));
         $options = array_merge(array($option), $options);
     }
     if ($chosenDropDowns) {
         vmJsApi::chosenDropDowns();
         $attrib .= ' class="vm-chzn-select"';
     }
     return VmHTML::genericlist($options, $name, $attrib, $key, $text, $default, false, $tranlsate);
 }