<?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($cBDsM) { $this->addVariables(array('keyPlaceholder' => $cBDsM)); return $this; } public function valuePlaceholder($cBDsM) { $this->addVariables(array('valuePlaceholder' => $cBDsM)); return $this; } public function keyTitle($cBDsM) { $this->addVariables(array('keyTitle' => $cBDsM)); return $this; } public function valueTitle($cBDsM) { $this->addVariables(array('valueTitle' => $cBDsM)); return $this; } public function keyLabel($Snc3e) { $this->addVariables(array('keyLabel' => $Snc3e)); return $this; } public function valueLabel($WO8H4) { $this->addVariables(array('valueLabel' => $WO8H4)); return $this; } public function unserializeValue($cBDsM, AbstractField $Ldet7) { goto Zs_c_; ccPhE: return $cBDsM; goto u4lyN; gej4L: $cBDsM = @json_decode($cBDsM, true); goto Qoxg3; Qoxg3: if (empty($cBDsM)) { $cBDsM = array(); } goto ccPhE; Zs_c_: if (null === $cBDsM) { return $cBDsM; } goto gej4L; u4lyN: } public function serializeValue($cBDsM, $GMqtO) { return SerializeUtil::jsonEncode($cBDsM); } public function prepareInput($cBDsM, $GMqtO) { goto uFFin; uFFin: $cBDsM = @json_decode($cBDsM, true); goto Br4tH; QRDWy: return $cBDsM; goto CdsGm; Br4tH: if (empty($cBDsM)) { $cBDsM = array(); } goto QRDWy; CdsGm: } }