예제 #1
0
function showTemplates($option)
{
    $kunena_app =& JFactory::getApplication();
    $kunena_db =& JFactory::getDBO();
    $limit = $kunena_app->getUserStateFromRequest("global.list.limit", 'limit', $kunena_app->getCfg('list_limit'), 'int');
    $limitstart = $kunena_app->getUserStateFromRequest("{$option}.limitstart", 'limitstart', 0, 'int');
    $levellimit = $kunena_app->getUserStateFromRequest("{$option}.limit", 'levellimit', 10, 'int');
    $tBaseDir = KUNENA_PATH_TEMPLATE;
    //get template xml file info
    $rows = array();
    $rows = parseXMLTemplateFiles($tBaseDir);
    // set dynamic template information
    for ($i = 0; $i < count($rows); $i++) {
        $rows[$i]->published = isTemplateDefault($rows[$i]->directory);
    }
    jimport('joomla.html.pagination');
    $page = new JPagination(count($rows), $limitstart, $limit);
    $rows = array_slice($rows, $page->limitstart, $page->limit);
    html_Kunena::showTemplates($rows, $page, $option);
}