<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Field; use ModStart\Core\Util\SerializeUtil; 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 qUNZw; kR4TR: $dMLhR = array(); goto WvZib; WvZib: foreach ($Bhd90 as $Qf9vs) { $dMLhR[$Qf9vs['name']] = isset($Qf9vs['defaultValue']) ? $Qf9vs['defaultValue'] : null; } goto MehaG; MehaG: return $dMLhR; goto V7F2l; qUNZw: $Bhd90 = $this->getVariable('fields'); goto kR4TR; V7F2l: } public function iconServer($Tkur1) { $this->addVariables(array('iconServer' => $Tkur1)); return $this; } public function fields($Mczr_) { goto VD9Td; VD9Td: $this->addVariables(array('fields' => $Mczr_)); goto oZR5m; oZR5m: $this->defaultValue($this->getDefaultValues()); goto o7qLY; o7qLY: return $this; goto h8FcJ; h8FcJ: } public function unserializeValue($Mczr_, AbstractField $rZfgs) { goto r9IAR; yIEsq: if (empty($Mczr_)) { $Mczr_ = new \stdClass(); } goto wbfQD; r9IAR: if (null === $Mczr_) { return $Mczr_; } goto tPPpA; tPPpA: $Mczr_ = @json_decode($Mczr_, true); goto yIEsq; wbfQD: return $Mczr_; goto eCk0e; eCk0e: } public function serializeValue($Mczr_, $vn_cr) { return SerializeUtil::jsonEncode($Mczr_); } public function prepareInput($Mczr_, $vn_cr) { goto LEkAw; AlqY1: return $Mczr_; goto cbBqo; gn1mW: if (empty($Mczr_)) { $Mczr_ = new \stdClass(); } goto AlqY1; LEkAw: $Mczr_ = @json_decode($Mczr_, true); goto gn1mW; cbBqo: } }