<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Field; 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($mdHu1) { $this->addVariables(array('keyPlaceholder' => $mdHu1)); return $this; } public function valuePlaceholder($mdHu1) { $this->addVariables(array('valuePlaceholder' => $mdHu1)); return $this; } public function keyTitle($mdHu1) { $this->addVariables(array('keyTitle' => $mdHu1)); return $this; } public function valueTitle($mdHu1) { $this->addVariables(array('valueTitle' => $mdHu1)); return $this; } public function keyLabel($BsUs2) { $this->addVariables(array('keyLabel' => $BsUs2)); return $this; } public function valueLabel($MdVHO) { $this->addVariables(array('valueLabel' => $MdVHO)); return $this; } public function unserializeValue($mdHu1, AbstractField $Mk6lP) { goto yJhIR; q83nJ: return $mdHu1; goto SdN7J; yJhIR: if (null === $mdHu1) { return $mdHu1; } goto Wp2n0; Wp2n0: $mdHu1 = @json_decode($mdHu1, true); goto Xp9e7; Xp9e7: if (empty($mdHu1)) { $mdHu1 = array(); } goto q83nJ; SdN7J: } public function serializeValue($mdHu1, $DRh9Q) { return json_encode($mdHu1, JSON_UNESCAPED_UNICODE); } public function prepareInput($mdHu1, $DRh9Q) { goto lvejb; TysYA: return $mdHu1; goto Bs27E; kkRNR: if (empty($mdHu1)) { $mdHu1 = array(); } goto TysYA; lvejb: $mdHu1 = @json_decode($mdHu1, true); goto kkRNR; Bs27E: } }