<?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 yBzi8; ll0sp: if (null === $h8H9D) { $PbprP = get_class($this); if (preg_match('/^Module\\\\([\\w]+).*?/', $PbprP, $WpF0C)) { $h8H9D = $WpF0C[1]; } else { if (method_exists($this, 'getCurrentModule')) { $h8H9D = $this->getCurrentModule(); } else { $h8H9D = ''; } } } goto z8stu; z8stu: return $h8H9D; goto XBQg7; yBzi8: static $h8H9D = null; goto ll0sp; XBQg7: } private function fetchViewPath($cHUgA, $w6iTl, $h8H9D, $wk1ql, $XlNhR) { goto feEL9; nY5l7: if (view()->exists($IHyEQ)) { return $IHyEQ; } goto NcqC2; o7bqk: if (view()->exists($Q_hi1)) { return $Q_hi1; } goto pMos3; feEL9: if (Str::contains($XlNhR, '::')) { return $XlNhR; } goto c6waB; eJ44k: $IHyEQ = "theme.default.{$wk1ql}.{$XlNhR}"; goto o7bqk; pMos3: if (view()->exists($Cnv9V)) { return $Cnv9V; } goto QoBCZ; QoBCZ: if ($h8H9D) { if (view()->exists($V_LRJ)) { return $V_LRJ; } } goto nY5l7; eKJ7o: if ($h8H9D) { $V_LRJ = "module::{$h8H9D}.View.{$wk1ql}.{$XlNhR}"; } goto eJ44k; NcqC2: return null; goto bIuS2; Q9fhb: $Cnv9V = "{$w6iTl}.{$wk1ql}.{$XlNhR}"; goto eKJ7o; c6waB: $Q_hi1 = "theme.{$cHUgA}.{$wk1ql}.{$XlNhR}"; goto Q9fhb; bIuS2: } protected function viewPaths($XlNhR) { goto TImc3; TImc3: static $cHUgA = null; goto LE1cF; UzUth: $qOgas = null; goto GJWMm; gWB5l: if (null === $cHUgA) { goto kpAHa; cBHfW: if (empty($QsTug)) { $t290O = Session::get('msSiteTemplate', null); if (!empty($t290O)) { $QsTug = SiteTemplateProvider::get($t290O); if (empty($QsTug)) { Session::forget('msSiteTemplate'); } } } goto xbOt2; Dxvtu: if (empty($QsTug)) { $cHUgA = modstart_config()->getWithEnv('siteTemplate', 'default'); $QsTug = SiteTemplateProvider::get($cHUgA); } goto VSS8r; Jwc1p: if (!empty($t290O)) { $QsTug = SiteTemplateProvider::get($t290O); if (!empty($QsTug)) { Session::put('msSiteTemplate', $t290O); } } goto cBHfW; VSS8r: if ($QsTug && $QsTug->root()) { $w6iTl = $QsTug->root(); $cHUgA = $QsTug->name(); } else { $w6iTl = "theme.{$cHUgA}"; } goto YybKE; xbOt2: $h8H9D = $this->getModule(); goto Dxvtu; YybKE: Session::put('msSiteTemplateUsing', $cHUgA); goto LZfeD; kpAHa: $t290O = Input::get('msSiteTemplate', null); goto Jwc1p; LZfeD: } goto fiYe2; HbcwM: if (empty($Ul2PZ)) { $Ul2PZ = $this->fetchViewPath($cHUgA, $w6iTl, $h8H9D, 'pc', $XlNhR); } goto N9GHQ; fiYe2: $Ul2PZ = null; goto UzUth; LE1cF: static $QsTug = null; goto Jf5GB; eu2sf: return array($Ul2PZ, $qOgas); goto Ll6T1; GJWMm: if ($this->isMobile()) { $Ul2PZ = $this->fetchViewPath($cHUgA, $w6iTl, $h8H9D, 'm', $XlNhR); $qOgas = $this->fetchViewPath($cHUgA, $w6iTl, $h8H9D, 'm', 'frame'); } goto HbcwM; KSuLM: BizException::throwsIfEmpty('View Not Exists : ' . $XlNhR, $Ul2PZ); goto eu2sf; Jf5GB: static $h8H9D = null; goto Za1Sp; ZixRR: View::share('_viewFrame', $qOgas); goto KSuLM; N9GHQ: if (empty($qOgas)) { $qOgas = $this->fetchViewPath($cHUgA, $w6iTl, $h8H9D, 'pc', 'frame'); } goto ZixRR; Za1Sp: static $w6iTl = null; goto gWB5l; Ll6T1: } protected function shareDialogPageViewFrame() { list($Bgrhp, $vn2QN) = $this->viewPaths('dialogPage'); View::share('_viewFrameDialog', $Bgrhp); } protected function view($XlNhR, $rdbBP = array()) { list($XlNhR, $axwm1) = $this->viewPaths($XlNhR); return view($XlNhR, $rdbBP); } protected function viewRender($XlNhR, $rdbBP = array()) { list($XlNhR, $axwm1) = $this->viewPaths($XlNhR); return view($XlNhR, $rdbBP)->render(); } protected function viewRealpath($XlNhR) { return View::getFinder()->find($XlNhR); } protected function isMobile() { return AgentUtil::isMobile(); } protected function isPC() { return AgentUtil::isPC(); } }