<?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 jBCHc; YkHaP: return $vbusR; goto NfGfE; J0cbS: if (null === $vbusR) { $nsF6n = get_class($this); if (preg_match('/^Module\\\\([\\w]+).*?/', $nsF6n, $FH50y)) { $vbusR = $FH50y[1]; } else { if (method_exists($this, 'getCurrentModule')) { $vbusR = $this->getCurrentModule(); } else { $vbusR = ''; } } } goto YkHaP; jBCHc: static $vbusR = null; goto J0cbS; NfGfE: } private function fetchViewPath($ANoDZ, $maIdR, $vbusR, $vSWeb, $EdxNA) { goto qWPjV; RsVhk: $eiKSW = "theme.{$ANoDZ}.{$vSWeb}.{$EdxNA}"; goto OT7c2; gakFN: return null; goto AUgUm; aaLxn: if (view()->exists($eiKSW)) { return $eiKSW; } goto U6gQj; U6gQj: if (view()->exists($aR6BH)) { return $aR6BH; } goto x2tDn; OT7c2: $aR6BH = "{$maIdR}.{$vSWeb}.{$EdxNA}"; goto l1oBK; Nx5OL: $zJUHi = "theme.default.{$vSWeb}.{$EdxNA}"; goto aaLxn; VawaT: if (view()->exists($zJUHi)) { return $zJUHi; } goto gakFN; qWPjV: if (Str::contains($EdxNA, '::')) { return $EdxNA; } goto RsVhk; l1oBK: if ($vbusR) { $G5DmA = "module::{$vbusR}.View.{$vSWeb}.{$EdxNA}"; } goto Nx5OL; x2tDn: if ($vbusR) { if (view()->exists($G5DmA)) { return $G5DmA; } } goto VawaT; AUgUm: } protected function viewPaths($EdxNA) { goto W_Lr1; Gx2uy: if ($this->isMobile()) { $bu1D2 = $this->fetchViewPath($ANoDZ, $maIdR, $vbusR, 'm', $EdxNA); $Q0sP2 = $this->fetchViewPath($ANoDZ, $maIdR, $vbusR, 'm', 'frame'); } goto Y1Txv; pBg9p: if (null === $ANoDZ) { goto sdreR; TSd1N: $vbusR = $this->getModule(); goto o6qHG; zk5gZ: if (!empty($WKwBW)) { $gzdnL = SiteTemplateProvider::get($WKwBW); if (!empty($gzdnL)) { Session::put('msSiteTemplate', $WKwBW); } } goto UDBP7; sdreR: $WKwBW = Input::get('msSiteTemplate', null); goto zk5gZ; Lnopc: if ($gzdnL && $gzdnL->root()) { $maIdR = $gzdnL->root(); $ANoDZ = $gzdnL->name(); } else { $maIdR = "theme.{$ANoDZ}"; } goto EduXT; EduXT: Session::put('msSiteTemplateUsing', $ANoDZ); goto F1S_P; UDBP7: if (empty($gzdnL)) { $WKwBW = Session::get('msSiteTemplate', null); if (!empty($WKwBW)) { $gzdnL = SiteTemplateProvider::get($WKwBW); if (empty($gzdnL)) { Session::forget('msSiteTemplate'); } } } goto TSd1N; o6qHG: if (empty($gzdnL)) { $ANoDZ = modstart_config()->getWithEnv('siteTemplate', 'default'); $gzdnL = SiteTemplateProvider::get($ANoDZ); } goto Lnopc; F1S_P: } goto ywNMb; WA_As: static $vbusR = null; goto bDET9; AE96c: View::share('_viewFrame', $Q0sP2); goto unaSw; unaSw: BizException::throwsIfEmpty('View Not Exists : ' . $EdxNA, $bu1D2); goto h_022; W_Lr1: static $ANoDZ = null; goto IQlqC; bDET9: static $maIdR = null; goto pBg9p; jQsEd: $Q0sP2 = null; goto Gx2uy; IQlqC: static $gzdnL = null; goto WA_As; Y1Txv: if (empty($bu1D2)) { $bu1D2 = $this->fetchViewPath($ANoDZ, $maIdR, $vbusR, 'pc', $EdxNA); } goto fK0t4; ywNMb: $bu1D2 = null; goto jQsEd; h_022: return array($bu1D2, $Q0sP2); goto YOhna; fK0t4: if (empty($Q0sP2)) { $Q0sP2 = $this->fetchViewPath($ANoDZ, $maIdR, $vbusR, 'pc', 'frame'); } goto AE96c; YOhna: } protected function shareDialogPageViewFrame() { list($zUl05, $DdWoI) = $this->viewPaths('dialogPage'); View::share('_viewFrameDialog', $zUl05); } protected function view($EdxNA, $WYcT2 = array()) { list($EdxNA, $Wr_Le) = $this->viewPaths($EdxNA); return view($EdxNA, $WYcT2); } protected function viewRender($EdxNA, $WYcT2 = array()) { list($EdxNA, $Wr_Le) = $this->viewPaths($EdxNA); return view($EdxNA, $WYcT2)->render(); } protected function viewRealpath($EdxNA) { return View::getFinder()->find($EdxNA); } protected function isMobile() { return AgentUtil::isMobile(); } protected function isPC() { return AgentUtil::isPC(); } }