<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Field; class ComplexFields extends AbstractField { protected $width = 300; protected $listable = false; protected function setup() { $this->addVariables(array('fields' => array(), 'iconServer' => modstart_admin_url('widget/icon'))); } private function getDefaultValues() { goto DoHye; DoHye: $BpSP0 = $this->getVariable('fields'); goto no2Yp; NOJSV: return $pdVyN; goto MOmDY; u5JO_: foreach ($BpSP0 as $rFWFp) { $pdVyN[$rFWFp['name']] = isset($rFWFp['defaultValue']) ? $rFWFp['defaultValue'] : null; } goto NOJSV; no2Yp: $pdVyN = array(); goto u5JO_; MOmDY: } public function iconServer($P6Nu0) { $this->addVariables(array('iconServer' => $P6Nu0)); return $this; } public function fields($Gttsd) { goto QZBgo; QZBgo: $this->addVariables(array('fields' => $Gttsd)); goto K9jCv; y2bjn: return $this; goto Pu029; K9jCv: $this->defaultValue($this->getDefaultValues()); goto y2bjn; Pu029: } public function unserializeValue($Gttsd, AbstractField $acdQI) { goto VI_9z; rFz5d: $Gttsd = @json_decode($Gttsd, true); goto ZluLV; VI_9z: if (null === $Gttsd) { return $Gttsd; } goto rFz5d; ZluLV: if (empty($Gttsd)) { $Gttsd = new \stdClass(); } goto NiozA; NiozA: return $Gttsd; goto NP39_; NP39_: } public function serializeValue($Gttsd, $BWo2e) { return json_encode($Gttsd, JSON_UNESCAPED_UNICODE); } public function prepareInput($Gttsd, $BWo2e) { goto o7kf6; NMIsT: if (empty($Gttsd)) { $Gttsd = new \stdClass(); } goto CTRkw; o7kf6: $Gttsd = @json_decode($Gttsd, true); goto NMIsT; CTRkw: return $Gttsd; goto zoz2V; zoz2V: } }