<?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 xSXaK; xSXaK: static $satFX = null; goto L3K5c; L3K5c: if (null === $satFX) { $fUMA5 = get_class($this); if (preg_match('/^Module\\\\([\\w]+).*?/', $fUMA5, $EbeBB)) { $satFX = $EbeBB[1]; } else { if (method_exists($this, 'getCurrentModule')) { $satFX = $this->getCurrentModule(); } else { $satFX = ''; } } } goto dny6X; dny6X: return $satFX; goto C5CV2; C5CV2: } private function fetchViewPath($ihgSy, $jpNhe, $satFX, $KEVc7, $d1G11) { goto GhlNb; brtHC: if ($satFX) { if (view()->exists($ftrEG)) { return $ftrEG; } } goto FFnRr; rRr6Q: if (view()->exists($nSAM9)) { return $nSAM9; } goto brtHC; GhlNb: if (Str::contains($d1G11, '::')) { return $d1G11; } goto GxZII; FcnPF: return null; goto Ix1rf; mWxI3: if ($satFX) { $ftrEG = "module::{$satFX}.View.{$KEVc7}.{$d1G11}"; } goto XPksO; FFnRr: if (view()->exists($l4Oni)) { return $l4Oni; } goto FcnPF; GxZII: $zgJ9p = "theme.{$ihgSy}.{$KEVc7}.{$d1G11}"; goto PvRkC; TRrkd: if (view()->exists($zgJ9p)) { return $zgJ9p; } goto rRr6Q; PvRkC: $nSAM9 = "{$jpNhe}.{$KEVc7}.{$d1G11}"; goto mWxI3; XPksO: $l4Oni = "theme.default.{$KEVc7}.{$d1G11}"; goto TRrkd; Ix1rf: } protected function viewPaths($d1G11) { goto Y_dIN; Xxpv7: static $satFX = null; goto oOUGe; zTXOz: if (null === $ihgSy) { goto kIzAF; AMyGr: if (empty($cCkMh)) { $ihgSy = modstart_config()->getWithEnv('siteTemplate', 'default'); $cCkMh = SiteTemplateProvider::get($ihgSy); } goto JpU5q; VjiTX: $satFX = $this->getModule(); goto AMyGr; Ge666: if (empty($cCkMh)) { $w2uSl = Session::get('msSiteTemplate', null); if (!empty($w2uSl)) { $cCkMh = SiteTemplateProvider::get($w2uSl); if (empty($cCkMh)) { Session::forget('msSiteTemplate'); } } } goto VjiTX; mwY17: if (!empty($w2uSl)) { $cCkMh = SiteTemplateProvider::get($w2uSl); if (!empty($cCkMh)) { Session::put('msSiteTemplate', $w2uSl); } } goto Ge666; kIzAF: $w2uSl = Input::get('msSiteTemplate', null); goto mwY17; kmHkS: Session::put('msSiteTemplateUsing', $ihgSy); goto fvvU5; JpU5q: if ($cCkMh && $cCkMh->root()) { $jpNhe = $cCkMh->root(); $ihgSy = $cCkMh->name(); } else { $jpNhe = "theme.{$ihgSy}"; } goto kmHkS; fvvU5: } goto Qe0yC; elVJZ: if (empty($pNJxA)) { $pNJxA = $this->fetchViewPath($ihgSy, $jpNhe, $satFX, 'pc', $d1G11); } goto rkrn9; jHvpF: $f7Inc = null; goto YsrnV; Qe0yC: $pNJxA = null; goto jHvpF; dhHgb: static $cCkMh = null; goto Xxpv7; YsrnV: if ($this->isMobile()) { $pNJxA = $this->fetchViewPath($ihgSy, $jpNhe, $satFX, 'm', $d1G11); $f7Inc = $this->fetchViewPath($ihgSy, $jpNhe, $satFX, 'm', 'frame'); } goto elVJZ; CwVsk: return array($pNJxA, $f7Inc); goto TaaUi; BkCXY: BizException::throwsIfEmpty('View Not Exists : ' . $d1G11, $pNJxA); goto CwVsk; V6FlD: View::share('_viewFrame', $f7Inc); goto BkCXY; rkrn9: if (empty($f7Inc)) { $f7Inc = $this->fetchViewPath($ihgSy, $jpNhe, $satFX, 'pc', 'frame'); } goto V6FlD; Y_dIN: static $ihgSy = null; goto dhHgb; oOUGe: static $jpNhe = null; goto zTXOz; TaaUi: } protected function shareDialogPageViewFrame() { list($Sp2s1, $FfhzE) = $this->viewPaths('dialogPage'); View::share('_viewFrameDialog', $Sp2s1); } protected function view($d1G11, $SiBmR = array()) { list($d1G11, $cUd5o) = $this->viewPaths($d1G11); return view($d1G11, $SiBmR); } protected function viewRender($d1G11, $SiBmR = array()) { list($d1G11, $cUd5o) = $this->viewPaths($d1G11); return view($d1G11, $SiBmR)->render(); } protected function viewRealpath($d1G11) { return View::getFinder()->find($d1G11); } protected function isMobile() { return AgentUtil::isMobile(); } protected function isPC() { return AgentUtil::isPC(); } }