<?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($FT9zA) { $this->addVariables(array('itemStyle' => $FT9zA)); return $this; } public function selectUrl($FT9zA) { $this->addVariables(array('selectUrl' => $FT9zA)); return $this; } public function previewUrl($FT9zA) { $this->addVariables(array('previewUrl' => $FT9zA)); return $this; } public function unserializeValue($FT9zA, AbstractField $SQ6_6) { return @json_decode($FT9zA, true); } public function serializeValue($FT9zA, $TAWWJ) { return json_encode($FT9zA, JSON_UNESCAPED_UNICODE); } public function prepareInput($FT9zA, $TAWWJ) { goto kiynM; sBXtw: return $c8Hgd; goto FyB9l; kiynM: $c8Hgd = @json_decode($FT9zA, true); goto yHo_0; yHo_0: BizException::throwsIf($this->label . ' ' . L('Json Format Error'), $FT9zA && null === $c8Hgd); goto sBXtw; FyB9l: } }