<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Field; use ModStart\Core\Util\SerializeUtil; class KeyValueList extends AbstractField { protected $width = 300; protected $listable = false; protected function setup() { $this->addVariables(array('keyTitle' => L('Key'), 'valueTitle' => L('Value'), 'keyPlaceholder' => L('Please Input'), 'valuePlaceholder' => L('Please Input'), 'keyLabel' => 'k', 'valueLabel' => 'v')); } public function keyPlaceholder($HDpl6) { $this->addVariables(array('keyPlaceholder' => $HDpl6)); return $this; } public function valuePlaceholder($HDpl6) { $this->addVariables(array('valuePlaceholder' => $HDpl6)); return $this; } public function keyTitle($HDpl6) { $this->addVariables(array('keyTitle' => $HDpl6)); return $this; } public function valueTitle($HDpl6) { $this->addVariables(array('valueTitle' => $HDpl6)); return $this; } public function keyLabel($xIHil) { $this->addVariables(array('keyLabel' => $xIHil)); return $this; } public function valueLabel($UOGW2) { $this->addVariables(array('valueLabel' => $UOGW2)); return $this; } public function unserializeValue($HDpl6, AbstractField $E8QRJ) { goto cAJp3; cAJp3: if (null === $HDpl6) { return $HDpl6; } goto Cg_T9; ti6Zz: if (empty($HDpl6)) { $HDpl6 = array(); } goto XS3TO; XS3TO: return $HDpl6; goto WsBnf; Cg_T9: $HDpl6 = @json_decode($HDpl6, true); goto ti6Zz; WsBnf: } public function serializeValue($HDpl6, $xTADA) { return SerializeUtil::jsonEncode($HDpl6); } public function prepareInput($HDpl6, $xTADA) { goto miy4J; qWXju: return $HDpl6; goto ET9pF; W6VIg: if (empty($HDpl6)) { $HDpl6 = array(); } goto qWXju; miy4J: $HDpl6 = @json_decode($HDpl6, true); goto W6VIg; ET9pF: } }