<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Member\Config; use Illuminate\Support\Str; class MemberHomeIcon { private static $menu = array(); public static function register($hQj_u) { self::$menu[] = $hQj_u; } public static function get() { goto KYOwJ; qEraZ: $hQj_u = self::mergeMenu($hQj_u); goto Mp6gL; V0KVm: foreach (self::$menu as $FSL7c) { if ($FSL7c instanceof \Closure) { $FSL7c = call_user_func($FSL7c); } $hQj_u = array_merge($hQj_u, $FSL7c); } goto qEraZ; Mp6gL: return $hQj_u; goto lwnoK; KYOwJ: $hQj_u = array(); goto V0KVm; lwnoK: } private static function sort() { static $wuamL = 1000; return $wuamL++; } private static function mergeMenu($hQj_u, $w4kK_ = '', $kmcyt = 1, $zBPGV = null) { goto ezJ8V; yPRiW: return $hhe9d; goto zIbHI; sxfHv: if ($kmcyt == 1) { uasort($hhe9d, function ($E1Tkt, $TCxPq) { return $E1Tkt['sort'] - $TCxPq['sort']; }); return self::mergeMenuTree($hhe9d); } goto yPRiW; sXhjR: foreach ($hQj_u as $FSL7c) { goto Cg0ZZ; SO0TC: if (!isset($FSL7c['sort'])) { $FSL7c['sort'] = self::sort(); } goto GXW97; Cg0ZZ: if (empty($FSL7c)) { continue; } goto ggSx3; HNSKO: unset($hhe9d[$D5qRP]['children']); goto ZgRwa; GXW97: if (1 == $kmcyt) { $D5qRP = $w4kK_ . $FSL7c['title'] . '^' . $FSL7c['sort']; } else { $D5qRP = $w4kK_ . $FSL7c['title']; } goto YMniK; ggSx3: if ($zBPGV) { if (!call_user_func($zBPGV, $FSL7c)) { continue; } } goto SO0TC; ZgRwa: if (!empty($FSL7c['children'])) { $hhe9d = array_merge($hhe9d, self::mergeMenu($FSL7c['children'], $D5qRP . '^^', $kmcyt + 1, $zBPGV)); } goto zjv1m; YMniK: if (!isset($hhe9d[$D5qRP])) { $hhe9d[$D5qRP] = $FSL7c; } goto HNSKO; zjv1m: } goto sxfHv; ezJ8V: if (empty($hQj_u)) { return array(); } goto HuugH; HuugH: $hhe9d = array(); goto sXhjR; zIbHI: } private static function mergeMenuTree($bLbA0, $w4kK_ = '') { goto h7f1K; X1hCR: foreach ($bLbA0 as $D5qRP => $qGgGl) { goto oZh12; oZh12: if ($D5qRP === $w4kK_) { continue; } goto ZDzi_; N2AT2: $FSL7c['children'] = self::mergeMenuTree($bLbA0, $D5qRP . '^^'); goto dbgyZ; dYPkR: $JtE8_[] = $FSL7c; goto pHytm; eZijO: if (empty($FSL7c['children']) && empty($FSL7c['url'])) { continue; } goto dYPkR; dbgyZ: if (empty($FSL7c['children'])) { unset($FSL7c['children']); } goto eZijO; ZDzi_: $G2Rc8 = explode('^^', $D5qRP); goto rXRsg; rXRsg: if ($w4kK_) { if (!Str::startsWith($D5qRP, $w4kK_)) { continue; } if (count(explode('^^', $w4kK_)) !== count(explode('^^', $D5qRP))) { continue; } } else { if (1 != count($G2Rc8)) { continue; } } goto Y35jl; Y35jl: $FSL7c = $qGgGl; goto N2AT2; pHytm: } goto TxIOW; h7f1K: $JtE8_ = array(); goto X1hCR; TxIOW: return $JtE8_; goto WHSnz; WHSnz: } }