<?php
/**
 * Created by JetBrains PhpStorm.
 * User: Jure
 * Date: 18.3.14
 * Time: 12:50
 * To change this template use File | Settings | File Templates.
 */
include_once ("_dirinfo.php");
ini_set("display_errors","0");

include_once (PATH_TO_ROOT."init.php");
include_once (PATH_TO_ROOT."capi_manager/_forms/_ajax/class.groups.php");

$db->ChangeDatabase($_POST['database']);
$tableName = $_POST['RMtable'];

	$manipulator = new WebCatiManagerGroupsTreeDataMan($db,$tableName.'Tree');
	$manipulator->tableGrid = $tableName;
	$manipulator->tableTree = $tableName.'Tree';


$comm = $_POST['action'].'Action';
if(method_exists($manipulator,$comm))
    echo $manipulator->$comm();
else
{

    Echo '{success:false,error:"Unknown action!"';

}
?>