|
@@ -167,23 +167,30 @@ class Menu
|
|
$child = Dever::db('manage/menu')->child();
|
|
$child = Dever::db('manage/menu')->child();
|
|
|
|
|
|
if ($auth && is_array($auth)) {
|
|
if ($auth && is_array($auth)) {
|
|
- $auth = implode(',', $auth);
|
|
|
|
|
|
+ //$auth = implode(',', $auth);
|
|
}
|
|
}
|
|
|
|
|
|
$console = false;
|
|
$console = false;
|
|
if (layadmin()) {
|
|
if (layadmin()) {
|
|
$console = true;
|
|
$console = true;
|
|
}
|
|
}
|
|
|
|
+
|
|
foreach ($menu as $k => $v) {
|
|
foreach ($menu as $k => $v) {
|
|
|
|
|
|
if (!$console && $k == 'console') {
|
|
if (!$console && $k == 'console') {
|
|
unset($menu[$k]);
|
|
unset($menu[$k]);
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
+ if ($auth && !in_array($v['id'], $auth)) {
|
|
|
|
+ //unset($menu[$k]);
|
|
|
|
+ //continue;
|
|
|
|
+ }
|
|
|
|
+ /*
|
|
if ($auth && strpos($auth . '.', $k . '.') === false) {
|
|
if ($auth && strpos($auth . '.', $k . '.') === false) {
|
|
unset($menu[$k]);
|
|
unset($menu[$k]);
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
+ */
|
|
|
|
|
|
$path = Dever::load('manage/project.path', $v['key']);
|
|
$path = Dever::load('manage/project.path', $v['key']);
|
|
if ($path && strpos($path, 'http://') === 0) {
|
|
if ($path && strpos($path, 'http://') === 0) {
|
|
@@ -212,7 +219,8 @@ class Menu
|
|
{
|
|
{
|
|
if (isset($child[$v['id']])) {
|
|
if (isset($child[$v['id']])) {
|
|
foreach ($child[$v['id']] as $i => $j) {
|
|
foreach ($child[$v['id']] as $i => $j) {
|
|
- if ($state == false && $auth && $i && strpos($auth . '.', $i) === false) {
|
|
|
|
|
|
+ //if ($state == false && $auth && $i && strpos($auth . '.', $i) === false) {
|
|
|
|
+ if ($state == false && $auth && !in_array($j['id'], $auth)) {
|
|
//unset($child[$parent][$i]);
|
|
//unset($child[$parent][$i]);
|
|
//continue;
|
|
//continue;
|
|
} else {
|
|
} else {
|
|
@@ -658,7 +666,11 @@ class Menu
|
|
if (isset($v['child']) && $v['child']) {
|
|
if (isset($v['child']) && $v['child']) {
|
|
$html .= '<dl class="layui-nav-child">';
|
|
$html .= '<dl class="layui-nav-child">';
|
|
foreach ($v['child'] as $k1 => $v1) {
|
|
foreach ($v['child'] as $k1 => $v1) {
|
|
- $html .= '<dd data-name="'.$v1['key'].'">';
|
|
|
|
|
|
+ $active = '';
|
|
|
|
+ if ($v1['key'] == 'console.index') {
|
|
|
|
+ $active = 'layui-this';
|
|
|
|
+ }
|
|
|
|
+ $html .= '<dd data-name="'.$v1['key'].'" class="'.$active.'">';
|
|
if (isset($v1['child']) && $v1['child']) {
|
|
if (isset($v1['child']) && $v1['child']) {
|
|
$html .= '<a href="javascript:;">'.$v1['name'].'</a><dl class="layui-nav-child">';
|
|
$html .= '<a href="javascript:;">'.$v1['name'].'</a><dl class="layui-nav-child">';
|
|
foreach ($v1['child'] as $k2 => $v2) {
|
|
foreach ($v1['child'] as $k2 => $v2) {
|