array('name'=>'无线订餐(网络打印)', 'link' => U('Repast/index', array('token' => $token, 'cid' => $cid)), 'new' => 0, 'selectedCondition' => array('m' => 'Repast')), 'DishOut' => array('name' => '微外卖', 'link' => U('DishOut/index', array('token' => $token,'cid' => $cid)),'new' => 0, 'selectedCondition' => array('m' => 'DishOut'), 'test'=>1), 'Hotels' => array('name' => '酒店', 'link' => U('Hotels/index', array('token' => $token,'cid' => $cid)), 'new'=>0, 'selectedCondition' => array('m' => 'Hotels')), 'Store' => array('name' => '微信商城系统', 'link' => U('Store/index', array('token'=>$token,'cid' => $cid)), 'new'=>0, 'selectedCondition' => array('m' => 'Store')), ); $subs = array(); if ($business_type) { foreach ($business_type as $index) { $subs[] = $subs_source[$index]; } } else { $subs = $subs_source; } $menus = array(array('name'=>'行业应用', 'display' => 0, 'subs'=> $subs)); $i=0; $parms = $_SERVER['QUERY_STRING']; $parms1 = explode('&', $parms); $parmsArr = array(); if ($parms1){ foreach ($parms1 as $p){ $parms2 = explode('=', $p); $parmsArr[$parms2[0]] = $parms2[1]; } } $subMenus = array(); $t = 0; $currentMenuID = 0; $currentParentMenuID = 0; foreach ($menus as $m) { $loopContinue = 1; if ($m['subs']) { $st = 0; foreach ($m['subs'] as $s){ $includeArr = 1; if ($s['selectedCondition']) { foreach ($s['selectedCondition'] as $condition) { if (!in_array($condition, $parmsArr)) { $includeArr = 0; break; } } } if ($includeArr) { if ($s['exceptCondition']) { foreach ($s['exceptCondition'] as $eptCondition){ if (in_array($eptCondition, $parmsArr)){ $includeArr = 0; break; } } } } if ($includeArr) { $currentMenuID = $st; $currentParentMenuID = $t; $loopContinue = 0; break; } $st++; } if ($loopContinue == 0) { break; } } $t++; } foreach ($menus as $m){ $displayStr = ''; if ($currentParentMenuID != 0 || 0 != $currentMenuID) { $m['display'] = 0; } if (!$m['display']) { $displayStr =' style="display:none"'; } if ($currentParentMenuID == $i) { $displayStr = ''; } $aClassStr = ''; if ($displayStr) { $aClassStr = ' nav-header-current'; } echo '
' . $m['name'] . '
'; if ($m['subs']) { $j = 0; foreach ($m['subs'] as $s) { $selectedClassStr = 'subCatalogList'; if ($currentParentMenuID == $i && $j == $currentMenuID) { $selectedClassStr = 'selected'; } $newStr = ''; if ($s['test']) { $newStr .= '
'; } elseif ($s['new']) { $newStr.='
'; } echo '
'.$s['name'].'
'.$newStr.'
'; $j++; } } echo '
'; $i++; } ?>