<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\View; use Illuminate\Support\Facades\Input; use Illuminate\Support\Facades\Session; use Illuminate\Support\Facades\View; use Illuminate\Support\Str; use ModStart\Core\Exception\BizException; use ModStart\Core\Util\AgentUtil; use Module\Vendor\Provider\SiteTemplate\SiteTemplateProvider; trait ResponsiveViewTrait { protected $_viewBase = null; public function getModule() { goto P6hYK; B_VsE: if (null === $oXHYw) { $ottBC = get_class($this); if (preg_match('/^Module\\\\([\\w]+).*?/', $ottBC, $S8gta)) { $oXHYw = $S8gta[1]; } else { if (method_exists($this, 'getCurrentModule')) { $oXHYw = $this->getCurrentModule(); } else { $oXHYw = ''; } } } goto r2AiQ; P6hYK: static $oXHYw = null; goto B_VsE; r2AiQ: return $oXHYw; goto zcbnC; zcbnC: } private function fetchViewPath($U5_Jj, $iXOwY, $oXHYw, $NURUo, $x0USf) { goto N34RG; BBA4z: if (view()->exists($f4JfX)) { return $f4JfX; } goto lpNgB; xozW1: if ($oXHYw) { $ygxBq = "module::{$oXHYw}.View.{$NURUo}.{$x0USf}"; } goto JLQal; tepGZ: if (view()->exists($m5Brv)) { return $m5Brv; } goto wPfvF; Wj5xn: if (view()->exists($L2xn4)) { return $L2xn4; } goto tepGZ; QEskY: $m5Brv = "{$iXOwY}.{$NURUo}.{$x0USf}"; goto xozW1; wPfvF: if ($oXHYw) { if (view()->exists($ygxBq)) { return $ygxBq; } } goto BBA4z; N34RG: if (Str::contains($x0USf, '::')) { return $x0USf; } goto anvmN; JLQal: $f4JfX = "theme.default.{$NURUo}.{$x0USf}"; goto Wj5xn; lpNgB: return null; goto XNruE; anvmN: $L2xn4 = "theme.{$U5_Jj}.{$NURUo}.{$x0USf}"; goto QEskY; XNruE: } protected function viewPaths($x0USf) { goto hkLHy; T27YI: static $oXHYw = null; goto opCcZ; MbVxA: return array($jv7l2, $De1iN); goto Ju2xh; pbYat: if (null === $U5_Jj) { goto ZUQRC; vUqAg: Session::put('msSiteTemplateUsing', $U5_Jj); goto GV6U5; CbfCQ: if ($geCFR && $geCFR->root()) { $iXOwY = $geCFR->root(); $U5_Jj = $geCFR->name(); } else { $iXOwY = "theme.{$U5_Jj}"; } goto vUqAg; OeOhb: if (empty($geCFR)) { $B0tr0 = Session::get('msSiteTemplate', null); if (!empty($B0tr0)) { $geCFR = SiteTemplateProvider::get($B0tr0); if (empty($geCFR)) { Session::forget('msSiteTemplate'); } } } goto BZ31a; DbGe4: if (empty($geCFR)) { $U5_Jj = modstart_config()->getWithEnv('siteTemplate', 'default'); $geCFR = SiteTemplateProvider::get($U5_Jj); } goto CbfCQ; mHlIj: if (!empty($B0tr0)) { $geCFR = SiteTemplateProvider::get($B0tr0); if (!empty($geCFR)) { Session::put('msSiteTemplate', $B0tr0); } } goto OeOhb; ZUQRC: $B0tr0 = Input::get('msSiteTemplate', null); goto mHlIj; BZ31a: $oXHYw = $this->getModule(); goto DbGe4; GV6U5: } goto Z2uA4; hkLHy: static $U5_Jj = null; goto XQFIY; d4Ql4: $De1iN = null; goto QP2jm; opCcZ: static $iXOwY = null; goto pbYat; QP2jm: if ($this->isMobile()) { $jv7l2 = $this->fetchViewPath($U5_Jj, $iXOwY, $oXHYw, 'm', $x0USf); $De1iN = $this->fetchViewPath($U5_Jj, $iXOwY, $oXHYw, 'm', 'frame'); } goto UBXVg; Z2uA4: $jv7l2 = null; goto d4Ql4; UBXVg: if (empty($jv7l2)) { $jv7l2 = $this->fetchViewPath($U5_Jj, $iXOwY, $oXHYw, 'pc', $x0USf); } goto UrZS0; XQFIY: static $geCFR = null; goto T27YI; UrZS0: if (empty($De1iN)) { $De1iN = $this->fetchViewPath($U5_Jj, $iXOwY, $oXHYw, 'pc', 'frame'); } goto UnUT5; Dukam: BizException::throwsIfEmpty('View Not Exists : ' . $x0USf, $jv7l2); goto MbVxA; UnUT5: View::share('_viewFrame', $De1iN); goto Dukam; Ju2xh: } protected function shareDialogPageViewFrame() { list($AUg8h, $n_Lkt) = $this->viewPaths('dialogPage'); View::share('_viewFrameDialog', $AUg8h); } protected function view($x0USf, $hZhe1 = array()) { list($x0USf, $pdaZl) = $this->viewPaths($x0USf); return view($x0USf, $hZhe1); } protected function viewRender($x0USf, $hZhe1 = array()) { list($x0USf, $pdaZl) = $this->viewPaths($x0USf); return view($x0USf, $hZhe1)->render(); } protected function viewRealpath($x0USf) { return View::getFinder()->find($x0USf); } protected function isMobile() { return AgentUtil::isMobile(); } protected function isPC() { return AgentUtil::isPC(); } }