public function getDataByIdAction()
{
// check for lock
if (Element\Editlock::isLocked($this->getParam("id"), "document")) {
$this->_helper->json(array("editlock" => Element\Editlock::getByElement($this->getParam("id"), "document")));
}
Element\Editlock::lock($this->getParam("id"), "document");
$page = Document\Page::getById($this->getParam("id"));
$page = $this->getLatestVersion($page);
$page->setVersions(array_splice($page->getVersions(), 0, 1));
$page->getScheduledTasks();
$page->idPath = Element\Service::getIdPath($page);
$page->userPermissions = $page->getUserPermissions();
$page->setLocked($page->isLocked());
$page->setParent(null);
if ($page->getContentMasterDocument()) {
$page->contentMasterDocumentPath = $page->getContentMasterDocument()->getRealFullPath();
}
// get depending redirects
$redirectList = new Redirect\Listing();
$redirectList->setCondition("target = ?", $page->getId());
$page->redirects = $redirectList->load();
// unset useless data
$page->setElements(null);
$page->childs = null;
// cleanup properties
$this->minimizeProperties($page);
if ($page->isAllowed("view")) {
$this->_helper->json($page);
}
$this->_helper->json(false);
}