コード例 #1
0
ファイル: default.php プロジェクト: ashanrupasinghe/dnp
        // get current sort order and direction
        $orderby_pri = $this->params->get('orderby_pri');
        // when empty get the state params
        $listordering = $this->state->get('list.ordering');
        if (!$orderby_pri && !empty($listordering)) {
            $state_ordering = $this->state->get('list.ordering');
            $state_direction = $this->state->get('list.direction');
            if ($state_ordering == 'c.title') {
                if ($state_direction == 'DESC') {
                    $orderby_pri = 'ralpha';
                } else {
                    $orderby_pri = 'alpha';
                }
            }
        }
        $data = JDHelper::buildCategorySelectBox($catlistid, $cat_link_itemids, $root_itemid, $jlistConfig['view.empty.categories'], $orderby_pri);
        // build special selectable URLs for category listbox
        $root_url = JRoute::_('index.php?option=com_jdownloads&Itemid=' . $root_itemid);
        $uncat_url = JRoute::_('index.php?option=com_jdownloads&view=downloads&type=uncategorised&Itemid=' . $root_itemid);
        $allfiles_url = JRoute::_('index.php?option=com_jdownloads&view=downloads&Itemid=' . $root_itemid);
        $topfiles_url = JRoute::_('index.php?option=com_jdownloads&view=downloads&type=top&Itemid=' . $root_itemid);
        $newfiles_url = JRoute::_('index.php?option=com_jdownloads&view=downloads&type=new&Itemid=' . $root_itemid);
        $listbox = JHtml::_('select.genericlist', $data['options'], 'cat_list', 'class="inputbox" onchange="gocat(\'' . $root_url . '\', \'' . $uncat_url . '\', \'' . $allfiles_url . '\', \'' . $topfiles_url . '\',  \'' . $newfiles_url . '\'  ,\'' . $data['url'] . '\')"', 'value', 'text', $data['selected']);
        $header = str_replace('{category_listbox}', '<form name="go_cat" id="go_cat" method="post">' . $listbox . '</form>', $header);
    } else {
        $header = str_replace('{category_listbox}', '', $header);
    }
    $html .= $header;
}
// ==========================================
// SUB HEADER SECTION