<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Vendor\Admin\Widget; class AdminWidgetLink { private static $list = array(); public static function register($wu3LD) { self::$list[] = $wu3LD; } public static function get() { goto O19qh; B8Hgk: 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 fdPQx; ccE9r: return array_values($rTQPx); goto YfRhL; O19qh: $QqyDj = array(); goto B8Hgk; fdPQx: $rTQPx = array(); goto l9pSp; l9pSp: 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 ccE9r; YfRhL: } 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_))); } }