<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Vendor\Admin\Config; class AdminWidgetLink { private static $list = array(); public static function register($OukAb) { self::$list[] = $OukAb; } public static function get() { goto uQHy4; KKHKD: foreach (self::$list as $vPOhn) { if ($vPOhn instanceof \Closure) { $j3paW = call_user_func($vPOhn); if (!empty($j3paW)) { if (isset($j3paW['title']) && isset($j3paW['list'])) { $QCW2U[] = $j3paW; } else { $QCW2U = array_merge($QCW2U, $j3paW); } } } else { $QCW2U[] = $vPOhn; } } goto sqVVK; sqVVK: $lA8zE = array(); goto vkjkT; uQHy4: $QCW2U = array(); goto KKHKD; k5DAj: return array_values($lA8zE); goto fkOzz; vkjkT: foreach ($QCW2U as $JdFJR => $PSYn9) { if (isset($lA8zE[$PSYn9['title']])) { $lA8zE[$PSYn9['title']]['list'] = array_merge($lA8zE[$PSYn9['title']]['list'], $PSYn9['list']); } else { $lA8zE[$PSYn9['title']] = $PSYn9; } } goto k5DAj; fkOzz: } public static function build($Hcv7z, $xQxKz) { if (empty($xQxKz)) { return null; } return array('title' => $Hcv7z, 'list' => array_filter(array_map(function ($vPOhn) { return $vPOhn ? array('title' => $vPOhn[0], 'link' => $vPOhn[1]) : null; }, $xQxKz))); } }