<?php
if (!defined('MOD')) die("access die");
purviewCheck($channelid, 'channel');
$removes = $_POST['removes'];
if (!$removes) qbase :: purviewCheckDie("你没有做出任何选择");
$is_last = $_POST['is_last'];
if (is_array($removes)) {
	if ($is_last == 1) {
		while (list($key, $val) = each($removes)) {
			if ($_POST['actions'] == 'updateinfo') {
				if (isset($_POST['delete'])) {
					$cms -> del($val);
				} 
				if (isset($_POST['goback'])) $cms->moveToRecycle($val, array('status'=>3));
			} 
			if ($_POST['actions'] == 'pass') $cms->moveToRecycle($val, array('status'=>0));
			$num ++;
		} 
	} else {
		while (list($key, $val) = each($removes)) {
			if ($_POST['actions'] == 'updateinfo') {
				if (isset($_POST['delete'])) {
					$cms->moveToRecycle($val, array('status'=>0));
				} elseif (isset($_POST['error'])) {
					$cms -> update($val, 'error', 0);
				} elseif (isset($_POST['pass'])) {
					$cms->moveToRecycle($val, array('status'=>4));
				} elseif (isset($_POST['move'])) {
					$tocid = intval($_POST['tocid']);
					$cate = qdb :: queryFirst("select child, pur_browse from " . TABLEPRE . "acategory where cid='{$tocid}' limit 1");
					if (empty($cate)) qbase :: showmsg("出错了，当前所属栏目不存");
					if ($cate['child'] > 0) qbase :: showmsg("此栏目有子栏目，不能添加内容");
					$cms -> update($val, 'cid', $tocid);
				} else {
					qbase :: purviewCheckDie("您肯定弄错了什么，或者你发现了一个BUG");
				} 
			} 
			$num ++;
		} 
	} 
} 

$num = intval($num);
qbase :: purviewCheckDie("修改成功");

?>
