break; case 2: $linkText = "index.php?option=com_docman&task=doc_details&Itemid={$menuid}&gid=" . $row->id; break; case 3: $linkText = "index.php?option=com_docman&Itemid={$menuid}&task=doc_download" . $itid . "&gid=" . $row->id; break; } $url = JRoute::_($linkText); $html .= "<a class=\"{$class_link}\" href=\"{$url}\">"; // If we are showing the icon, do it if ($show_icon) { $html .= "<img border='0' src=\"" . $doc->getPath('icon', 1, '16x16') . "\" alt=\"" . _DML_FILEICON_ALT . "\" /> "; } // Output the document name $html .= $doc->getData('dmname'); // If we are showing the counter or the category, do it if ($show_counter) { $html .= " (" . $doc->getData('dmcounter') . ")"; } if ($show_category) { $html .= "<br />(" . $row->cat_title . ")"; } // Add the end link and break $html .= "</a>"; // List output if ($show_list == 1) { $html .= "</li>"; } else { $html .= "<br />"; }
require_once $_DOCMAN->getPath('classes', 'utils'); require_once $_DOCMAN->getPath('classes', 'file'); require_once $_DOCMAN->getPath('classes', 'model'); // get the parameters $catid = $params->def('catid', ''); $limits = (int) $params->def('limits', 3); $show_icon = (int) $params->def('show_icon', 1); $show_category = (int) $params->def('show_category', 1); $menuid = $_DOCMAN->getMenuId(); $html = '<div class="mod_docman_catdown' . $params->get('moduleclass_sfx') . '">'; $rows = DOCMAN_Docs::getDocsByUserAccess($catid, '', '', $limits); if (count($rows)) { $html .= '<ul class="mod_docman_catdown' . $params->get('moduleclass_sfx') . '">'; foreach ($rows as $row) { $doc = new DOCMAN_Document($row->id); $url = JRoute::_("index.php?option=com_docman&task=cat_view&Itemid={$menuid}&gid=" . $doc->getData('catid') . "&orderby=dmdate_published&ascdesc=DESC"); $html .= '<li><a href="' . $url . '">'; if ($show_icon) { $html .= '<img src="' . $doc->getPath('icon', 1, '16x16') . '" alt="file icon" border="0" />'; } $html .= $doc->getData('dmname'); if ($show_category) { $html .= '<br />(' . $row->cat_title . ')'; } $html .= '</a></li>'; } $html .= '</ul>'; } else { $html .= '<br />' . _DML_MOD_NODOCUMENTS; } $html .= '</div>';
function fetchMoveDocumentForm($uid) { global $database, $_DMUSER; $doc = new mosDMDocument($database); $doc->load($uid); //check user permissions $err = $_DMUSER->canPreformTask($doc, 'Move'); if ($err) { _returnTo('cat_view', $err, $doc->catid); } $doc = new DOCMAN_Document($uid); // category select list $options = array(mosHTML::makeOption('0', _DML_SELECT_CAT)); $lists['categories'] = dmHTML::categoryList($doc->getData('catid'), "", $options); return HTML_DMDocuments::moveDocumentForm($lists, $doc->getLinkObject(), $doc->getPathObject(), $doc->getDataObject()); }
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) { $doc = new DOCMAN_Document($row->id); $catid = $doc->getData('catid'); $url = JRoute::_("index.php?option=com_docman&task=cat_view&Itemid={$menuid}&gid={$catid}&orderby=dmdate_published"); $html .= '<li><a href="' . $url . '">'; if ($show_icon) { $html .= '<img border="0" src="' . $doc->getPath('icon', 1, '16x16') . '" alt="file icon" /> '; } $html .= $doc->getData('dmname'); if ($show_category) { $html .= '<br />(' . $row->cat_title . ')'; } $html .= '</a></li>'; } $html .= '</ul>'; } else { $html .= "<br />" . _DML_MOD_NODOCUMENTS; }
function getCategoryTree(&$xmap, &$parent, &$params, $catid = 0, $menuid) { $db =& JFactory::getDBO(); $limits = 25; $list = array(); $query = 'select id,title from #__categories where parent_id=' . $catid . ' and section=\'com_docman\' and published=1'; $db->setQuery($query); $rows = $db->loadRowList(); // Get sub-categories list $xmap->changeLevel(1); foreach ($rows as $row) { $node = new stdclass(); $node->id = $menuid; $node->uid = $parent->uid . 'c' . $row[0]; // should be uniq on component $node->name = $row[1]; $node->browserNav = $parent->browserNav; $node->priority = $params['cat_priority']; $node->changefreq = $params['cat_changefreq']; $node->expandible = true; $node->link = 'index.php?option=com_docman&task=cat_view&gid=' . $row[0]; if ($xmap->printNode($node) !== FALSE) { xmap_com_docman::getCategoryTree($xmap, $parent, $params, $row[0], $menuid); } } $xmap->changeLevel(-1); $include_docs = @$params['include_docs']; if ($catid > 0 && $params['include_docs']) { $xmap->changeLevel(1); $rows = DOCMAN_Docs::getDocsByUserAccess($catid, '', '', $limits); // Get documents list foreach ($rows as $row) { $doc = new DOCMAN_Document($row->id); $node = new stdclass(); $node->id = $menuid; $node->uid = $parent->uid . 'd' . $row->id; // should be uniq on component $node->link = 'index.php?option=com_docman&task=' . $params['doc_task'] . '&gid=' . $row->id . '&Itemid=' . $menuid; $node->browserNav = $parent->browserNav; $node->priority = $params['doc_priority']; $node->changefreq = $params['doc_changefreq']; $node->name = $doc->getData('dmname'); $node->type = 'separator'; $node->expandible = false; $xmap->printNode($node); } $xmap->changeLevel(-1); } return true; }
$_DOCMAN->loadLanguage('modules'); 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_counter = abs($params->def('show_counter', 1)); $menuid = $_DOCMAN->getMenuId(); $html = ''; $rows = DOCMAN_Docs::getDocsByUserAccess(0, 'hits', 'DESC', $limits); if (count($rows)) { $html .= '<ul class="dm_mod_mostdown">'; foreach ($rows as $row) { $doc = new DOCMAN_Document($row->id); $url = JRoute::_("index.php?option=com_docman&task=cat_view&Itemid={$menuid}&gid={$row->catid}"); $html .= '<li><a href="' . $url . '">'; if ($show_icon) { $html .= '<img border="0" src="' . $doc->getPath('icon', 1, '16x16') . '" alt="file icon" />'; } $html .= $doc->getData('dmname'); if ($show_counter) { $html .= ' (' . $doc->getData('dmcounter') . ')'; } $html .= '</a></li>'; } $html .= '</ul>'; } else { $html .= "<br />" . _DML_MOD_NODOCUMENTS; } echo $html;