您的位置:首页 > 编程语言 > PHP开发

php:树形结构的算法4

2008-05-01 04:57 651 查看
.Flv343{display:none;} <?php
/**
*显示列表
*@accesspublic
*/
functionDispList()
{
//不缩进的显示方式
//$this->mIsDispListIndex=true;
//echo('<palign="right"><ahref="?action=new&part=role">增加新角色</a> </p>');_fcksavedurl=""?action=new&part=role">增加新角色</a> </p>');"
//
//$this->mListTitle='用户角色列表';
//$this->SetDataOption('list');
//
//$this->SetQueryTable(array($this->mTableUserRole));
//
////查询顺序
//$this->SetQueryOrder('asc',$this->mTableUserRole,'sequence');
//
//$this->Query('list');
//parent::DispList();

////另外一种显示方式,用数组作为堆栈,A:压栈时存role,压完就删除source
//$this->CheckProperty('mrDb');
//$this->CheckProperty('mrSql');
//$this->mrSql->Select('role,title,parent');
//$this->mrSql->From($this->mTableUserRole);
//$this->mrSql->Orderby('parent,sequence');
//$this->mRs=$this->mrDb->Execute($this->mrSql->Sql());
//if(0<count($this->mRs))
//{
//$source=&$this->mRs->GetArray();//数字索引
//$stack=array('');//堆栈
//$stacki=array(-1);//和堆栈对应,记录堆栈中数据在树中的层次
//$target=array();
//while(0<count($stack))
//{
//$item=array_shift($stack);
//$lev=array_shift($stacki);
//if(!empty($item))
//{
////在这里把加工过的数据放到target数组
//array_push($target,str_repeat('',$lev).$item);
////$s1=str_repeat('',$lev).$item;
/
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: