Example #1
0
 /**
  * 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();
 }
Example #2
0
 /**
  * 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();
 }