page = $page; } parent::__construct(); $this->itemPerPage = Configuration::get('JXBLOG_POSTS_PER_PAGE'); $this->author = new Employee(Tools::getValue('author')); } public function initContent() { parent::initContent(); $pagination = false; $posts = false; if ($this->author) { $posts = JXBlogPost::getPostsByAuthor($this->author->id, $this->context->language->id, $this->page, $this->itemPerPage); $pagination = $this->module->buildPagination( 'apagination', JXBlogPost::countPostsByAuthor($this->author->id), $this->page, $this->itemPerPage, $this->author->id, '' ); } $this->context->smarty->assign( array( 'author' => $this->author, 'posts' => $posts, 'pagination' => $pagination, 'displayViews' => Configuration::get('JXBLOG_DISPLAY_POST_VIEWS'), 'displayAuthor' => Configuration::get('JXBLOG_DISPLAY_POST_AUTHOR') ) ); $this->setTemplate('module:jxblog/views/templates/front/author.tpl'); } public function getBreadcrumbLinks() { $link = new Link(); $breadcrumb = parent::getBreadcrumbLinks(); $breadcrumb['links'][] = array('title' => $this->module->translator('all_categories'), 'url' => $link->getModuleLink('jxblog', 'categories')); $breadcrumb['links'][] = array('title' => $this->author->firstname.' '.$this->author->lastname, 'url' => $link->getModuleLink('jxblog', 'author', array('author' => $this->author->id))); return $breadcrumb; } }