<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Field; use ModStart\Core\Exception\BizException; class JsonIdItems extends AbstractField { const ITEM_STYLE_TITLE = 'title'; const ITEM_STYLE_COVER_TITLE = 'coverTitle'; protected function setup() { $this->addVariables(array('itemStyle' => self::ITEM_STYLE_TITLE, 'selectUrl' => modstart_admin_url('path/to/select'), 'previewUrl' => modstart_admin_url('path/to/preview'))); } public function itemStyle($wvO30) { $this->addVariables(array('itemStyle' => $wvO30)); return $this; } public function selectUrl($wvO30) { $this->addVariables(array('selectUrl' => $wvO30)); return $this; } public function previewUrl($wvO30) { $this->addVariables(array('previewUrl' => $wvO30)); return $this; } public function unserializeValue($wvO30, AbstractField $Lgjfa) { if (null === $wvO30) { return $wvO30; } return @json_decode($wvO30, true); } public function serializeValue($wvO30, $w5oww) { return json_encode($wvO30, JSON_UNESCAPED_UNICODE); } public function prepareInput($wvO30, $w5oww) { goto oWV9r; z7VJB: return $f8Hsc; goto CKXis; oWV9r: $f8Hsc = @json_decode($wvO30, true); goto KPSkf; KPSkf: BizException::throwsIf($this->label . ' ' . L('Json Format Error'), $wvO30 && null === $f8Hsc); goto z7VJB; CKXis: } }