Beispiel #1
0
 public function helpAction()
 {
     $uri = $this->getRequest()->getParam('uri');
     $ns = new Zend_Session_Namespace();
     if (!empty($uri)) {
         $uri = Shineisp_Commons_UrlRewrites::format($uri);
         $data = $this->wiki->getPostbyUri($uri, "w.wiki_id, w.subject as subject, w.views as views, w.creationdate as creationdate, w.content as content, w.metakeywords as metakeywords, w.metadescription as metadescription, wc.category_id as category_id, wc.category as category");
         if (isset($data[0])) {
             // Set the Metatag information
             $this->view->headTitle(" | " . $data[0]['subject']);
             if (!empty($data[0]['metakeywords'])) {
                 $this->view->headMeta()->setName('keywords', $data[0]['metakeywords']);
             }
             if (!empty($data[0]['metadescription'])) {
                 $this->view->headMeta()->setName('description', $data[0]['metadescription']);
             }
             // Getting the Products
             $products = Wikilinks::getProductsAttached($data[0]['wiki_id'], $ns->langid);
             if (count($products) > 0) {
                 $this->view->placeholder("right")->append($this->view->partial('wiki/products_reference.phtml', array('products' => $products)));
                 $this->getHelper('layout')->setLayout('2columns-right');
             }
             // Update the counter
             Wiki::update_views($data[0]['wiki_id']);
             $data[0]['content'] = Shineisp_Commons_Contents::chkModule($data[0]['content']);
             $data[0]['content'] = Shineisp_Commons_Contents::chkCmsBlocks($data[0]['content'], $ns->lang);
             // Send the content to the page
             $this->view->headertitle = $this->translator->translate('Wiki page');
             $this->view->post = $data[0];
         }
     }
 }
Beispiel #2
0
 /**
  * findbyvar
  * Get a record by Var
  * @param $var
  * @return array
  */
 public static function findbyvar($var, $locale = "en")
 {
     $record = Doctrine_Query::create()->from('CmsPages cms')->leftJoin('cms.CmsPagesData cpd')->leftJoin('cpd.Languages l')->where('l.code = ?', $locale)->andWhere('cms.var = ?', $var)->execute(array(), Doctrine_Core::HYDRATE_ARRAY);
     if (!empty($record[0])) {
         $record[0]['body'] = Shineisp_Commons_Contents::chkModule($record[0]['body']);
         $record[0]['body'] = Shineisp_Commons_Contents::chkCmsBlocks($record[0]['body'], $locale);
         return $record[0];
     } else {
         return false;
     }
 }