<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Field; class ComplexFieldsList extends AbstractField { protected $value = array(); protected $width = 300; protected $listable = false; protected function setup() { $this->addVariables(array('fields' => array(), 'valueItem' => new \stdClass(), 'iconServer' => modstart_admin_url('widget/icon'))); } private function getValueItem() { goto j3RhH; j3RhH: $Oax6w = $this->getVariable('fields'); goto XNzzw; XNzzw: $wgLog = array(); goto CK46N; CK46N: foreach ($Oax6w as $Axl2s) { $wgLog[$Axl2s['name']] = isset($Axl2s['defaultValue']) ? $Axl2s['defaultValue'] : null; } goto im0UX; im0UX: return $wgLog; goto EcToh; EcToh: } public function iconServer($vhuku) { $this->addVariables(array('iconServer' => $vhuku)); return $this; } public function fields($FT9zA) { goto rlgoG; rlgoG: $this->addVariables(array('fields' => $FT9zA)); goto HGAZb; nhIHM: return $this; goto MPECF; HGAZb: $this->addVariables(array('valueItem' => $this->getValueItem())); goto nhIHM; MPECF: } public function unserializeValue($FT9zA, AbstractField $SQ6_6) { goto iR2v_; OtLLn: return $FT9zA; goto Tne0v; iR2v_: $FT9zA = @json_decode($FT9zA, true); goto XGoC8; XGoC8: if (empty($FT9zA)) { $FT9zA = array(); } goto OtLLn; Tne0v: } public function serializeValue($FT9zA, $TAWWJ) { return json_encode($FT9zA, JSON_UNESCAPED_UNICODE); } public function prepareInput($FT9zA, $TAWWJ) { goto LLlWi; rMJpp: if (empty($FT9zA)) { $FT9zA = array(); } goto SamQf; LLlWi: $FT9zA = @json_decode($FT9zA, true); goto rMJpp; SamQf: return $FT9zA; goto Qr__P; Qr__P: } }