<?php
# Subroutine: adm_list.php called by Admin.php
# Xinfeng Chen, 2002.11.28

require_once('bin/config.php');
require_once('admin/adm.inc');

#--- Validate dministrator ---
include('admin/adm_validate.php');
if(!$adm_validated){jumpTo('admin.php?cmd=logon'); exit;}

#--- Start Processing ---
require_once('core/class_forum_base.php');
CForumBase::setFileBase("$filepath");
require_once('core/base_array_file.php');
require_once('core/class_board_list.php');

#--- Prepare old list ---
$oLst=new CBoardList;
$oldlist='';
$flag=$oLst->load('community');
while($flag){
 $oldlist.=$oLst->id."\n";
 $flag=$oLst->moveNext();
}

page_header();

print <<<EOT
<H1>论坛列表设置</H1>
<p>注意：每一个类别名称或者论坛ID都要独立占用一行<br>
类别添加方法：添加论坛类别时，请在类别名称前加上"--"符号</p>
<form name="form1" method="post" action="?cmd=list_submit">
<table border="0" cellspacing="1" cellpadding="2" class="forumline" width="90%" align="center">
<tr>
 <th class="thHead">论坛列表</th>
 <th class="thHead">所有可用论坛</th>
</tr>
<tr>
 <td class="row2" valign="top">
  <textarea name="f_list" rows="15" cols="30">$oldlist</textarea>
 </td>
 <td valign="top" class="row3" rowspan="2">
 <table width="100%" border="0" cellspacing="1" cellpadding="3">
  <tr><td align=center class=row2><b>论坛 ID</b></td>
  <td align=center class=row2><b>论坛名称</b></td></tr>
EOT;

#--- Print board list ---
$oBrdLst=new CBoardList;
$flag=$oBrdLst->load();
while($flag){
 print "<tr><td class=row1>$oBrdLst->id</td>";
 print "<td class=row1>$oBrdLst->name</td></tr>";
 $flag=$oBrdLst->moveNext();
}

print <<<EOT
 </table>
 </td>
</tr>
<tr>
 <td class="row3" align="center"><input type="submit" value="　更　新　"></td>
</tr>
</table></form>
EOT;

page_footer();

?>