<?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 HfZur; HfZur: static $GVDx3 = null; goto PXjOm; PXjOm: if (null === $GVDx3) { $ac3f3 = get_class($this); if (preg_match('/^Module\\\\([\\w]+).*?/', $ac3f3, $i5sAZ)) { $GVDx3 = $i5sAZ[1]; } else { if (method_exists($this, 'getCurrentModule')) { $GVDx3 = $this->getCurrentModule(); } else { $GVDx3 = ''; } } } goto jCkFe; jCkFe: return $GVDx3; goto aHzwI; aHzwI: } private function fetchViewPath($TIcMV, $M80Tt, $GVDx3, $AebKN, $r7m3R) { goto OY03s; T3Eih: if (view()->exists($Mmfy0)) { return $Mmfy0; } goto JrCzW; JrCzW: if (view()->exists($Z3qsz)) { return $Z3qsz; } goto O6qsW; c85Mi: return null; goto SNres; v2b2s: if (view()->exists($Lwynw)) { return $Lwynw; } goto c85Mi; OY03s: if (Str::contains($r7m3R, '::')) { return $r7m3R; } goto ktnyf; LumhV: $Z3qsz = "{$M80Tt}.{$AebKN}.{$r7m3R}"; goto cc6d0; UGfQ6: $Lwynw = "theme.default.{$AebKN}.{$r7m3R}"; goto T3Eih; O6qsW: if ($GVDx3) { if (view()->exists($LAJ4_)) { return $LAJ4_; } } goto v2b2s; cc6d0: if ($GVDx3) { $LAJ4_ = "module::{$GVDx3}.View.{$AebKN}.{$r7m3R}"; } goto UGfQ6; ktnyf: $Mmfy0 = "theme.{$TIcMV}.{$AebKN}.{$r7m3R}"; goto LumhV; SNres: } protected function viewPaths($r7m3R) { goto pmHQX; gGDAQ: View::share('_viewFrame', $Wv9dg); goto vRtIr; KPmw1: if ($this->isMobile()) { $IKqTA = $this->fetchViewPath($TIcMV, $M80Tt, $GVDx3, 'm', $r7m3R); $Wv9dg = $this->fetchViewPath($TIcMV, $M80Tt, $GVDx3, 'm', 'frame'); } goto IYm3i; V_EU0: $IKqTA = null; goto xh0V2; pmHQX: static $TIcMV = null; goto LvkSN; epGy0: if (empty($Wv9dg)) { $Wv9dg = $this->fetchViewPath($TIcMV, $M80Tt, $GVDx3, 'pc', 'frame'); } goto gGDAQ; XXXGN: if (null === $TIcMV) { goto oLWA2; TisDn: if ($ksqio && $ksqio->root()) { $M80Tt = $ksqio->root(); $TIcMV = $ksqio->name(); } else { $M80Tt = "theme.{$TIcMV}"; } goto HO3HW; ZxWWE: if (empty($ksqio)) { $vDQuJ = Session::get('msSiteTemplate', null); if (!empty($vDQuJ)) { $ksqio = SiteTemplateProvider::get($vDQuJ); if (empty($ksqio)) { Session::forget('msSiteTemplate'); } } } goto vlKfV; GGgyc: if (!empty($vDQuJ)) { $ksqio = SiteTemplateProvider::get($vDQuJ); if (!empty($ksqio)) { Session::put('msSiteTemplate', $vDQuJ); } } goto ZxWWE; vlKfV: $GVDx3 = $this->getModule(); goto gRgqI; HO3HW: Session::put('msSiteTemplateUsing', $TIcMV); goto YN65x; gRgqI: if (empty($ksqio)) { $TIcMV = modstart_config()->getWithEnv('siteTemplate', 'default'); $ksqio = SiteTemplateProvider::get($TIcMV); } goto TisDn; oLWA2: $vDQuJ = Input::get('msSiteTemplate', null); goto GGgyc; YN65x: } goto V_EU0; q1VQn: return array($IKqTA, $Wv9dg); goto Gjpmf; lONmi: static $M80Tt = null; goto XXXGN; LvkSN: static $ksqio = null; goto V09n6; vRtIr: BizException::throwsIfEmpty('View Not Exists : ' . $r7m3R, $IKqTA); goto q1VQn; xh0V2: $Wv9dg = null; goto KPmw1; IYm3i: if (empty($IKqTA)) { $IKqTA = $this->fetchViewPath($TIcMV, $M80Tt, $GVDx3, 'pc', $r7m3R); } goto epGy0; V09n6: static $GVDx3 = null; goto lONmi; Gjpmf: } protected function shareDialogPageViewFrame() { list($yCY8W, $n8Afx) = $this->viewPaths('dialogPage'); View::share('_viewFrameDialog', $yCY8W); } protected function view($r7m3R, $LBDnA = array()) { list($r7m3R, $kVLSz) = $this->viewPaths($r7m3R); return view($r7m3R, $LBDnA); } protected function viewRender($r7m3R, $LBDnA = array()) { list($r7m3R, $kVLSz) = $this->viewPaths($r7m3R); return view($r7m3R, $LBDnA)->render(); } protected function viewRealpath($r7m3R) { return View::getFinder()->find($r7m3R); } protected function isMobile() { return AgentUtil::isMobile(); } protected function isPC() { return AgentUtil::isPC(); } }