public function seoAction() { $pageId = $this->_request->getParam('id'); if (is_null($pageId)) { $this->_redirector->gotoSimpleAndExit('index'); } $page = $this->_modelMapper->find($pageId, new Pages_Model_Pages()); if ($this->getRequest()->isPost()) { if ($this->getRequest()->getParam('dataFormSeo')) { $dataFormSeo = $this->getRequest()->getParam('dataFormSeo'); $page->setOptions($dataFormSeo); $this->_modelMapper->save($page); } } $url = $page->getPath() != 'home' ? '/' . $page->getPath() : '/'; $this->_redirector->gotoUrlAndExit($url); }
public function sectionAction() { $jsonData = $this->_request->getParams(); if ($this->_request->getParam('itemId')) { $item = $this->_modelMapper->find($this->_request->getParam('itemId'), $this->_model); if ($item) { $pagesMapper = new Pages_Model_Mapper_Pages(); $page = $pagesMapper->find($this->_request->getParam('sectionId'), new Pages_Model_Pages()); $sectionId = $page ? $page->getId() : 0; $item->setSectionSiteId($sectionId); $this->_modelMapper->save($item); $jsonData['message'] = 'Ok'; } $this->_helper->json->sendJson($jsonData); return; } if ($this->_request->getParam('id')) { $this->forward('index', null, null, array('filter' => 'section_site_id', 'val' => $this->_request->getParam('id'))); } }