<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Vendor\Admin\Config; class AdminWidgetLink { private static $list = array(); public static function register($wu3LD) { self::$list[] = $wu3LD; } public static function get() { goto gDns3; Qs7eQ: $rTQPx = array(); goto DX3sL; da308: foreach (self::$list as $kHxHl) { if ($kHxHl instanceof \Closure) { $Hu3jW = call_user_func($kHxHl); if (!empty($Hu3jW)) { if (isset($Hu3jW['title']) && isset($Hu3jW['list'])) { $QqyDj[] = $Hu3jW; } else { $QqyDj = array_merge($QqyDj, $Hu3jW); } } } else { $QqyDj[] = $kHxHl; } } goto Qs7eQ; gDns3: $QqyDj = array(); goto da308; DX3sL: foreach ($QqyDj as $ynzcc => $nfRLq) { if (isset($rTQPx[$nfRLq['title']])) { $rTQPx[$nfRLq['title']]['list'] = array_merge($rTQPx[$nfRLq['title']]['list'], $nfRLq['list']); } else { $rTQPx[$nfRLq['title']] = $nfRLq; } } goto Znx_9; Znx_9: return array_values($rTQPx); goto wXJcp; wXJcp: } public static function build($LaJBu, $A0hF_) { if (empty($A0hF_)) { return null; } return array('title' => $LaJBu, 'list' => array_filter(array_map(function ($kHxHl) { return $kHxHl ? array('title' => $kHxHl[0], 'link' => $kHxHl[1]) : null; }, $A0hF_))); } }