<?php
 class filesField extends baseField { var $Conf = array( 'xtype' => 'filelistselect', 'icon' => 'file', 'height' => 250, 'setAutoSize' => true, ); function getFieldIcon($tpl) { if($tpl['attr']['filter']=='img') { $this->Conf['icon'] = 'file-image'; } return $this->Conf['icon']; } function edit($addConf,$R) { $R['xtype'] = ''; $R['autoSize'] = true; if(is_string($R['value']) AND is_array(unserialize($R['value']))) { $R['value'] = unserialize($R['value']); } if(!is_array($R['value'])) { $R['value'] = false; } if($R['conf']['cnt']) { $R['showTxt'] = array('file','txt|de'); $R['struct'] = array('file' => ''); foreach($this->Mizu->project['conf']['lngs'] as $k => $v) { $R['struct']['txt|'.$k] = ''; } } else { $R['showTxt'] = array('file','txt'); $R['struct'] = array('file' => '','txt' => ''); } return parent::edit($addConf,$R); } function getSetValue($v) { if(is_array($v)) { $v = $this->Mizu->_Helper->serialize($v); } return $v; } } 