public function changeRecordListing(Request $request, $contenttype, $contentid)
    {
        // We have to handle three cases here:
        // - $contenttype and $contentid given: get changelog entries for *one* content item
        // - only $contenttype given: get changelog entries for all items of that type
        // - neither given: get all changelog entries

        $page = $request->get('page');
        $pagination = $this->getPagination($page);
        $queryOptions = $this->getQueryOptions($pagination);

        if (empty($contenttype)) {
            // Case 1: No content type given, show from *all* items. This is easy:
            $data = [
                'title'   => Trans::__('logs.change-log.contenttypes.all'),
                'entries' => $this->changeLogRepository()->getChangeLog($queryOptions),
                'count'   => $this->changeLogRepository()->count(),
                'content' => null,
            ];
        } else {
            $contenttype = $this->getContentType($contenttype);
            $data = $this->manager()->getListingData($contenttype, $contentid, $queryOptions);
        }

        $context = [
            'contenttype' => $contenttype,
            'entry'       => null,
            'entries'     => $data['entries'],
            'content'     => $data['content'],
            'title'       => $data['title'],
            'currentpage' => $pagination['page'],
            'pagecount'   => $pagination['limit'] ? ceil($data['count'] / $pagination['limit']) : null,
        ];

        return $this->render('@bolt/changelog/changelog_record_all.twig', $context);
    }
public function changeRecordListing(Request $request, $contenttype, $contentid)
    {
        // We have to handle three cases here:
        // - $contenttype and $contentid given: get changelog entries for *one* content item
        // - only $contenttype given: get changelog entries for all items of that type
        // - neither given: get all changelog entries

        $page = $request->get('page');
        $pagination = $this->getPagination($page);
        $queryOptions = $this->getQueryOptions($pagination);

        if (empty($contenttype)) {
            // Case 1: No content type given, show from *all* items. This is easy:
            $data = [
                'title'   => Trans::__('logs.change-log.contenttypes.all'),
                'entries' => $this->changeLogRepository()->getChangeLog($queryOptions),
                'count'   => $this->changeLogRepository()->count(),
                'content' => null,
            ];
        } else {
            $contenttype = $this->getContentType($contenttype);
            $data = $this->manager()->getListingData($contenttype, $contentid, $queryOptions);
        }

        $context = [
            'contenttype' => $contenttype,
            'entry'       => null,
            'entries'     => $data['entries'],
            'content'     => $data['content'],
            'title'       => $data['title'],
            'currentpage' => $pagination['page'],
            'pagecount'   => $pagination['limit'] ? ceil($data['count'] / $pagination['limit']) : null,
        ];

        return $this->render('@bolt/changelog/changelog_record_all.twig', $context);
    }
public function changeRecordListing ( Request $ request , $ contenttype , $ contentid ) { // We have to handle three cases here: // - $contenttype and $contentid given: get changelog entries for *one* content item // - only $contenttype given: get changelog entries for all items of that type // - neither given: get all changelog entries $ page = $ request -> get ( 'page' ) ; $ pagination = $ this -> getPagination ( $ page ) ; $ queryOptions = $ this -> getQueryOptions ( $ pagination ) ; if ( empty ( $ contenttype ) ) { // Case 1: No content type given, show from *all* items. This is easy: $ data = [ 'title' => Trans :: __ ( 'logs.change-log.contenttypes.all' ) , 'entries' => $ this -> changeLogRepository ( ) -> getChangeLog ( $ queryOptions ) , 'count' => $ this -> changeLogRepository ( ) -> count ( ) , 'content' => null , ] ; } else { $ contenttype = $ this -> getContentType ( $ contenttype ) ; $ data = $ this -> manager ( ) -> getListingData ( $ contenttype , $ contentid , $ queryOptions ) ; } $ context = [ 'contenttype' => $ contenttype , 'entry' => null , 'entries' => $ data [ 'entries' ] , 'content' => $ data [ 'content' ] , 'title' => $ data [ 'title' ] , 'currentpage' => $ pagination [ 'page' ] , 'pagecount' => $ pagination [ 'limit' ] ? ceil ( $ data [ 'count' ] / $ pagination [ 'limit' ] ) : null , ] ; return $ this -> render ( '@bolt/changelog/changelog_record_all.twig' , $ context ) ; }
Show a list of changelog entries.

@param Request $request
@param string  $contenttype ContentType slug
@param int     $contentid   Content record ID

@return \Bolt\Response\TemplateResponse
Show a list of changelog entries .