<?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 ZLfXG; mQIOS: return $CiBrR; goto L2azl; pwuXV: if (null === $CiBrR) { $q5sLX = get_class($this); if (preg_match('/^Module\\\\([\\w]+).*?/', $q5sLX, $eG2e9)) { $CiBrR = $eG2e9[1]; } else { if (method_exists($this, 'getCurrentModule')) { $CiBrR = $this->getCurrentModule(); } else { $CiBrR = ''; } } } goto mQIOS; ZLfXG: static $CiBrR = null; goto pwuXV; L2azl: } private function fetchViewPath($CbPJ0, $x7avL, $CiBrR, $SHjrg, $Etyzz) { goto ReVmx; grj06: if (view()->exists($GwD03)) { return $GwD03; } goto fAJTr; L2cPK: return null; goto Yowiz; NDiqv: if (view()->exists($mg1xE)) { return $mg1xE; } goto grj06; TdBmB: if ($CiBrR) { $H4cQG = "module::{$CiBrR}.View.{$SHjrg}.{$Etyzz}"; } goto yXdi_; yXdi_: $ZC4ZT = "theme.default.{$SHjrg}.{$Etyzz}"; goto NDiqv; ReVmx: if (Str::contains($Etyzz, '::')) { return $Etyzz; } goto DAPwg; Oztr3: $GwD03 = "{$x7avL}.{$SHjrg}.{$Etyzz}"; goto TdBmB; DAPwg: $mg1xE = "theme.{$CbPJ0}.{$SHjrg}.{$Etyzz}"; goto Oztr3; fAJTr: if ($CiBrR) { if (view()->exists($H4cQG)) { return $H4cQG; } } goto M9aVa; M9aVa: if (view()->exists($ZC4ZT)) { return $ZC4ZT; } goto L2cPK; Yowiz: } protected function viewPaths($Etyzz) { goto cADBq; K0dX7: $G_mI6 = null; goto fB912; fB912: $pOc1Y = null; goto Uwoiq; Uwoiq: if ($this->isMobile()) { $G_mI6 = $this->fetchViewPath($CbPJ0, $x7avL, $CiBrR, 'm', $Etyzz); $pOc1Y = $this->fetchViewPath($CbPJ0, $x7avL, $CiBrR, 'm', 'frame'); } goto G1s_K; yM3uN: View::share('_viewFrame', $pOc1Y); goto YSel5; nws0a: if (empty($pOc1Y)) { $pOc1Y = $this->fetchViewPath($CbPJ0, $x7avL, $CiBrR, 'pc', 'frame'); } goto yM3uN; cADBq: static $CbPJ0 = null; goto ZBC7x; TGBSX: return array($G_mI6, $pOc1Y); goto hMeXU; Z8Qs3: static $CiBrR = null; goto jdcbg; jdcbg: static $x7avL = null; goto YTu20; YSel5: BizException::throwsIfEmpty('View Not Exists : ' . $Etyzz, $G_mI6); goto TGBSX; YTu20: if (null === $CbPJ0) { goto sJP_b; MiJgH: $CiBrR = $this->getModule(); goto qLR8k; YEGoi: if (empty($RMN4M)) { $WhYC0 = Session::get('msSiteTemplate', null); if (!empty($WhYC0)) { $RMN4M = SiteTemplateProvider::get($WhYC0); if (empty($RMN4M)) { Session::forget('msSiteTemplate'); } } } goto MiJgH; pHEt_: if ($RMN4M && $RMN4M->root()) { $x7avL = $RMN4M->root(); $CbPJ0 = $RMN4M->name(); } else { $x7avL = "theme.{$CbPJ0}"; } goto dftLZ; qLR8k: if (empty($RMN4M)) { $CbPJ0 = modstart_config()->getWithEnv('siteTemplate', 'default'); $RMN4M = SiteTemplateProvider::get($CbPJ0); } goto pHEt_; dftLZ: Session::put('msSiteTemplateUsing', $CbPJ0); goto KEprH; XIGG1: if (!empty($WhYC0)) { $RMN4M = SiteTemplateProvider::get($WhYC0); if (!empty($RMN4M)) { Session::put('msSiteTemplate', $WhYC0); } } goto YEGoi; sJP_b: $WhYC0 = Input::get('msSiteTemplate', null); goto XIGG1; KEprH: } goto K0dX7; ZBC7x: static $RMN4M = null; goto Z8Qs3; G1s_K: if (empty($G_mI6)) { $G_mI6 = $this->fetchViewPath($CbPJ0, $x7avL, $CiBrR, 'pc', $Etyzz); } goto nws0a; hMeXU: } protected function shareDialogPageViewFrame() { list($bQ_Vl, $c3VW7) = $this->viewPaths('dialogPage'); View::share('_viewFrameDialog', $bQ_Vl); } protected function view($Etyzz, $TC00B = array()) { list($Etyzz, $TkE_3) = $this->viewPaths($Etyzz); return view($Etyzz, $TC00B); } protected function viewRender($Etyzz, $TC00B = array()) { list($Etyzz, $TkE_3) = $this->viewPaths($Etyzz); return view($Etyzz, $TC00B)->render(); } protected function viewRealpath($Etyzz) { return View::getFinder()->find($Etyzz); } protected function isMobile() { return AgentUtil::isMobile(); } protected function isPC() { return AgentUtil::isPC(); } }