/**
  * IS: -
  * FS: Mengirimkan ke viewer: destination, news, event, destSearchForm, 
  *     activitySearchForm, highlight, video
  * Desc: Fungsi untuk menampilkan halaman depan
  */
 public function indexAction()
 {
     $this->_helper->layout->setLayout('kebudayaan');
     // Form
     $destSearchForm = new Form_DestSearchHomeForm();
     $activitySearchForm = new Form_ActivitySearchHomeForm();
     $destSearchForm->setNameLabel($this->view->translate('name'));
     // Model
     $destinationDb = new Model_DbTable_Destination();
     $eventDb = new Model_DbTable_Event();
     $highlightDb = new Model_DbTable_Highlight();
     //    $videoModel = new Model_Video;
     $galleryModel = new Model_DbTable_Image();
     // Data
     $galleryHeader = $highlightDb->getGalleryHeader();
     $featured_culture = $destinationDb->getFeaturedCulture($this->_languageId, 4);
     //generate news
     $news = $this->news->getLastNews($this->_languageId, 4);
     $event = $eventDb->getFourClosestEvent($this->_languageId);
     $highlightMed = $highlightDb->getMainType(2, $this->_languageId);
     //    $videos = $videoModel->getMostViewedVideos($startIndexVideo, $maxResultVideo);
     $latestImage = $galleryModel->getTenLastImage(1, false, true);
     $this->view->activeHeaders = $highlightDb->getActiveHeaders();
     // Passing ke view
     $this->view->galleryHeader = $galleryHeader;
     $this->view->latestImage = $latestImage;
     $this->view->featured_culture = $featured_culture;
     $this->view->news = $news->toArray();
     $this->view->event = $event;
     $this->view->destSearchForm = $destSearchForm;
     $this->view->useFeaturedSlideshow = true;
     $this->view->featuredCulture = $featured_culture;
     $this->view->activitySearchForm = $activitySearchForm;
     $this->view->highlight = $highlightMed;
     //    $this->view->videos = $videos;
     $this->view->languageID = $this->_languageId;
     $this->view->useGoogleExperiment = true;
     $this->view->langId = $this->_languageId;
     $this->view->homepage = true;
     $this->view->figures = $this->figure->findAll($this->_languageId, 2)->toArray();
 }
 /**
  * IS: -
  * FS: Mengirimkan ke viewer: destination, news, event, destSearchForm, 
  *     activitySearchForm, highlight, video
  * Desc: Fungsi untuk menampilkan halaman depan
  */
 public function indexAction()
 {
     $this->_helper->layout->setLayout('kebudayaan');
     // Model
     $destinationDb = new Model_DbTable_Destination();
     $eventDb = new Model_DbTable_Event();
     $highlightDb = new Model_DbTable_Highlight();
     //    $videoModel = new Model_Video;
     $galleryModel = new Model_DbTable_Image();
     // Data
     $galleryHeader = $highlightDb->getGalleryHeader();
     $featured_culture = $destinationDb->getFeaturedCulture($this->_languageId, 4);
     //generate news
     $news = $this->news->getLastNews($this->_languageId, 4);
     $event = $eventDb->getFourClosestEvent($this->_languageId);
     $highlightMed = $highlightDb->getMainType(2, $this->_languageId);
     //    $videos = $videoModel->getMostViewedVideos($startIndexVideo, $maxResultVideo);
     $latestImage = $galleryModel->getTenLastImage(1, false, true);
     $activeHeaders = $highlightDb->getActiveHeaders($this->_languageId);
     if (count($activeHeaders) == 0) {
         $activeHeaders = $highlightDb->getActiveHeaders();
     }
     $this->view->activeHeaders = $activeHeaders;
     // Passing ke view
     $this->view->galleryHeader = $galleryHeader;
     $this->view->latestImage = $latestImage;
     $this->view->featured_culture = $featured_culture;
     $this->view->news = $news->toArray();
     $this->view->event = $event;
     $this->view->useFeaturedSlideshow = true;
     $this->view->featuredCulture = $featured_culture;
     $this->view->highlight = $highlightMed;
     //    $this->view->videos = $videos;
     $this->view->languageID = $this->_languageId;
     $this->view->useGoogleExperiment = true;
     $this->view->langId = $this->_languageId;
     $this->view->homepage = true;
     $this->view->figures = $this->figure->findAll($this->_languageId, 2)->toArray();
     $this->view->headMeta()->appendName('keywords', join(', ', $this->_meta));
     $this->view->headMeta()->appendName('description', "kebudayaanindonesia.net adalah laman referensi kebudayaan Indonesia untuk mewujudkan bangsa Indonesia yang cerdas dan berbudaya");
 }
    public function newsWidget($news_limit, $show_thumbnails = false, $side_space = true)
    {
        $language_id = Zend_Registry::get('languageId');
        $cache = Zend_Registry::get('cache');
        if (($widget = $cache->load('widget_news')) === false) {
            $title = $this->view->translate('recent_news');
            $tbl_news = new Model_DbTable_News();
            $arr_news = $tbl_news->getLastNews($language_id, $news_limit)->toArray();
            $list = "<ul>";
            $thumbnails = '';
            foreach ($arr_news as $news) {
                $link = $this->view->baseUrl('news/detail/' . $news['id'] . '/' . $this->view->makeUrlFormat($news['title']));
                if ($show_thumbnails) {
                    $source = 'default.jpg';
                    if (file_exists(UPLOAD_FOLDER . "news/{$news['image']}") && !empty($news['image'])) {
                        $source = "upload/news/{$news['image']}";
                    }
                    $thumbs = $this->view->imageUrl("timthumb.php?src={$source}&w=50&h=50&q=100");
                    $thumbnails = "<img src='{$thumbs}' class='thumbnail' alt='{$news['title']}' />";
                }
                $list .= "<li>{$thumbnails}<a href='{$link}'><span class='desc'>{$news['title']}</span></a></li>";
            }
            $list .= "</ul>";
            $list .= "<div class='clear'></div>";
            if ($side_space) {
                $side_space_class = 'side-space';
            }
            $widget = <<<HTML
    <div class="widget-half-list {$side_space_class}">      
      <h2>{$title}</h2>            
      {$list}      
    </div>
HTML;
            $cache->save($widget);
        }
        return $widget;
    }