<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Vendor\Admin\Widget; use Module\Vendor\Type\AdminWidgetLinkType; class AdminWidgetLink { private static $list = array(); public static function register($ML9Et) { self::$list[] = $ML9Et; } public static function get() { goto UaylV; rGxKA: foreach ($Iwq1e as $KAKiA => $Iim2u) { $sFwJk = $Iim2u['type'] . '-' . $Iim2u['title']; if (isset($PEKsL[$sFwJk])) { $PEKsL[$sFwJk]['list'] = array_merge($PEKsL[$sFwJk]['list'], $Iim2u['list']); } else { $PEKsL[$sFwJk] = $Iim2u; } } goto hFbfA; hFbfA: return array_values($PEKsL); goto rxDBv; UaylV: $Iwq1e = array(); goto KsIOC; g93gv: foreach ($Iwq1e as $i0YzC => $Iim2u) { if (!isset($Iim2u['type'])) { $Iwq1e[$i0YzC]['type'] = AdminWidgetLinkType::WEB; } } goto W7yym; W7yym: $PEKsL = array(); goto rGxKA; KsIOC: foreach (self::$list as $YaV4m) { if ($YaV4m instanceof \Closure) { $AzbSd = call_user_func($YaV4m); if (!empty($AzbSd)) { if (isset($AzbSd['title']) && isset($AzbSd['list'])) { $Iwq1e[] = $AzbSd; } else { $Iwq1e = array_merge($Iwq1e, $AzbSd); } } } else { $Iwq1e[] = $YaV4m; } } goto g93gv; rxDBv: } public static function build($JsWvO, $RqQZL, $HWA34 = null) { goto Ybdrh; eQSd3: if (empty($RqQZL)) { return null; } goto xzZDB; Ybdrh: if (is_null($HWA34)) { $HWA34 = AdminWidgetLinkType::WEB; } goto eQSd3; xzZDB: return array('title' => $JsWvO, 'type' => $HWA34, 'list' => array_filter(array_map(function ($YaV4m) { return $YaV4m ? array('title' => $YaV4m[0], 'link' => $YaV4m[1]) : null; }, $RqQZL))); goto C8jol; C8jol: } public static function buildMobileWithPrefix($Nceje, $JsWvO, $RqQZL) { $RqQZL = array_map(function ($YaV4m) use($Nceje) { return array($YaV4m[0], $Nceje . $YaV4m[1]); }, $RqQZL); return self::build($JsWvO, $RqQZL, AdminWidgetLinkType::MOBILE); } }