<?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 WSLpY; MgNQo: return $qqJ9g; goto oX6Lo; pbOwG: $qqJ9g = array(); goto K0nfb; WSLpY: $Qirc_ = $this->getVariable('fields'); goto pbOwG; K0nfb: foreach ($Qirc_ as $w_wjF) { $qqJ9g[$w_wjF['name']] = isset($w_wjF['defaultValue']) ? $w_wjF['defaultValue'] : null; } goto MgNQo; oX6Lo: } public function iconServer($xyEtj) { $this->addVariables(array('iconServer' => $xyEtj)); return $this; } public function fields($ib3B9) { goto D3UWI; LHvdd: $this->defaultValue($this->getDefaultValues()); goto kBCJf; kBCJf: return $this; goto qr_uu; D3UWI: $this->addVariables(array('fields' => $ib3B9)); goto LHvdd; qr_uu: } public function unserializeValue($ib3B9, AbstractField $pu1ro) { goto QbTHX; PVNQn: if (empty($ib3B9)) { $ib3B9 = new \stdClass(); } goto ERPeT; QbTHX: if (null === $ib3B9) { return $ib3B9; } goto ELOaH; ERPeT: return $ib3B9; goto cZiO2; ELOaH: $ib3B9 = @json_decode($ib3B9, true); goto PVNQn; cZiO2: } public function serializeValue($ib3B9, $nzuw7) { return json_encode($ib3B9, JSON_UNESCAPED_UNICODE); } public function prepareInput($ib3B9, $nzuw7) { goto sqHhj; LWDpX: if (empty($ib3B9)) { $ib3B9 = new \stdClass(); } goto G9NFM; G9NFM: return $ib3B9; goto gs9ul; sqHhj: $ib3B9 = @json_decode($ib3B9, true); goto LWDpX; gs9ul: } }