public function addAction()
{
$element = Element\Service::getElementById($this->getParam("type"), $this->getParam("id"));
if ($element) {
$type = Element\Service::getElementType($element);
$listClass = "\\Pimcore\\Model\\" . ucfirst($type) . "\\Listing";
$list = new $listClass();
$list->setCondition(($type == "object" ? "o_" : "") . "path LIKE '" . $element->getFullPath() . "/%'");
$children = $list->getTotalCount();
if ($children <= 100) {
Recyclebin\Item::create($element, $this->getUser());
}
$this->_helper->json(array("success" => true));
} else {
$this->_helper->json(array("success" => false));
}
}