<?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 VSyqn; Imb62: $K5eKM = array(); goto ctcIH; ctcIH: foreach ($xG2vi as $QRy1p) { $K5eKM[$QRy1p['name']] = isset($QRy1p['defaultValue']) ? $QRy1p['defaultValue'] : null; } goto jWxiZ; VSyqn: $xG2vi = $this->getVariable('fields'); goto Imb62; jWxiZ: return $K5eKM; goto S_1OJ; S_1OJ: } public function iconServer($J1_hF) { $this->addVariables(array('iconServer' => $J1_hF)); return $this; } public function fields($gwXrh) { goto dlAG2; kWM8M: return $this; goto U4Uy0; asPJl: $this->defaultValue($this->getDefaultValues()); goto kWM8M; dlAG2: $this->addVariables(array('fields' => $gwXrh)); goto asPJl; U4Uy0: } public function unserializeValue($gwXrh, AbstractField $VWt5t) { goto qHb65; qHb65: if (null === $gwXrh) { return $gwXrh; } goto qviSo; dKpFZ: return $gwXrh; goto MLd3G; WiYxN: if (empty($gwXrh)) { $gwXrh = new \stdClass(); } goto dKpFZ; qviSo: $gwXrh = @json_decode($gwXrh, true); goto WiYxN; MLd3G: } public function serializeValue($gwXrh, $uV19D) { return json_encode($gwXrh, JSON_UNESCAPED_UNICODE); } public function prepareInput($gwXrh, $uV19D) { goto RJlMG; NmoMX: return $gwXrh; goto cDNMf; RJlMG: $gwXrh = @json_decode($gwXrh, true); goto kWVel; kWVel: if (empty($gwXrh)) { $gwXrh = new \stdClass(); } goto NmoMX; cDNMf: } }