<?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 sM7YI; W4dSi: if (null === $tUxPr) { $qeBS4 = get_class($this); if (preg_match('/^Module\\\\([\\w]+).*?/', $qeBS4, $H_mB1)) { $tUxPr = $H_mB1[1]; } else { if (method_exists($this, 'getCurrentModule')) { $tUxPr = $this->getCurrentModule(); } else { $tUxPr = ''; } } } goto TjwY8; sM7YI: static $tUxPr = null; goto W4dSi; TjwY8: return $tUxPr; goto XbcPH; XbcPH: } private function fetchViewPath($x4t3E, $Grm92, $tUxPr, $qjZRc, $FOcXW) { goto q8pu2; OXu2w: if ($tUxPr) { if (view()->exists($A5wrE)) { return $A5wrE; } } goto Yc3JF; MSwBL: if ($tUxPr) { $A5wrE = "module::{$tUxPr}.View.{$qjZRc}.{$FOcXW}"; } goto fdPc8; FLChO: if (view()->exists($LVZN0)) { return $LVZN0; } goto yv3NW; yP7Fb: return null; goto sZYZ1; yv3NW: if (view()->exists($wnFju)) { return $wnFju; } goto OXu2w; fdPc8: $gAVSG = "theme.default.{$qjZRc}.{$FOcXW}"; goto FLChO; q8pu2: if (Str::contains($FOcXW, '::')) { return $FOcXW; } goto CzAS2; Yc3JF: if (view()->exists($gAVSG)) { return $gAVSG; } goto yP7Fb; q8dmf: $wnFju = "{$Grm92}.{$qjZRc}.{$FOcXW}"; goto MSwBL; CzAS2: $LVZN0 = "theme.{$x4t3E}.{$qjZRc}.{$FOcXW}"; goto q8dmf; sZYZ1: } protected function viewPaths($FOcXW) { goto PdPV2; q1uZw: BizException::throwsIfEmpty('View Not Exists : ' . $FOcXW, $vdYPb); goto dvjTz; OKSqx: $lE4xP = null; goto pumAL; TqH49: if (empty($lE4xP)) { $lE4xP = $this->fetchViewPath($x4t3E, $Grm92, $tUxPr, 'pc', 'frame'); } goto BFNKQ; pumAL: if ($this->isMobile()) { $vdYPb = $this->fetchViewPath($x4t3E, $Grm92, $tUxPr, 'm', $FOcXW); $lE4xP = $this->fetchViewPath($x4t3E, $Grm92, $tUxPr, 'm', 'frame'); } goto VEKS8; dvjTz: return array($vdYPb, $lE4xP); goto jSxtG; stZdy: static $tUxPr = null; goto g0VcG; VEKS8: if (empty($vdYPb)) { $vdYPb = $this->fetchViewPath($x4t3E, $Grm92, $tUxPr, 'pc', $FOcXW); } goto TqH49; BFNKQ: View::share('_viewFrame', $lE4xP); goto q1uZw; v7Fv4: $vdYPb = null; goto OKSqx; PdPV2: static $x4t3E = null; goto nPmSc; nPmSc: static $reHGq = null; goto stZdy; g0VcG: static $Grm92 = null; goto Aw0pe; Aw0pe: if (null === $x4t3E) { goto lG3wB; pzNJD: $tUxPr = $this->getModule(); goto ytN7Z; eEjvv: if (!empty($MCi0I)) { $reHGq = SiteTemplateProvider::get($MCi0I); if (!empty($reHGq)) { Session::put('msSiteTemplate', $MCi0I); } } goto s9TXB; lG3wB: $MCi0I = Input::get('msSiteTemplate', null); goto eEjvv; Eh_k0: Session::put('msSiteTemplateUsing', $x4t3E); goto ZiKAK; BqpKZ: if ($reHGq && $reHGq->root()) { $Grm92 = $reHGq->root(); $x4t3E = $reHGq->name(); } else { $Grm92 = "theme.{$x4t3E}"; } goto Eh_k0; ytN7Z: if (empty($reHGq)) { $x4t3E = modstart_config()->getWithEnv('siteTemplate', 'default'); $reHGq = SiteTemplateProvider::get($x4t3E); } goto BqpKZ; s9TXB: if (empty($reHGq)) { $MCi0I = Session::get('msSiteTemplate', null); if (!empty($MCi0I)) { $reHGq = SiteTemplateProvider::get($MCi0I); if (empty($reHGq)) { Session::forget('msSiteTemplate'); } } } goto pzNJD; ZiKAK: } goto v7Fv4; jSxtG: } protected function shareDialogPageViewFrame() { list($WqRck, $UMqQ0) = $this->viewPaths('dialogPage'); View::share('_viewFrameDialog', $WqRck); } protected function view($FOcXW, $dRqvs = array()) { list($FOcXW, $JZq9v) = $this->viewPaths($FOcXW); return view($FOcXW, $dRqvs); } protected function viewRender($FOcXW, $dRqvs = array()) { list($FOcXW, $JZq9v) = $this->viewPaths($FOcXW); return view($FOcXW, $dRqvs)->render(); } protected function viewRealpath($FOcXW) { return View::getFinder()->find($FOcXW); } protected function isMobile() { return AgentUtil::isMobile(); } protected function isPC() { return AgentUtil::isPC(); } }