} $del = array(); //要从$source中删除的节点 $ar = array(); //需要添加到堆栈中的节点 foreach ($source as $key=>$val) { //寻找匹配的子节点 if (-1 == $item) { $find = empty($source[$key]['parent']); } else { $find = ($source[$item]['role'] == $source[$key]['parent']); } if ($find) { array_unshift($ar, $key); } } foreach ($ar as $val) { array_unshift($stack, $val); array_unshift($stacki, $lev + 1); } //从source中删除 unset($source[$item]); //echo(implode(', ', $stack) . '<br />' . implode(', ', $stacki) . '<br />' . implode(', ', $target) . '<br /><br />'); } //输出 echo('<p align="right"><a href="?action=new&part=role">增加新角色</a> </p>'); array_unshift($target, array('角色', '操作')); $this->CheckProperty('mrLt'); $this->mrLt->SetData($target); $this->mrLt->mListTitle = '用户角色列表'; $this->mrLt->mIsDispIndex = false; $this->mrLt->Disp(); } else { echo('<center>没有检索到数据</center>'); } } // end of function DispList ?> |