织梦dedecms官方程序中后台的系统用户管理,在授权栏目选项中,只列出了最高二级栏目,我们来修正一下,让它支持无限级授权栏目,修复后效果图:
1、打开 /dede/sys_admin_user_add.php 找到,最后一行的(dede是后台管理目录)
include DedeInclude('templets/sys_admin_user_add.htm');
在它上面加入
function getalltype($reid = 0, $step = '', $typeids = array()) { global $dsql, $result; $dsql->SetQuery("SELECT reid,id,typename FROM `dede_arctype` WHERE reid='$reid' AND (ispart=0 OR ispart=1) ORDER BY sortrank"); $dsql->Execute($reid); if ($dsql->GetTotalRow($reid) > 0) { while ($row = $dsql->GetArray($reid)) { $result .= "<option value='{$row['id']}' class='" . (empty($row['reid']) ? 'b' : 's') . "type'>{$step}{$row['typename']}</option>\r\n"; getalltype($row['id'], $step . "—", $typeids); } } return $result; } $typeOptions = getalltype(0, '', $typeids);
2、打开 /dede/sys_admin_user_edit.php 找到,最后一行的
include DedeInclude('templets/sys_admin_user_edit.htm');
在它上面加入
function getalltype($reid = 0, $step = '', $typeids = array()) { global $dsql, $result; $dsql->SetQuery("SELECT reid,id,typename FROM `dede_arctype` WHERE reid='$reid' AND (ispart=0 OR ispart=1) ORDER BY sortrank"); $dsql->Execute($reid); if ($dsql->GetTotalRow($reid) > 0) { while ($row = $dsql->GetArray($reid)) { $result .= "<option value='{$row['id']}' class='" . (empty($row['reid']) ? 'b' : 's') . "type'" . (in_array($row['id'], $typeids) ? ' selected' : '') . ">{$step}{$row['typename']}</option>\r\n"; getalltype($row['id'], $step . "—", $typeids); } } return $result; } $typeOptions = getalltype(0, '', $typeids);
完成。
织梦二次开发QQ群
本站客服QQ号:862782808(点击左边QQ号交流),群号(383578617) 如果您有任何织梦问题,请把问题发到群里,阁主将为您写解决教程!
转载请注明: 织梦模板 » 织梦后台系统用户管理授权只列出二级栏目bug修复