public function index($year = null) { $Article = new Article(); $offset = $limit = null; $params = array(); $params[] = 'Type = ' . $this->getArticleType(); if ($year && is_numeric($year)) { $params[] = $Article->getParam('year', $year); } else { $offset = 0; $limit = 10; } $Tag = null; if (Request::get('tag')) { $Tag = new Tag(); $Tag = $Tag->findItem(array('Name = ' . Request::get('tag'))); $params[] = $Article->getParam('tag', Request::get('tag')); } $Paginator = new Paginator($Article->findSize($params), $this->getLimit(), $this->getPage()); $this->getView()->set('Articles', $Article->findShortList($params, 'PostedAt desc, Id desc', $this->getOffset(), $this->getLimit())); $this->getView()->set('Paginator', $Paginator); $this->getView()->set('Current', $year); $this->getView()->set('Tag', $Tag); return $this->getView()->render(); }
/** * The support index handler. * * @access public * @return string The HTML code. */ public function index() { $Page = $this->getContentPage(); $Award = new Award(); $Faq = new Faq(); $Article = new Article(); $params = array(); $params[] = 'Type = ' . Article::ARTICLE; $params[] = 'PostedAt < ' . time(); $params[] = $Article->getParam('reference', $Page); $this->getView()->set(array('Documents' => $Page->getDocuments(), 'Faqs' => $Faq->findList(array(), 'Position asc'), 'Papers' => $Award->findList(array('Type = ' . Award::SUPPORT), 'Position asc'), 'Articles' => $Article->findList($params, 'PostedAt desc'))); return $this->getView()->render(); }
/** * The function returns short overview for current controller. * * @access public * @param object $Page The Content Page. * @return string The HTML code. */ public function htmlShort(Content_Page $Page) { if (get_class($this) == get_class()) { return null; } $Article = new Article(); $params = array(); $params[] = 'Type = ' . Article::ARTICLE; $params[] = 'PostedAt < ' . time(); $params[] = $Article->getParam('reference', $Page); $Articles = $Article->findShortList($params, 'PostedAt desc, Id desc'); return $this->getView()->htmlShort($Page, $Articles, $this->getImages()); }
/** * The catalog view handler. * * @param int $id The Product id. * @return string The HTML code. */ public function view($id = null) { $Product = new Product(); $Product = $Product->findItem(array('Id = ' . $id)); if (!$Product->Id) { return $this->halt(); } $Category = $Product->getCategory(); $Article = new Article(); $params = array(); $params[] = 'Type = ' . Article::ARTICLE; $params[] = 'PostedAt < ' . time(); $params[] = $Article->getParam('reference', $Product); $this->getView()->set('Product', $Product); $this->getView()->set('Articles', $Article->findList($params, 'PostedAt desc, Id desc')); $this->getView()->setMethod('view'); if ($Product->getCategory()->getLayout() instanceof Product_Layout_Custom) { $this->getView()->setMethod('custom'); } elseif ($Product->getCategory()->getLayout() instanceof Product_Layout_Common) { $this->getView()->setMethod('common'); } $this->getView()->activeMenu = $Category; $this->setContentPage($Category); $Page = $this->getContentPage(); $Page->SeoTitle = $Product->SeoTitle ? $Product->SeoTitle : $Product->Name; $Page->SeoDescription = $Product->SeoDescription; $Page->SeoKeywords = $Product->SeoKeywords; return $this->getView()->render(); }