Пример #1
0
 /**
  * Load more
  *
  * @version 1.0
  * @since 1.0
  * @access public
  * @author Nguyen Van Hiep
  */
 public function action_ajaxload()
 {
     $cat_id = Input::post('cat_id');
     $lang = Input::post('lang');
     $current_news_count = Input::post('current_news_count');
     $type = Input::post('type');
     $cat = Model_Categories::find($cat_id);
     switch ($type) {
         case 'ds_sanpham_4col':
             $show_more = View::forge('customer/cat/show_more_template_ds_sanpham_4col');
             $more_arts = Model_Article::load_articles_limit($cat_id, $lang, $current_news_count, 4);
             break;
         case 'news':
             $show_more = View::forge('customer/cat/show_more_template_news');
             $more_arts = Model_Article::load_articles_limit($cat_id, $lang, $current_news_count, NEWS_LIMIT);
             break;
         case 'ds_monan':
             $show_more = View::forge('customer/cat/show_more_template_ds_monan');
             $more_arts = Model_Article::load_articles_limit($cat_id, $lang, $current_news_count, 8);
             break;
     }
     $count = count($more_arts);
     $ret = '';
     if ($count > 0) {
         $show_more->current_count = Input::post('current_count', 0);
         foreach ($more_arts as $art) {
             ++$show_more->current_count;
             $show_more->art = $art;
             $show_more->cat = $cat;
             $ret .= $show_more;
         }
     }
     return $ret;
 }