<?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 X4KNz; X4KNz: $tB45T = $this->getVariable('fields'); goto H2ehb; hVR6M: foreach ($tB45T as $ZT1n0) { $PDSnF[$ZT1n0['name']] = isset($ZT1n0['defaultValue']) ? $ZT1n0['defaultValue'] : null; } goto WvF3B; H2ehb: $PDSnF = array(); goto hVR6M; WvF3B: return $PDSnF; goto QxFKS; QxFKS: } public function iconServer($GBwzV) { $this->addVariables(array('iconServer' => $GBwzV)); return $this; } public function fields($mdHu1) { goto jP50l; sNMFL: $this->defaultValue($this->getDefaultValues()); goto ydFm7; jP50l: $this->addVariables(array('fields' => $mdHu1)); goto sNMFL; ydFm7: return $this; goto UzciJ; UzciJ: } public function unserializeValue($mdHu1, AbstractField $Mk6lP) { goto ceMMY; ceMMY: if (null === $mdHu1) { return $mdHu1; } goto et3sY; et3sY: $mdHu1 = @json_decode($mdHu1, true); goto dFAtO; dFAtO: if (empty($mdHu1)) { $mdHu1 = new \stdClass(); } goto lAayK; lAayK: return $mdHu1; goto GKd_M; GKd_M: } public function serializeValue($mdHu1, $DRh9Q) { return json_encode($mdHu1, JSON_UNESCAPED_UNICODE); } public function prepareInput($mdHu1, $DRh9Q) { goto UZRMY; Rb9lT: return $mdHu1; goto kncqy; oo3GQ: if (empty($mdHu1)) { $mdHu1 = new \stdClass(); } goto Rb9lT; UZRMY: $mdHu1 = @json_decode($mdHu1, true); goto oo3GQ; kncqy: } }