<?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($Gttsd) { $this->addVariables(array('keyPlaceholder' => $Gttsd)); return $this; } public function valuePlaceholder($Gttsd) { $this->addVariables(array('valuePlaceholder' => $Gttsd)); return $this; } public function keyTitle($Gttsd) { $this->addVariables(array('keyTitle' => $Gttsd)); return $this; } public function valueTitle($Gttsd) { $this->addVariables(array('valueTitle' => $Gttsd)); return $this; } public function keyLabel($WD1Yx) { $this->addVariables(array('keyLabel' => $WD1Yx)); return $this; } public function valueLabel($l_iaR) { $this->addVariables(array('valueLabel' => $l_iaR)); return $this; } public function unserializeValue($Gttsd, AbstractField $acdQI) { goto Ysx7K; P6Bx1: $Gttsd = @json_decode($Gttsd, true); goto xahHU; Ysx7K: if (null === $Gttsd) { return $Gttsd; } goto P6Bx1; dgnoY: return $Gttsd; goto i4WC_; xahHU: if (empty($Gttsd)) { $Gttsd = array(); } goto dgnoY; i4WC_: } public function serializeValue($Gttsd, $BWo2e) { return json_encode($Gttsd, JSON_UNESCAPED_UNICODE); } public function prepareInput($Gttsd, $BWo2e) { goto xlRN4; VGWZg: if (empty($Gttsd)) { $Gttsd = array(); } goto P6D_U; xlRN4: $Gttsd = @json_decode($Gttsd, true); goto VGWZg; P6D_U: return $Gttsd; goto SvcpD; SvcpD: } }