<?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($Mczr_) { $this->addVariables(array('keyPlaceholder' => $Mczr_)); return $this; } public function valuePlaceholder($Mczr_) { $this->addVariables(array('valuePlaceholder' => $Mczr_)); return $this; } public function keyTitle($Mczr_) { $this->addVariables(array('keyTitle' => $Mczr_)); return $this; } public function valueTitle($Mczr_) { $this->addVariables(array('valueTitle' => $Mczr_)); return $this; } public function keyLabel($cOUzP) { $this->addVariables(array('keyLabel' => $cOUzP)); return $this; } public function valueLabel($UZK0z) { $this->addVariables(array('valueLabel' => $UZK0z)); return $this; } public function unserializeValue($Mczr_, AbstractField $rZfgs) { goto wVZfB; WKt0P: return $Mczr_; goto iBSHk; CFdo9: $Mczr_ = @json_decode($Mczr_, true); goto uaL3i; uaL3i: if (empty($Mczr_)) { $Mczr_ = array(); } goto WKt0P; wVZfB: if (null === $Mczr_) { return $Mczr_; } goto CFdo9; iBSHk: } public function serializeValue($Mczr_, $vn_cr) { return SerializeUtil::jsonEncode($Mczr_); } public function prepareInput($Mczr_, $vn_cr) { goto ZajiP; I6F20: if (empty($Mczr_)) { $Mczr_ = array(); } goto XVIeB; XVIeB: return $Mczr_; goto DLXhx; ZajiP: $Mczr_ = @json_decode($Mczr_, true); goto I6F20; DLXhx: } }