dsql = $GLOBALS['dsql']; $this->aChannels = Array(); $this->isAdminAll = false; if(!empty($catlogs) && $catlogs!='-1') { $this->aChannels = explode(',',$catlogs); foreach($this->aChannels as $cid) { if($cfg_Cs[$cid][0]==0) { $this->dsql->SetQuery("Select id,ispart From `#@__arctype` where reid=$cid"); $this->dsql->Execute(); while($row = $this->dsql->GetObject()) { //if($row->ispart==1) $this->aChannels[] = $row->id; } } } } else { $this->isAdminAll = true; } } function TypeUnit($catlogs='') { $this->__construct($catlogs); } //清理类 function Close() { } /** * 读出所有分类,在类目管理页(list_type)中使用 * * @access public * @param int $channel 频道ID * @param int $nowdir 当前操作ID * @return string */ function ListAllType($channel=0, $nowdir=0) { global $cfg_admin_channel, $admin_catalogs; //检测用户有权限的顶级栏目 if($cfg_admin_channel=='array') { $admin_catalog = join(',', $admin_catalogs); $this->dsql->SetQuery("SELECT reid FROM `#@__arctype` WHERE id IN($admin_catalog) GROUP BY reid "); $this->dsql->Execute(); $topidstr = ''; while($row = $this->dsql->GetObject()) { if($row->reid==0) continue; $topidstr .= ($topidstr=='' ? $row->reid : ','.$row->reid); } $admin_catalog .= ','.$topidstr; $admin_catalogs = explode(',', $admin_catalog); $admin_catalogs = array_unique($admin_catalogs); } $this->dsql->SetQuery("SELECT id,typedir,typename,ispart,channeltype FROM `#@__arctype` WHERE reid=0 ORDER BY sortrank"); $this->dsql->Execute(0); $lastid = GetCookie('lastCidMenu'); while($row=$this->dsql->GetObject(0)) { if( $cfg_admin_channel=='array' && !in_array($row->id, $admin_catalogs) ) { continue; } $typeDir = $row->typedir; $typeName = $row->typename; $ispart = $row->ispart; $id = $row->id; $channeltype = $row->channeltype; //普通栏目 if($ispart==0) { $smenu = " oncontextmenu=\"CommonMenu(event,this,$id,'".urlencode($typeName)."')\""; } //封面频道 else if($ispart==1) { $smenu = " oncontextmenu=\"CommonMenuPart(event,this,$id,'".urlencode($typeName)."')\""; } //独立页面 //else if($ispart==2) //{ //$smenu = " oncontextmenu=\"SingleMenu(event,this,$id,'".urlencode($typeName)."')\""; //} //跳转网址 else { continue; $smenu = " oncontextmenu=\"JumpMenu(event,this,$id,'".urlencode($typeName)."')\" "; } echo "
".$step.$timg."".$typeName." | \r\n"; echo "