<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Vendor\Admin\Config; class AdminWidgetLink { private static $list = array(); public static function register($ML9Et) { self::$list[] = $ML9Et; } public static function get() { goto iEAm6; A5Y7X: return array_values($PEKsL); goto SFrZG; w2GXt: 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 Dv1EZ; Dv1EZ: $PEKsL = array(); goto hRQIA; iEAm6: $Iwq1e = array(); goto w2GXt; hRQIA: foreach ($Iwq1e as $KAKiA => $Iim2u) { if (isset($PEKsL[$Iim2u['title']])) { $PEKsL[$Iim2u['title']]['list'] = array_merge($PEKsL[$Iim2u['title']]['list'], $Iim2u['list']); } else { $PEKsL[$Iim2u['title']] = $Iim2u; } } goto A5Y7X; SFrZG: } public static function build($JsWvO, $RqQZL) { if (empty($RqQZL)) { return null; } return array('title' => $JsWvO, 'list' => array_filter(array_map(function ($YaV4m) { return $YaV4m ? array('title' => $YaV4m[0], 'link' => $YaV4m[1]) : null; }, $RqQZL))); } }