Beispiel #1
0
 public static function getArticles($params, $catid, $count, $front = 'show')
 {
     require_once JPATH_ROOT . '/modules/mod_articles_category/helper.php';
     $aparams = clone $params;
     $aparams->set('count', $count);
     $aparams->set('show_front', $front);
     $aparams->set('catid', (array) $catid);
     $aparams->set('show_child_category_articles', 1);
     $aparams->set('levels', 2);
     $alist = ModArticlesCategoryHelper::getList($aparams);
     return $alist;
 }
Beispiel #2
0
$cacheid = md5(serialize(array($idbase, $module->module)));
$cacheparams = new stdClass();
$cacheparams->cachemode = 'id';
$cacheparams->class = 'ModArticlesCategoryHelper';
$cacheparams->method = 'getList';
$cacheparams->methodparams = $params;
$cacheparams->modeparams = $cacheid;
$list = JModuleHelper::moduleCache($module, $params, $cacheparams);
if (!empty($list)) {
    $grouped = false;
    $article_grouping = $params->get('article_grouping', 'none');
    $article_grouping_direction = $params->get('article_grouping_direction', 'ksort');
    $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'));
    $item_heading = $params->get('item_heading');
    if ($article_grouping !== 'none') {
        $grouped = true;
        switch ($article_grouping) {
            case 'year':
            case 'month_year':
                $list = ModArticlesCategoryHelper::groupByDate($list, $article_grouping, $article_grouping_direction, $params->get('month_year_format', 'F Y'));
                break;
            case 'author':
            case 'category_title':
                $list = ModArticlesCategoryHelper::groupBy($list, $article_grouping, $article_grouping_direction);
                break;
            default:
                break;
        }
    }
    require JModuleHelper::getLayoutPath('mod_articles_category', $params->get('layout', 'default'));
}