<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Field; use Illuminate\Support\Facades\View; class CustomField extends AbstractField { protected $value = array('type' => '', 'title' => '', 'data' => array('option' => array())); protected $listable = false; protected function setup() { $this->addVariables(array()); } public function unserializeValue($tzAUI, AbstractField $Q2vn5) { goto E0VTB; E0VTB: $tzAUI = @json_decode($tzAUI, true); goto bULVq; LaE7J: if (!isset($tzAUI['data'])) { $tzAUI['data'] = array(); } goto W61sK; W61sK: if (!isset($tzAUI['data']['option'])) { $tzAUI['data']['option'] = array(); } goto zeXEZ; jSSZ7: if (!isset($tzAUI['type'])) { $tzAUI['type'] = ''; } goto lUNYb; zeXEZ: return $tzAUI; goto pPgvP; lUNYb: if (!isset($tzAUI['title'])) { $tzAUI['title'] = ''; } goto LaE7J; bULVq: if (empty($tzAUI)) { $tzAUI = array(); } goto jSSZ7; pPgvP: } public function serializeValue($tzAUI, $pWRTh) { return json_encode($tzAUI); } public function prepareInput($tzAUI, $pWRTh) { goto kNOn6; kNOn6: $tzAUI = @json_decode($tzAUI, true); goto eXYZ8; cYzHw: return $tzAUI; goto FBlg0; eXYZ8: if (empty($tzAUI)) { $tzAUI = array(); } goto cYzHw; FBlg0: } public static function buildRecordNameValue($MU4vj, $rokAK, $DRhsw = 'fieldCustom', $WmASZ = 5) { goto iq_9M; uK221: for ($K3Ni_ = 1; $K3Ni_ <= $WmASZ; $K3Ni_++) { if (empty($MU4vj[$DRhsw . $K3Ni_])) { continue; } $l2LYK = @json_decode($MU4vj[$DRhsw . $K3Ni_], true); if (empty($l2LYK)) { continue; } $ZoqSQ[] = array('name' => $l2LYK['title'], 'value' => $rokAK[$DRhsw . $K3Ni_]); } goto gFhKs; iq_9M: $ZoqSQ = array(); goto uK221; gFhKs: return $ZoqSQ; goto WN9BM; WN9BM: } public static function unbuildTableFieldRow(&$Y0YxF, $DRhsw = 'fieldCustom', $WmASZ = 5) { goto jSauG; jSauG: $f15Vd = array(); goto X73NH; LMh_h: $Y0YxF['_' . $DRhsw] = $f15Vd; goto yG8sG; X73NH: for ($K3Ni_ = 1; $K3Ni_ <= $WmASZ; $K3Ni_++) { if (empty($Y0YxF[$DRhsw . $K3Ni_])) { continue; } $l2LYK = @json_decode($Y0YxF[$DRhsw . $K3Ni_], true); if (empty($l2LYK)) { continue; } $f15Vd[] = $l2LYK; } goto LMh_h; yG8sG: } public static function renderField($Q2vn5, $UHuqm) { if (empty($Q2vn5['type']) || empty($Q2vn5['title'])) { return ''; } return View::make('modstart::core.field.customField-render', array('fieldName' => $UHuqm, 'field' => $Q2vn5))->render(); } }