<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Field; class ComplexFields extends AbstractField { protected $value = array(); protected $width = 300; protected $listable = false; protected function setup() { $this->addVariables(array('fields' => array(), 'iconServer' => modstart_admin_url('widget/icon'))); } private function getDefaultValues() { goto WdH0z; Za0eW: $eS4om = array(); goto Crura; Crura: foreach ($Oax6w as $Axl2s) { $eS4om[$Axl2s['name']] = isset($Axl2s['defaultValue']) ? $Axl2s['defaultValue'] : null; } goto NiKom; NiKom: return $eS4om; goto dOxNz; WdH0z: $Oax6w = $this->getVariable('fields'); goto Za0eW; dOxNz: } public function iconServer($vhuku) { $this->addVariables(array('iconServer' => $vhuku)); return $this; } public function fields($FT9zA) { goto jfmdV; I0oPh: $this->defaultValue($this->getDefaultValues()); goto xIVZc; xIVZc: return $this; goto WSQSr; jfmdV: $this->addVariables(array('fields' => $FT9zA)); goto I0oPh; WSQSr: } public function unserializeValue($FT9zA, AbstractField $SQ6_6) { goto gpsWw; hoFxn: return $FT9zA; goto qGQEw; gpsWw: $FT9zA = @json_decode($FT9zA, true); goto RDZ11; RDZ11: if (empty($FT9zA)) { $FT9zA = new \stdClass(); } goto hoFxn; qGQEw: } public function serializeValue($FT9zA, $TAWWJ) { return json_encode($FT9zA, JSON_UNESCAPED_UNICODE); } public function prepareInput($FT9zA, $TAWWJ) { goto zRZ2a; zRZ2a: $FT9zA = @json_decode($FT9zA, true); goto aTQ7k; aqaKa: return $FT9zA; goto gstrv; aTQ7k: if (empty($FT9zA)) { $FT9zA = new \stdClass(); } goto aqaKa; gstrv: } }