Exemplo n.º 1
0
/**
* Compiles a list of installed, version 4.5+ templates
*
* Based on xml files found.  If no xml file found the template
* is ignored
*/
function showThemes()
{
    global $_DOCMAN;
    $database = JFactory::getDBO();
    $mainframe = JFactory::getApplication();
    $limit = $mainframe->getCfg('list_limit');
    $limit = $mainframe->getUserStateFromRequest('viewlistlimit', 'limit', $limit);
    $limitstart = $mainframe->getUserStateFromRequest("view{com_docman}limitstart", 'limitstart', 0);
    $themesBaseDir = DOCMAN_Compat::mosPathName($_DOCMAN->getPath('themes'));
    $rows = array();
    // Read the template dir to find templates
    $themesDirs = DOCMAN_Compat::mosReadDirectory($themesBaseDir);
    $rowid = 0;
    // Check that the directory contains an xml file
    foreach ($themesDirs as $themeDir) {
        $path = DOCMAN_Compat::mosPathName($themesBaseDir . $themeDir);
        $xmlFilesInDir = DOCMAN_Compat::mosReadDirectory($path, '.xml');
        foreach ($xmlFilesInDir as $xmlFile) {
            $rows[] =& parseXMLFile($rowid, $path . $xmlFile);
            $rowid++;
        }
    }
    $pageNav = new DOCMAN_Pagination(count($rows), $limitstart, $limit);
    $rows = array_slice($rows, $pageNav->limitstart, $pageNav->limit);
    HTML_DMThemes::showThemes($rows, $pageNav);
}
Exemplo n.º 2
0
/**
* Compiles a list of installed, version 4.5+ templates
*
* Based on xml files found.  If no xml file found the template
* is ignored
*/
function showThemes()
{
    global $database, $mainframe, $_DOCMAN;
    global $mosConfig_absolute_path, $mosConfig_list_limit;
    $limit = $mainframe->getUserStateFromRequest('viewlistlimit', 'limit', $mosConfig_list_limit);
    $limitstart = $mainframe->getUserStateFromRequest("view{com_docman}limitstart", 'limitstart', 0);
    $themesBaseDir = mosPathName($_DOCMAN->getPath('themes'));
    $rows = array();
    // Read the template dir to find templates
    $themesDirs = DOCMAN_Compat::mosReadDirectory($themesBaseDir);
    $rowid = 0;
    // Check that the directory contains an xml file
    foreach ($themesDirs as $themeDir) {
        $path = mosPathName($themesBaseDir . $themeDir);
        $xmlFilesInDir = DOCMAN_Compat::mosReadDirectory($path, '.xml');
        foreach ($xmlFilesInDir as $xmlFile) {
            $rows[] =& parseXMLFile($rowid, $path . $xmlFile);
            $rowid++;
        }
    }
    require_once $GLOBALS['mosConfig_absolute_path'] . '/administrator/includes/pageNavigation.php';
    $pageNav = new mosPageNav(count($rows), $limitstart, $limit);
    $rows = array_slice($rows, $pageNav->limitstart, $pageNav->limit);
    HTML_DMThemes::showThemes($rows, $pageNav);
}