<?php
if (!defined('MOD')) die("access die");
purviewCheck($channelid, 'channel');
$ids = $_POST['ids']?$_POST['ids']:$GET['ids'];
$is_last = $_GET['is_last'];
if ($_GET[actions] == 'move') {
	$child = qdb :: QueryAlone("select child from " . TABLEPRE . "acategory where cid='$_POST[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) {
					$data = $cms -> del($val);
					if ($data['message']) qdb :: Query("delete from " . TABLEPRE . "text where text_id='{$data['message']}'  ");
				} else {
					$cms->moveToRecycle($val, array('status'=>0));	
				} 
				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 . "修改成功");

?>
