<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Vendor\Admin\Config; class AdminWidgetLink { private static $list = array(); public static function register($eNZ5d) { self::$list[] = $eNZ5d; } public static function get() { goto jWYgG; SYGXo: foreach ($tVUbY as $MFVkb => $YxV2x) { if (isset($t64uY[$YxV2x['title']])) { $t64uY[$YxV2x['title']]['list'] = array_merge($t64uY[$YxV2x['title']]['list'], $YxV2x['list']); } else { $t64uY[$YxV2x['title']] = $YxV2x; } } goto ouZ45; ouZ45: return array_values($t64uY); goto m6g0S; jWYgG: $tVUbY = array(); goto UH1yn; UH1yn: foreach (self::$list as $Z32UA) { if ($Z32UA instanceof \Closure) { $s2vPN = call_user_func($Z32UA); if (!empty($s2vPN)) { if (isset($s2vPN['title']) && isset($s2vPN['list'])) { $tVUbY[] = $s2vPN; } else { $tVUbY = array_merge($tVUbY, $s2vPN); } } } else { $tVUbY[] = $Z32UA; } } goto teEtV; teEtV: $t64uY = array(); goto SYGXo; m6g0S: } public static function build($AHFwc, $DSdXB) { if (empty($DSdXB)) { return null; } return array('title' => $AHFwc, 'list' => array_filter(array_map(function ($Z32UA) { return $Z32UA ? array('title' => $Z32UA[0], 'link' => $Z32UA[1]) : null; }, $DSdXB))); } }