<?php
 class selectField extends baseField { var $sep = ','; function edit($addConf,$R) { $A = array(); if($addConf['attr']['multiSelect']) { $R['multiSelect'] = true; } foreach($addConf['opt'] as $y => $z) { $v = $z['attr']['name']; $A[$z['attr']['value']] = $v; } $R = $R+$this->Mizu->_Helper->getJsSelect($R['name'],$A,$R['value'],array('multiselect'=>$R['multiSelect'])); $R['width'] = 250; if($R['multiSelect']) { if(!is_array($R['value'])) { $R['value'] = explode($this->sep,$R['value']); } } return parent::edit($addConf,$R); } function getGetValue($v) { if($this->Conf['opt']) { foreach($this->Conf['opt'] as $k => $opt) { if($opt['attr']['value']==$v) { return $opt['attr']['name']; } } } return $v; } function getSetValue($v) { if(is_array($v)) { return implode($this->sep,$v); } return $v; } } 