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')));
     }
 }
 public function generateMediaFullPathAction()
 {
     $mediaMapper = new Media_Model_Mapper_Media();
     $freePathProducts = $mediaMapper->fetchFreeRowColumn('full_path');
     foreach ($freePathProducts as $media) {
         $media->fullPath = $mediaMapper->generateFullPath($media->id);
         $mapper = new Media_Model_Mapper_Media();
         $mapper->save($media);
     }
     return $this->view->entries = $mediaMapper->fetchFreeRowColumn('full_path');
 }