織夢官方程序中后臺的系統(tǒng)用戶管理,在授權(quán)欄目選項中,只列出了最高二級欄目,我們來修正一下,讓它支持無限級授權(quán)欄目
1、打開 /dede/sys_admin_user_add.php 找到,最后一行的
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);
如圖
完成。
版權(quán)聲明: 本站資源均來自互聯(lián)網(wǎng)或會員發(fā)布,如果侵犯了您的權(quán)益請與我們聯(lián)系,我們將在24小時內(nèi)刪除!謝謝!
轉(zhuǎn)載請注明: 織夢后臺系統(tǒng)用戶管理授權(quán)欄目BUG修復(fù)