public function getIdPathPagingInfoAction()
{
$path = $this->getParam("path");
$pathParts = explode("/", $path);
$id = array_pop($pathParts);
$limit = $this->getParam("limit");
if (empty($limit)) {
$limit = 30;
}
$data = [];
$targetObject = Object::getById($id);
$object = $targetObject;
while ($parent = $object->getParent()) {
$list = new Object\Listing();
$list->setCondition("o_parentId = ?", $parent->getId());
$list->setUnpublished(true);
$total = $list->getTotalCount();
$info = ["total" => $total];
if ($total > $limit) {
$idList = $list->loadIdList();
$position = array_search($object->getId(), $idList);
$info["position"] = $position + 1;
$info["page"] = ceil($info["position"] / $limit);
$containsPaging = true;
}
$data[$parent->getId()] = $info;
$object = $parent;
}
$this->_helper->json($data);
}