<?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($gwXrh) { $this->addVariables(array('keyPlaceholder' => $gwXrh)); return $this; } public function valuePlaceholder($gwXrh) { $this->addVariables(array('valuePlaceholder' => $gwXrh)); return $this; } public function keyTitle($gwXrh) { $this->addVariables(array('keyTitle' => $gwXrh)); return $this; } public function valueTitle($gwXrh) { $this->addVariables(array('valueTitle' => $gwXrh)); return $this; } public function keyLabel($pbxqW) { $this->addVariables(array('keyLabel' => $pbxqW)); return $this; } public function valueLabel($N6eIf) { $this->addVariables(array('valueLabel' => $N6eIf)); return $this; } public function unserializeValue($gwXrh, AbstractField $VWt5t) { goto mGicw; pevt7: if (empty($gwXrh)) { $gwXrh = array(); } goto sloLu; mGicw: if (null === $gwXrh) { return $gwXrh; } goto YBQIO; YBQIO: $gwXrh = @json_decode($gwXrh, true); goto pevt7; sloLu: return $gwXrh; goto jOOZd; jOOZd: } public function serializeValue($gwXrh, $uV19D) { return json_encode($gwXrh, JSON_UNESCAPED_UNICODE); } public function prepareInput($gwXrh, $uV19D) { goto hnxyt; WtCfR: return $gwXrh; goto Qv_F5; ENDRJ: if (empty($gwXrh)) { $gwXrh = array(); } goto WtCfR; hnxyt: $gwXrh = @json_decode($gwXrh, true); goto ENDRJ; Qv_F5: } }