<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Vendor\Admin\Config; class AdminWidgetLink { private static $list = array(); public static function register($R_vdm) { self::$list[] = $R_vdm; } public static function get() { goto Dm2cH; x8EL0: return array_values($Crw2n); goto A2wSF; j4Jcx: $Crw2n = array(); goto E2G8k; Dm2cH: $fHGBD = array(); goto Z6MC3; Z6MC3: 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 j4Jcx; E2G8k: 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 x8EL0; A2wSF: } 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))); } }