protected function validateMenuStructure(&$menuStructure, $messageManager) { $testTree = SubpageTestLRTreeNode::getTree($menuStructure); if (!$testTree->checkTreeSize($this->recordList) || !$testTree->checkIdSetConsistency($this->recordList)) { $messageManager->addMessage('errorMenuStructureOutOfDate'); return; } if (!$testTree->checkMaxChildrenConstraints($this->recordList)) { $messageManager->addMessage('errorMenuStructureTooManyChildNodes'); } //if (!$testTree->checkHeightConstraints($this->recordList)) { // $messageManager->addMessage('errorMenuStructureMaxDepthExceeded'); //} //if (!$testTree->checkMenuNodesConstraints($this->recordList)) { // $messageManager->addMessage('errorMenuStructureSpecialNodesMoved'); //} //if (!$testTree->checkSubpageNodesConstraints($this->recordList)) { // $messageManager->addMessage('errorMenuIllegalSubpageLocation'); //} // To zastępuje wszystkie powyższe a w dodatku może wystąpić tylko w wyniku // hackowania lub awarii JSa if (!$testTree->checkHushvizConstraints($this->recordList)) { $messageManager->addMessage('errorMenuIllegalSubpageLocation'); } }
public static function getTree(&$array) { $root = new SubpageTestLRTreeNode(); $root->init($array); return $root; }