<?php
if(!defined('R_P')) die("access die");
purviewCheck( $channelid, 'channel');
$ids = $_POST['ids']?$_POST['ids']:$GET['ids'];
$is_last  = $_GET['is_last'];
if ( $_GET['actions'] == 'move'){
	$cid = intval($_POST['cid']);
	$child = qdb::QueryAlone("select child from ".TABLEPRE."acategory where cid='{$cid}' limit 1");
	if($child)  qbase::purviewCheckDie("此栏目有子栏目,不能转入");
}
if (is_array($ids)){
	while (list($key, $val) = each($ids)){
		switch($_GET['actions']){
			case 'del' :
				if($is_last){
					$cms->del($val);
				}else{
					$cms->moveToRecycle($val, array('status'=>4));
				}
			break;

			case 'comend' :
				$cms->update($val, 'is_comend', intval($_GET['is_comend']));
			break;

			case 'move':
				$cms->update($val, 'cid', intval($_POST['cid']));
			break;

			case 'status':
				$cms->moveToRecycle($val, array('status'=>intval($_GET['status'])));
			break;

			case 'go_back':
				$cms->moveToRecycle($val, array('status'=>3));
			break;
		}
	}
}else{
	qbase::purviewCheckDie("error request");
}
qbase::purviewCheckDie($channeltitle."修改成功");
?>
