<?php
if (!defined('MOD')) die("access die");
purviewCheck($channelid, 'channel');
$action_do = $_GET[action_do];
if ($action_do == 'move') {
	$cid = intval($_POST[cid]);
	$child = qdb :: QueryAlone("select child from " . TABLEPRE . "acategory where cid='$cid' limit 1");
	if ($child > 0) qbase :: showmsg("目标栏目有子栏目，不能操作");
} 

$ids = explode(',', isset($_POST['ids']) ? (is_array($_POST['ids']) ? implode(",", $_POST['ids']) : $_POST['ids']):intval($_GET['id']));
switch ($action_do) {
	case 'go_back' :
		$cms->moveToRecycle($ids, array('status'=>3));	
		break;

	case 'move':
		$cms -> update($ids, 'cid', $cid);
		break;

	case 'is_pass':
		$cms->moveToRecycle($ids, array('status'=>0));	
		break;

	case 'delete':
		if (intval($_GET['last']) == 1) {
			foreach($ids as $id) {
				$cms -> del($id);
			} 
		} else {
			$cms->moveToRecycle($ids, array('status'=>4));	
		} 
		break;
} 
qbase :: purviewCheckDie("修改成功");
?>
