<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Field; use ModStart\Core\Exception\BizException; use ModStart\Core\Util\SerializeUtil; 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($HDpl6) { $this->addVariables(array('itemStyle' => $HDpl6)); return $this; } public function selectUrl($HDpl6) { $this->addVariables(array('selectUrl' => $HDpl6)); return $this; } public function previewUrl($HDpl6) { $this->addVariables(array('previewUrl' => $HDpl6)); return $this; } public function unserializeValue($HDpl6, AbstractField $E8QRJ) { if (null === $HDpl6) { return $HDpl6; } return @json_decode($HDpl6, true); } public function serializeValue($HDpl6, $xTADA) { return SerializeUtil::jsonEncode($HDpl6); } public function prepareInput($HDpl6, $xTADA) { goto A52f3; N_TBf: BizException::throwsIf($this->label . ' ' . L('Json Format Error'), $HDpl6 && null === $Ese1E); goto yXjUT; yXjUT: return $Ese1E; goto DwzK5; A52f3: $Ese1E = @json_decode($HDpl6, true); goto N_TBf; DwzK5: } }