public function movePageInNavigation($websiteId, $pageId, $parentId, $beforeId) { $website = $this->getById($websiteId); $navigation = \Zend_Json::decode($website->getNavigation()); $data = new \Seitenbau\ArrayData(); $result = $data->move($navigation, $pageId, $parentId, $beforeId); if ($result == false) { throw new CmsException(752, __METHOD__, __LINE__, 'could not generate new navigation'); } $result = \Zend_Json::encode($result); $attributes = array('navigation' => $result); $this->update($websiteId, $attributes); $result = array('id' => $pageId, 'navigation' => $result); return $result; }
/** * Verschiebt eine Page innerhalb einer Website Navigation * * @param string $websiteId * @param string $pageId * @param string $parentId * @param string $beforeId * @return array */ public function movePageInNavigation($websiteId, $pageId, $parentId, $beforeId) { $website = $this->getService()->getById($websiteId); $navigation = \Zend_Json::decode($website->getNavigation()); $data = new \Seitenbau\ArrayData(); $newNavigation = $data->move($navigation, $pageId, $parentId, $beforeId); if ($newNavigation == false) { throw new \Cms\Exception(752, __METHOD__, __LINE__); } $newNavigation = \Zend_Json::encode($newNavigation); $attributes = array('navigation' => $newNavigation); $this->getService()->update($websiteId, $attributes); return $newNavigation; }