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 indexAction() { $forumMapper = new ForumMapper(); $topicMapper = new TopicMapper(); $pagination = new \Ilch\Pagination(); $userMapper = new UserMapper(); $forumId = $this->getRequest()->getParam('forumid'); $forum = $forumMapper->getForumById($forumId); $cat = $forumMapper->getCatByParentId($forum->getParentId()); $userId = null; $groupIds = array(0); if ($this->getRequest()->isPost() && $this->getRequest()->getPost('forumEdit') === 'forumEdit') { $forumEdit = true; $this->getView()->set('forumEdit', $forumEdit); } if ($this->getUser()) { $userId = $this->getUser()->getId(); $user = $userMapper->getUserById($userId); $groupIds = array(); foreach ($user->getGroups() as $groups) { $groupIds[] = $groups->getId(); } } $groupIdsArray = explode(',', implode(',', $groupIds)); $this->getLayout()->set('metaTitle', $this->getTranslator()->trans('forum') . ' - ' . $forum->getTitle()); $this->getLayout()->set('metaDescription', $this->getTranslator()->trans('forum') . ' - ' . $forum->getDesc()); $this->getLayout()->getHmenu()->add($this->getTranslator()->trans('forum'), array('controller' => 'index', 'action' => 'index'))->add($cat->getTitle(), array('controller' => 'showcat', 'action' => 'index', 'id' => $cat->getId()))->add($forum->getTitle(), array('action' => 'index', 'forumid' => $forumId)); $pagination->setPage($this->getRequest()->getParam('page')); $this->getView()->set('forum', $forum); $this->getView()->set('topicMapper', $topicMapper); $this->getView()->set('forumMapper', $forumMapper); $this->getView()->set('topics', $topicMapper->getTopicsByForumId($forumId, $pagination)); $this->getView()->set('groupIdsArray', $groupIdsArray); $this->getView()->set('pagination', $pagination); }
public function treatGalleryAction() { $imageMapper = new ImageMapper(); $pagination = new \Ilch\Pagination(); $galleryMapper = new GalleryMapper(); $id = $this->getRequest()->getParam('id'); $galleryTitle = $galleryMapper->getGalleryById($id); $this->getLayout()->getAdminHmenu()->add($this->getTranslator()->trans('gallery'), array('action' => 'index'))->add($this->getTranslator()->trans($galleryTitle->getTitle()), array('action' => 'treatgallery', 'id' => $id)); if ($this->getRequest()->getPost('action') == 'delete') { foreach ($this->getRequest()->getPost('check_gallery') as $imageId) { $imageMapper->deleteById($imageId); } $this->addMessage('deleteSuccess'); $this->redirect(array('action' => 'treatgallery', 'id' => $id)); } if ($this->getRequest()->getPost()) { foreach ($this->getRequest()->getPost('check_image') as $imageId) { $catId = $this->getRequest()->getParam('id'); $model = new \Modules\Gallery\Models\Image(); $model->setImageId($imageId); $model->setCat($catId); $imageMapper->save($model); } } $pagination->setPage($this->getRequest()->getParam('page')); $this->getView()->set('image', $imageMapper->getImageByGalleryId($id, $pagination)); $this->getView()->set('pagination', $pagination); $this->getView()->set('galleryTitle', $galleryTitle->getTitle()); }
public function treatDownloadsAction() { $fileMapper = new FileMapper(); $pagination = new \Ilch\Pagination(); $downloadsMapper = new DownloadsMapper(); $id = $this->getRequest()->getParam('id'); $downloadsTitle = $downloadsMapper->getDownloadsById($id); if ($this->getRequest()->getPost('action') == 'delete') { foreach ($this->getRequest()->getPost('check_downloads') as $fileId) { $fileMapper->deleteById($fileId); } $this->addMessage('deleteSuccess'); $this->redirect(array('action' => 'treatdownloads', 'id' => $id)); } if ($this->getRequest()->getPost()) { foreach ($this->getRequest()->getPost('check_image') as $fileId) { $catId = $this->getRequest()->getParam('id'); $model = new \Modules\Downloads\Models\File(); $model->setFileId($fileId); $model->setCat($catId); $fileMapper->save($model); } } $pagination->setPage($this->getRequest()->getParam('page')); $this->getView()->set('file', $fileMapper->getFileByDownloadsId($id, $pagination)); $this->getView()->set('pagination', $pagination); $this->getView()->set('downloadsTitle', $downloadsTitle->getTitle()); }
public function indexAction() { if ($this->getUser()) { $forumMapper = new ForumMapper(); $topicMapper = new TopicMapper(); $pagination = new \Ilch\Pagination(); $userMapper = new UserMapper(); $userId = null; $groupIds = array(0); $userId = $this->getUser()->getId(); $user = $userMapper->getUserById($userId); $groupIds = array(); foreach ($user->getGroups() as $groups) { $groupIds[] = $groups->getId(); } $groupIdsArray = explode(',', implode(',', $groupIds)); $pagination->setPage($this->getRequest()->getParam('page')); $this->getLayout()->getHmenu()->add($this->getTranslator()->trans('forum'), array('controller' => 'index', 'action' => 'index'))->add($this->getTranslator()->trans('showNewPosts'), array('action' => 'index')); $this->getLayout()->set('metaTitle', $this->getTranslator()->trans('showNewPosts')); $this->getLayout()->set('metaDescription', $this->getTranslator()->trans('showNewPosts')); $this->getView()->set('topicMapper', $topicMapper); $this->getView()->set('forumMapper', $forumMapper); $this->getView()->set('topics', $topicMapper->getTopics($pagination)); $this->getView()->set('groupIdsArray', $groupIdsArray); $this->getView()->set('pagination', $pagination); } else { $this->addMessage('noAccessForum', 'warning'); $this->redirect(array('module' => 'forum', 'controller' => 'index')); } }
public function indexAction() { $this->getLayout()->getHmenu()->add($this->getTranslator()->trans('guestbook'), array('action' => 'index')); $guestbookMapper = new GuestbookMapper(); $pagination = new \Ilch\Pagination(); $pagination->setPage($this->getRequest()->getParam('page')); $this->getView()->set('entries', $guestbookMapper->getEntries(array('setfree' => 1), $pagination)); $this->getView()->set('pagination', $pagination); }
public function indexAction() { $this->getLayout()->getHmenu()->add($this->getTranslator()->trans('menuWarList'), array('action' => 'index')); $pagination = new \Ilch\Pagination(); $warMapper = new WarMapper(); $pagination->setPage($this->getRequest()->getParam('page')); $this->getView()->set('war', $warMapper->getWarList($pagination)); $this->getView()->set('pagination', $pagination); }
public function showAction() { $groupMapper = new GroupMapper(); $warMapper = new WarMapper(); $pagination = new \Ilch\Pagination(); $id = $this->getRequest()->getParam('id'); $group = $groupMapper->getGroupById($id); $pagination->setPage($this->getRequest()->getParam('page')); $this->getLayout()->getHmenu()->add($this->getTranslator()->trans('menuWarList'), array('controller' => 'index', 'action' => 'index'))->add($this->getTranslator()->trans('menuGroupList'), array('action' => 'index'))->add($group->getGroupName(), array('action' => 'show', 'id' => $this->getRequest()->getParam('id'))); $this->getView()->set('group', $group); $this->getView()->set('war', $warMapper->getWarsByWhere('group =' . $id, $pagination)); $this->getView()->set('pagination', $pagination); }
public function showAction() { $imageMapper = new ImageMapper(); $pagination = new \Ilch\Pagination(); $galleryMapper = new GalleryMapper(); $id = $this->getRequest()->getParam('id'); $gallery = $galleryMapper->getGalleryById($id); $this->getLayout()->set('metaTitle', $this->getTranslator()->trans('gallery') . ' - ' . $gallery->getTitle()); $this->getLayout()->set('metaDescription', $this->getTranslator()->trans('gallery') . ' - ' . $gallery->getDesc()); $this->getLayout()->getHmenu()->add($this->getTranslator()->trans('menuGalleryOverview'), array('action' => 'index'))->add($gallery->getTitle(), array('action' => 'show', 'id' => $id)); $pagination->setPage($this->getRequest()->getParam('page')); $this->getView()->set('image', $imageMapper->getImageByGalleryId($id, $pagination)); $this->getView()->set('pagination', $pagination); }
public function showAction() { $fileMapper = new FileMapper(); $pagination = new \Ilch\Pagination(); $downloadsMapper = new DownloadsMapper(); $id = $this->getRequest()->getParam('id'); $downloads = $downloadsMapper->getDownloadsById($id); $this->getLayout()->set('metaTitle', $this->getTranslator()->trans('downloads') . ' - ' . $downloads->getTitle()); $this->getLayout()->set('metaDescription', $this->getTranslator()->trans('downloads') . ' - ' . $downloads->getDesc()); $this->getLayout()->getHmenu()->add($this->getTranslator()->trans('menuDownloadsOverview'), array('action' => 'index'))->add($downloads->getTitle(), array('action' => 'show', 'id' => $id)); $pagination->setPage($this->getRequest()->getParam('page')); $this->getView()->set('file', $fileMapper->getFileByDownloadsId($id, $pagination)); $this->getView()->set('pagination', $pagination); }
public function indexAction() { $enemyMapper = new EnemyMapper(); $pagination = new \Ilch\Pagination(); $this->getLayout()->getAdminHmenu()->add($this->getTranslator()->trans('manageEnemy'), array('action' => 'index')); if ($this->getRequest()->getPost('action') == 'delete' && $this->getRequest()->getPost('check_enemy')) { foreach ($this->getRequest()->getPost('check_enemy') as $enemyId) { $enemyMapper->delete($enemyId); } } $pagination->setPage($this->getRequest()->getParam('page')); $this->getView()->set('enemy', $enemyMapper->getEnemyList($pagination)); $this->getView()->set('pagination', $pagination); }
public function indexAction() { $postMapper = new PostMapper(); $topicMapper = new TopicMapper(); $forumMapper = new ForumMapper(); $topicModel = new ForumTopicModel(); $pagination = new \Ilch\Pagination(); $pagination->setPage($this->getRequest()->getParam('page')); $topicId = (int) $this->getRequest()->getParam('topicid'); $forumId = $forumMapper->getForumByTopicId($topicId); $forum = $forumMapper->getForumById($forumId->getId()); $cat = $forumMapper->getCatByParentId($forum->getParentId()); $posts = $postMapper->getPostByTopicId($topicId, $pagination); $post = $topicMapper->getPostById($topicId); $this->getLayout()->set('metaTitle', $this->getTranslator()->trans('forum') . ' - ' . $forum->getTitle()); $this->getLayout()->set('metaDescription', $this->getTranslator()->trans('forum') . ' - ' . $forum->getDesc()); $this->getLayout()->getHmenu()->add($this->getTranslator()->trans('forum'), array('controller' => 'index', 'action' => 'index'))->add($cat->getTitle(), array('controller' => 'showcat', 'action' => 'index', 'id' => $cat->getId()))->add($forum->getTitle(), array('controller' => 'showtopics', 'action' => 'index', 'forumid' => $forumId->getId()))->add($post->getTopicTitle(), array('controller' => 'showposts', 'action' => 'index', 'topicid' => $topicId)); $topicModel->setId($topicId); $topicModel->setVisits($post->getVisits() + 1); $topicMapper->saveVisits($topicModel); $userMapper = new UserMapper(); $userId = null; if ($this->getUser()) { $userId = $this->getUser()->getId(); $postMapper = new PostMapper(); $postModel = new ForumPostModel(); $lastPost = $topicMapper->getLastPostByTopicId($topicId); $lastRead = $lastPost->getRead(); if (in_array($this->getUser()->getId(), explode(',', $lastRead)) == false) { $postModel->setId($lastPost->getId()); $postModel->setRead($lastPost->getRead() . ',' . $this->getUser()->getId()); $postMapper->saveRead($postModel); } } $user = $userMapper->getUserById($userId); $ids = array(0); if ($user) { $ids = array(); foreach ($user->getGroups() as $us) { $ids[] = $us->getId(); } } $readAccess = explode(',', implode(',', $ids)); $this->getView()->set('post', $post); $this->getView()->set('posts', $posts); $this->getView()->set('forum', $forum); $this->getView()->set('readAccess', $readAccess); $this->getView()->set('pagination', $pagination); }
public function showAction() { $profilMapper = new UserMapper(); $imageMapper = new GalleryImageMapper(); $pagination = new \Ilch\Pagination(); $galleryMapper = new GalleryMapper(); $id = $this->getRequest()->getParam('id'); $gallery = $galleryMapper->getGalleryById($id); $profil = $profilMapper->getUserById($this->getRequest()->getParam('user')); $this->getLayout()->set('metaTitle', $this->getTranslator()->trans('gallery') . ' - ' . $gallery->getTitle()); $this->getLayout()->set('metaDescription', $this->getTranslator()->trans('gallery') . ' - ' . $gallery->getDesc()); $this->getLayout()->getHmenu()->add($this->getTranslator()->trans('menuUserList'), array('controller' => 'index'))->add($profil->getName(), array('controller' => 'profil', 'action' => 'index', 'user' => $this->getRequest()->getParam('user')))->add($this->getTranslator()->trans('menuGallery'), array('controller' => 'gallery', 'action' => 'index', 'user' => $this->getRequest()->getParam('user')))->add($gallery->getTitle(), array('action' => 'show', 'user' => $this->getRequest()->getParam('user'), 'id' => $id)); $pagination->setPage($this->getRequest()->getParam('page')); $this->getView()->set('image', $imageMapper->getImageByGalleryId($id, $pagination)); $this->getView()->set('pagination', $pagination); }
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 multiAction() { $this->getLayout()->setFile('modules/admin/layouts/iframe'); $mediaMapper = new MediaMapper(); $pagination = new \Ilch\Pagination(); $pagination->setPage($this->getRequest()->getParam('page')); $lastId = $this->getRequest()->getParam('lastid'); if ($this->getRequest()->getParam('type') === 'multi') { $type = $this->getConfig()->get('usergallery_filetypes'); } if (empty($lastId)) { $pagination->setRowsPerPage('40'); $this->getView()->set('medias', $mediaMapper->getMediaListByEnding($this->getUser()->getId(), $type, $pagination)); } else { $this->getView()->set('medias', $mediaMapper->getMediaListScroll($lastId)); } $this->getView()->set('usergallery_filetypes', $this->getConfig()->get('usergallery_filetypes')); }
public function indexAction() { $warMapper = new WarMapper(); $pagination = new \Ilch\Pagination(); $this->getLayout()->getAdminHmenu()->add($this->getTranslator()->trans('manageWarOverview'), array('action' => 'index')); if ($this->getRequest()->getPost('action') == 'delete' && $this->getRequest()->getPost('check_war')) { foreach ($this->getRequest()->getPost('check_war') as $warId) { $warMapper->delete($warId); } } $pagination->setPage($this->getRequest()->getParam('page')); if ($this->getRequest()->getPost('filter') == 'filter' and $this->getRequest()->getPost('filterLastNext') != '0') { $status = $this->getRequest()->getPost('filterLastNext'); $this->getView()->set('war', $warMapper->getWarListByStatus($status, $pagination)); } else { $this->getView()->set('war', $warMapper->getWarList($pagination)); } $this->getView()->set('pagination', $pagination); }
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')); }