function &getTree(&$xmap, &$parent, &$params)
 {
     $db =& JFactory::getDBO();
     //DOCMan core interaction API
     include_once JPATH_SITE . "/administrator/components/com_docman/docman.class.php";
     global $_DOCMAN, $_DMUSER;
     if (!is_object($_DOCMAN)) {
         $_DOCMAN = new dmMainFrame();
     }
     if (!is_object($_DMUSER)) {
         $_DMUSER = $_DOCMAN->getUser();
     }
     $_DOCMAN->setType(_DM_TYPE_MODULE);
     $_DOCMAN->loadLanguage('modules');
     require_once $_DOCMAN->getPath('classes', 'utils');
     require_once $_DOCMAN->getPath('classes', 'file');
     require_once $_DOCMAN->getPath('classes', 'model');
     // get the parameters
     $menu = JSite::getMenu();
     $queryparams = $menu->getParams($parent->id);
     $catid = intval($queryparams->get('cat_id', NULL));
     if (!$catid) {
         $link_query = parse_url($parent->link);
         parse_str(html_entity_decode($link_query['query']), $link_vars);
         $catid = JArrayHelper::getValue($link_vars, 'gid', 0);
     }
     $include_docs = JArrayHelper::getValue($params, 'include_docs', 1);
     $include_docs = $include_docs == 1 || $include_docs == 2 && $xmap->view == 'xml' || $include_docs == 3 && $xmap->view == 'html';
     $params['include_docs'] = $include_docs;
     $doc_task = JArrayHelper::getValue($params, 'doc_task', 'doc_details');
     $params['doc_task'] = $doc_task;
     $priority = JArrayHelper::getValue($params, 'cat_priority', $parent->priority);
     $changefreq = JArrayHelper::getValue($params, 'cat_changefreq', $parent->changefreq);
     if ($priority == '-1') {
         $priority = $parent->priority;
     }
     if ($changefreq == '-1') {
         $changefreq = $parent->changefreq;
     }
     $params['cat_priority'] = $priority;
     $params['cat_changefreq'] = $changefreq;
     $priority = JArrayHelper::getValue($params, 'doc_priority', $parent->priority);
     $changefreq = JArrayHelper::getValue($params, 'doc_changefreq', $parent->changefreq);
     if ($priority == '-1') {
         $priority = $parent->priority;
     }
     if ($changefreq == '-1') {
         $changefreq = $parent->changefreq;
     }
     $params['doc_priority'] = $priority;
     $params['doc_changefreq'] = $changefreq;
     $menuid = $parent->id;
     $list = xmap_com_docman::getCategoryTree($xmap, $parent, $params, $catid, $menuid);
     return $list;
 }
// text_sfx = text to show after list (default='')
// limits = number of downloads to display (default = '')
// cat_limit = search a specific category ( or list ) if provided (default='')
// itid = override the passed itemid and use this one, if present (default='')
// order_by = how to order the results (default = 0) Most hits=0; Least hits=1; Newest=2;
//            oldest=3; Alphabet=4; Alphabet, reverse=5
// Include the DOCman class
include_once JPATH_ADMINISTRATOR . DS . "components" . DS . "com_docman" . DS . "docman.class.php";
//DOCman core interaction API
global $_DOCMAN, $_DMUSER;
if (!is_object($_DOCMAN)) {
    $_DOCMAN = new dmMainFrame();
    $_DMUSER = $_DOCMAN->getUser();
}
$_DOCMAN->setType(_DM_TYPE_MODULE);
$_DOCMAN->loadLanguage('modules');
// Include some other DOCman classes
require_once $_DOCMAN->getPath('classes', 'utils');
require_once $_DOCMAN->getPath('classes', 'file');
require_once $_DOCMAN->getPath('classes', 'model');
// get the parameters
$show_icon = (int) $params->def('show_icon', 1);
$show_counter = (int) $params->def('show_counter', 1);
$show_category = (int) $params->def('show_category', 1);
$link_type = (int) $params->def('link_type', 0);
$moduleclass_sfx = $params->get('moduleclass_sfx');
$show_list = (int) $params->def('show_list', 0);
$text_pfx = $params->def('text_pfx', '');
$text_sfx = $params->def('text_sfx', '');
$limits = (int) $params->def('limits', '');
$cat_limit = $params->def('cat_limit', '');
<?php

/**
 * @version		$Id: docman.php 1607 2012-05-22 00:24:11Z johanjanssens $
 * @category	DOCman
 * @package		DOCman15
 * @copyright	Copyright (C) 2003 - 2012 Johan Janssens. All rights reserved.
 * @license		GNU GPLv2 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
 * @link     	http://www.joomladocman.org
 */
defined('_JEXEC') or die('Restricted access');
require_once JApplicationHelper::getPath('front_html');
require_once JApplicationHelper::getPath('class');
global $_DOCMAN, $_DMUSER, $Itemid, $gid, $task, $gid, $script, $ordering, $direction, $revision, $archive, $limitstart, $limit, $total;
$_DOCMAN = new dmMainFrame();
$_DOCMAN->loadLanguage('frontend');
$_DMUSER = $_DOCMAN->getUser();
require_once $_DOCMAN->getPath('classes', 'html');
require_once $_DOCMAN->getPath('classes', 'utils');
require_once $_DOCMAN->getPath('classes', 'theme');
require_once $_DOCMAN->getPath('classes', 'compat');
require_once $_DOCMAN->getPath('classes', 'token');
// Component Menu parameters
jimport('joomla.application.menu');
$menu =& JMenu::getInstance('site');
$params =& $menu->getParams($Itemid);
// Request vars
$task = JRequest::getVar("task", "");
$gid = JRequest::getInt("gid", $params->get('cat_id', 0));
$script = JRequest::getInt("script", 0);
$ordering = JRequest::getCmd("order", $_DOCMAN->getCfg('default_order'));
 * @link     	http://www.joomladocman.org
 */
defined('_JEXEC') or die('Restricted access');
// you can define the following parameters at administration:
// limits = number of downloads to display (default = 3);
// show_icon = displays a generic icon near the name of the document
// show_category = displays the category of the document
include_once JPATH_ADMINISTRATOR . DS . "components" . DS . "com_docman" . DS . "docman.class.php";
//DOCman core interaction API
global $_DOCMAN, $_DMUSER;
if (!is_object($_DOCMAN)) {
    $_DOCMAN = new dmMainFrame();
    $_DMUSER = $_DOCMAN->getUser();
}
$_DOCMAN->setType(_DM_TYPE_MODULE);
$_DOCMAN->loadLanguage('modules');
$_DOCMAN->loadLanguage('frontend');
require_once $_DOCMAN->getPath('classes', 'utils');
require_once $_DOCMAN->getPath('classes', 'file');
require_once $_DOCMAN->getPath('classes', 'model');
// get the parameters
$limits = abs($params->def('limits', 3));
$show_icon = abs($params->def('show_icon', 1));
$show_category = abs($params->def('show_category', 1));
$moduleclass_sfx = $params->get('moduleclass_sfx');
$menuid = $_DOCMAN->getMenuId();
$html = '<div class="mod_docman_catdown' . $moduleclass_sfx . '">';
$rows = DOCMAN_Docs::getDocsByUserAccess(0, 'date', 'desc', $limits);
if (count($rows)) {
    $html .= '<ul class="mod_docman_latestdown">';
    foreach ($rows as $row) {
 * @category	DOCman
 * @package		DOCman15
 * @copyright	Copyright (C) 2003 - 2012 Johan Janssens. All rights reserved.
 * @license		GNU GPLv2 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
 * @link     	http://www.joomladocman.org
 */
defined('_JEXEC') or die('Restricted access');
$acl = JFactory::getACL();
$app = JFactory::getApplication();
require_once JApplicationHelper::getPath('admin_html');
require_once JApplicationHelper::getPath('class');
global $_DOCMAN, $_DMUSER, $cid, $gid, $id, $pend, $updatedoc, $sort, $view_type, $css, $task, $option;
$_DOCMAN = new dmMainFrame();
if (JRequest::getCmd('task') != 'doclink-listview') {
    // bit of a hack for doclink issue
    $_DOCMAN->loadLanguage('backend');
}
$_DMUSER = $_DOCMAN->getUser();
require_once $_DOCMAN->getPath('classes', 'html');
require_once $_DOCMAN->getPath('classes', 'utils');
require_once $_DOCMAN->getPath('classes', 'token');
$cid = JRequest::getVar('cid', array(0), 'request', 'array');
$gid = JRequest::getInt('gid', 0);
// retrieve some expected url (or form) arguments
$pend = JRequest::getWord('pend', 'no');
$updatedoc = JRequest::getInt('updatedoc', 0);
$sort = JRequest::getString('sort', 0);
$view_type = JRequest::getInt('view', 1);
$task = JRequest::getVar('task');
if (!isset($section)) {
    global $section;