public function indexAction() { $this->getLayout()->getAdminHmenu()->add($this->getTranslator()->trans('media'), array('action' => 'index')); $mediaMapper = new MediaMapper(); if ($this->getRequest()->getPost('action') === 'delete' && $this->getRequest()->getPost('check_medias') > 0) { foreach ($this->getRequest()->getPost('check_medias') as $mediaId) { $mediaMapper->delMediaById($mediaId); } $this->addMessage('deleteSuccess'); $this->redirect(array('action' => 'index')); } $pagination = new \Ilch\Pagination(); $pagination->setPage($this->getRequest()->getParam('page')); if ($this->getRequest()->getParam('rows')) { $pagination->setRowsPerPage($this->getRequest()->getParam('rows')); $rows = array('rows' => $this->getRequest()->getParam('rows')); $this->getView()->set('rows', $rows); } else { $rows = array(); $this->getView()->set('rows', $rows); } if ($this->getRequest()->getPost('search') === 'search') { $pagination->setRowsPerPage($this->getRequest()->getPost('rows')); $rows = array('rows' => $this->getRequest()->getPost('rows')); $this->getView()->set('rows', $rows); } $this->getView()->set('pagination', $pagination); $this->getView()->set('medias', $mediaMapper->getMediaList($pagination)); $this->getView()->set('catnames', $mediaMapper->getCatList()); $this->getView()->set('media_ext_img', $this->getConfig()->get('media_ext_img')); $this->getView()->set('media_ext_file', $this->getConfig()->get('media_ext_file')); $this->getView()->set('media_ext_video', $this->getConfig()->get('media_ext_video')); }
public function multiAction() { $this->getLayout()->setFile('modules/admin/layouts/ajax'); $mediaMapper = new MediaMapper(); $pagination = new \Ilch\Pagination(); $pagination->setPage($this->getRequest()->getParam('page')); $lastId = $this->getRequest()->getParam('lastid'); $this->getView()->set('pagination', $pagination); if (empty($lastId)) { $this->getView()->set('medias', $mediaMapper->getMediaList($pagination)); } else { $this->getView()->set('medias', $mediaMapper->getMediaListScroll($lastId)); } $this->getView()->set('media_ext_img', $this->getConfig()->get('media_ext_img')); $this->getView()->set('media_ext_file', $this->getConfig()->get('media_ext_file')); $this->getView()->set('media_ext_video', $this->getConfig()->get('media_ext_video')); }
public function multickeditorAction() { $this->getLayout()->setFile('modules/admin/layouts/iframe'); $mediaMapper = new MediaMapper(); $pagination = new \Ilch\Pagination(); $pagination->setPage($this->getRequest()->getParam('page')); $this->getView()->set('pagination', $pagination); $this->getView()->set('medias', $mediaMapper->getMediaList($pagination)); $this->getView()->set('media_ext_img', $this->getConfig()->get('media_ext_img')); $this->getView()->set('media_ext_file', $this->getConfig()->get('media_ext_file')); $this->getView()->set('media_ext_video', $this->getConfig()->get('media_ext_video')); }