<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Vendor\Admin\Widget; class AdminWidgetLink { private static $list = array(); public static function register($R_vdm) { self::$list[] = $R_vdm; } public static function get() { goto Dc7kK; PbPbU: $Crw2n = array(); goto xsyDh; xsyDh: foreach ($fHGBD as $kEhTf => $y2Ltn) { if (isset($Crw2n[$y2Ltn['title']])) { $Crw2n[$y2Ltn['title']]['list'] = array_merge($Crw2n[$y2Ltn['title']]['list'], $y2Ltn['list']); } else { $Crw2n[$y2Ltn['title']] = $y2Ltn; } } goto pQBr_; Dc7kK: $fHGBD = array(); goto hIciy; hIciy: foreach (self::$list as $jIWZA) { if ($jIWZA instanceof \Closure) { $nV1c1 = call_user_func($jIWZA); if (!empty($nV1c1)) { if (isset($nV1c1['title']) && isset($nV1c1['list'])) { $fHGBD[] = $nV1c1; } else { $fHGBD = array_merge($fHGBD, $nV1c1); } } } else { $fHGBD[] = $jIWZA; } } goto PbPbU; pQBr_: return array_values($Crw2n); goto gP03E; gP03E: } public static function build($ny83_, $uCRhX) { if (empty($uCRhX)) { return null; } return array('title' => $ny83_, 'list' => array_filter(array_map(function ($jIWZA) { return $jIWZA ? array('title' => $jIWZA[0], 'link' => $jIWZA[1]) : null; }, $uCRhX))); } }