<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart; use ModStart\Core\Exception\BizException; use ModStart\Form\Form; use ModStart\Support\Manager\FieldManager; use ModStart\Support\Manager\WidgetManager; class ModStart { public static $version = '1.0.0'; public static $script = array(); public static $style = array(); public static $css = array(); public static $js = array(); public static function scriptFile($V7C5L) { if (strpos($V7C5L, '/') !== 0) { $V7C5L = base_path($V7C5L); } try { return self::script(file_get_contents($V7C5L)); } catch (\Exception $vBRkZ) { BizException::throws('FileNotFound -> ' . $V7C5L); } } public static function script($li24p = '') { goto NMlu2; ovaQL: if (!empty($li24p)) { self::$script = array_merge(self::$script, (array) $li24p); return; } goto z4x1e; NMlu2: $li24p = trim($li24p); goto ovaQL; z4x1e: return view('modstart::part.script', array('script' => array_unique(self::$script))); goto gupOq; gupOq: } public static function styleFile($lbqTT) { if (strpos($lbqTT, '/') !== 0) { $lbqTT = base_path($lbqTT); } try { return self::style(file_get_contents($lbqTT)); } catch (\Exception $vBRkZ) { BizException::throws('FileNotFound -> ' . $lbqTT); } } public static function style($HEFpQ = '') { goto b32V5; jidut: static::$style = array_merge(static::$style, FieldManager::collectFieldAssets('style'), WidgetManager::collectWidgetAssets('style')); goto Xaz5w; b32V5: $HEFpQ = trim($HEFpQ); goto cGPWc; Xaz5w: return view('modstart::part.style', array('style' => array_unique(self::$style))); goto uTqyJ; cGPWc: if (!empty($HEFpQ)) { self::$style = array_merge(self::$style, (array) $HEFpQ); return; } goto jidut; uTqyJ: } public static function css($AiDmv = null) { goto DXBF0; SDD0S: return view('modstart::part.css', array('css' => array_unique(static::$css))); goto pfxB_; A9625: static::$css = array_merge(static::$css, FieldManager::collectFieldAssets('css')); goto SDD0S; DXBF0: if (!is_null($AiDmv)) { self::$css = array_merge(self::$css, (array) $AiDmv); return; } goto A9625; pfxB_: } public static function js($hch70 = null) { goto FgWFC; tBzTv: static::$js = array_merge(static::$js, FieldManager::collectFieldAssets('js')); goto Huu3o; FgWFC: if (!is_null($hch70)) { self::$js = array_merge(self::$js, (array) $hch70); return; } goto tBzTv; Huu3o: return view('modstart::part.js', array('js' => array_unique(static::$js))); goto vIkfk; vIkfk: } }