<?
defined('ROOT_PHPLEFT') or exit('phpleft: Not page');
$path = PL_ROOT.$PL_CFG['cache']."/";
switch($post) {
	case 'list':
	if ($tab=='') {
	msg('请先选择删除的','phpleft.php?file=plugins_set&in='.$table_name,0,1,1,'n');  
    }else{
	foreach($tab as $id=>$t) { 
	$db->query("DELETE FROM ".$PL_CFG['tb_pre'].$table_name." WHERE id='".$t."'");
}    
    $dirFrom = $path."tags_".$t.".php";   
    unlink($dirFrom);
    msg('删除成功', 'phpleft.php?file=plugins_set&in='.$table_name);
	}
	break;
	case 'set':
	$file = 'cache.inc.php';
	$path = PL_ROOT.'plugins/'.$table_name.'/';
    cache_write($file, $set, $path);
	msg('设置成功', 'phpleft.php?file=plugins_set&in='.$table_name.'&show=set');
	break;
	case 'is_or':
if ($tab=='') {
	msg('请先选择!','phpleft.php?file=plugins_set&in='.$table_name,0,1,1,'n');  
    }else{
	foreach($tab as $id=>$t) { 
	$db->query("update ".$PL_CFG['tb_pre'].$table_name." set is_or='$is_or' WHERE id='".$t."'");
}
    msg('设置成功', 'phpleft.php?file=plugins_set&in='.$table_name);
	}
	break;
	case 'add':
	$do->into($set,$table_name);
	$id = mysql_insert_id();
	$file = "tags_".$id.".php";
	cache_write($file, $set, $path);
    msg('添加成功', 'phpleft.php?file=plugins_set&in='.$table_name);
	break;
	case 'bj':
	$do->update($set,$table_name,'id',$id);
	$file = "tags_".$id.".php";
	cache_write($file, $set, $path);
    msg('编辑成功', 'phpleft.php?file=plugins_set&in='.$table_name);
	break;
}
?>