Ejemplo n.º 1
0
 public function showAction()
 {
     $request = $this->getRequest();
     $lang = $request->getParam('lang');
     $category = Modules_Category_Services_Category::factory();
     $categories = Modules_Category_Services_Category::getTree($lang, 'news');
     $this->view->categories = $categories;
     $this->view->uuid = uniqid();
     $this->view->currentCategory = $category;
 }
Ejemplo n.º 2
0
 public function configAction()
 {
     $limit = $this->getParam('limit', 5);
     $this->view->limit = $limit;
     $categoryId = $this->getParam('category_id');
     $categories = Modules_Category_Services_Category::getTree(null, 'news');
     $this->view->categories = $categories;
     $this->view->categoryId = $categoryId;
     $style = $this->getParam('style');
     $this->view->style = $style;
     $this->view->moduleName = Gio_Core_Widget::getIntance()->getModuleName();
     $this->view->widgetName = Gio_Core_Widget::getIntance()->getWidgetName();
     $this->view->widgetIndex = $this->getParam('widget_index');
 }
Ejemplo n.º 3
0
 public function showAction()
 {
     $limit = $this->getParam('limit', 5);
     $parentId = 0;
     $parentCategories = array();
     $categories = Modules_Category_Services_Category::getTree(null, 'news');
     for ($i = 0; $i < count($categories); $i++) {
         if ($categories[$i]['parent_id'] == 0) {
             $latestArticles = Modules_News_Services_Article::getLatestArticle($categories[$i]['category_id'], $limit);
             $subCategories = Modules_Category_Services_Category::getSubCategories($categories[$i]['category_id']);
             $categories[$i]['latest_articles'] = $latestArticles;
             $categories[$i]['top_article'] = $latestArticles ? $latestArticles[0] : null;
             $categories[$i]['sub_categories'] = $subCategories;
             $parentCategories[] = $categories[$i];
         }
     }
     $this->view->categories = $parentCategories;
     $this->view->uuid = uniqid();
     $this->view->limit = $limit;
 }
Ejemplo n.º 4
0
 /**
  * @param array $links
  * @param string $lang
  * @return array
  */
 public static function filter($links, $lang)
 {
     /**
      * Get the view instance
      */
     $view = Gio_Core_View::getInstance();
     /**
      * Get most recently activated articles
      * TODO: Make this variable configurable
      */
     $limit = 10;
     //		$articles = Modules_News_Services_Article::find(0, $limit, array('status' => 'active'));
     //
     //		if (count($articles) > 0) {
     //			foreach ($articles as $article) {
     //				$links['news_article_details'][] = array(
     //														'title' => $article['title'],
     //														'text'  => $article['title'],
     //														'href'  => $view->url('news_article_details', $article),
     //													);
     //			}
     //		}
     /**
      * Get categories links
      */
     $categories = Modules_Category_Services_Category::getTree($lang, 'news');
     if (count($categories) > 0) {
         foreach ($categories as $category) {
             $links['news_article_category'][] = array('title' => $category['name'], 'text' => str_repeat('---', $category['depth']) . ' ' . $category['name'], 'href' => $view->url('news_article_category', $category));
             $links['news_rss_category'][] = array('title' => $category['name'], 'text' => str_repeat('---', $category['depth']) . ' ' . $category['name'], 'href' => $view->url('news_rss_category', $category));
         }
     }
     /**
      * RSS links for latest articles
      */
     $links['news_rss_index'][] = array('href' => $view->url('news_rss_index', array('language' => $lang)));
     return $links;
 }
Ejemplo n.º 5
0
 /**
  * List categories
  * 
  * @return void
  */
 public function listAction()
 {
     $request = $this->getRequest();
     $moduleId = $request->getParam('module_id', $this->_defaultModule);
     $this->view->defaultModule = $moduleId;
     $lang = $request->getParam('lang');
     $categories = Modules_Category_Services_Category::getTree($lang, $moduleId);
     $this->view->categories = $categories;
     $this->view->categoryDao = new Modules_Category_Models_Mysql_Category();
     $this->view->lang = $lang;
 }