private function getLatestNewsPreview() { $this->view = new \fpcm\model\view\pub('showlatest', 'public'); $replacements = array('{{headline}}' => 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr!', '{{author}}' => $this->session->getCurrentUser()->getDisplayname(), '{{date}}' => date($this->config->system_dtmask, time()), '{{permaLink}}:{{/permaLink}}' => $this->config->system_url, '{{commentLink}}:{{/commentLink}}' => $this->config->system_url . '#comments'); $this->template->setReplacementTags($replacements); $parsed[] = $this->template->parse(); $replacements = array('{{headline}}' => 'Ut wisi enim ad minim veniam?', '{{author}}' => $this->session->getCurrentUser()->getDisplayname(), '{{date}}' => date($this->config->system_dtmask, time() - 3600), '{{permaLink}}:{{/permaLink}}' => $this->config->system_url, '{{commentLink}}:{{/commentLink}}' => $this->config->system_url . '#comments'); $this->template->setReplacementTags($replacements); $parsed[] = $this->template->parse(); $this->view->assign('content', implode(PHP_EOL, $parsed)); }
/** * Controller-Processing * @return boolean */ public function process() { $showToolbars = false; $permAdd = false; $permEditOwn = false; $permEditAll = false; $currentUserId = false; $isAdmin = false; if ($this->session->exists()) { $showToolbars = true; $permAdd = $this->permissions->check(array('article' => 'add')); $permEditOwn = $this->permissions->check(array('article' => 'edit')); $permEditAll = $this->permissions->check(array('article' => 'editall')); $currentUserId = $this->session->getUserId(); $isAdmin = $this->session->getCurrentUser()->isAdmin(); } $this->view->assign('showToolbars', $showToolbars); $this->view->assign('permAdd', $permAdd); $this->view->assign('permEditOwn', $permEditOwn); $this->view->assign('permEditAll', $permEditAll); $this->view->assign('currentUserId', $currentUserId); $this->view->assign('isAdmin', $isAdmin); return; }