public function postHistoryView(string $postID = '', string $uniqueID = '') { $postID = (int) $postID; $blog = $this->blog->getBlogPostById($postID); if (!$blog || !$this->can('read')) { \Airship\redirect($this->airship_cabin_prefix . '/blog/post'); } $blog['tags'] = $this->blog->getTagsForPost($postID); $version = $this->blog->getBlogPostVersionByUniqueId($uniqueID); if ((int) $version['postid'] !== $postID || empty($version)) { \Airship\redirect($this->airship_cabin_prefix . '/blog/post/history/' . $postID); } if ($this->isSuperUser()) { $authors = $this->author->getAll(); } else { $authors = $this->author->getForUser($this->getActiveUserId()); } $categories = $this->blog->getCategoryTree(); $tags = $this->blog->getTags(); $this->lens('blog/post_history_view', ['active_link' => 'bridge-link-blog-posts', 'authors' => $authors, 'blogpost' => $blog, 'categories' => $categories, 'tags' => $tags, 'title' => \__('Revision for Blog Post "%s"', 'default', Util::noHTML($blog['title'])), 'prev_uniqueid' => $this->blog->getPrevVersionUniqueId($postID, (int) $version['versionid']), 'next_uniqueid' => $this->blog->getNextVersionUniqueId($postID, (int) $version['versionid']), 'version' => $version]); }