function showListview() { global $_DOCMAN; $assets = JURI::root() . "components/com_docman/assets"; // add styles and scripts $doc =& JFactory::getDocument(); JHTML::_('behavior.mootools'); $doc->addStyleSheet($assets . '/css/doclink.css'); $doc->addScript($assets . '/js/sortabletable.js'); $doc->addScript($assets . '/js/listview.js'); if (isset($_REQUEST['catid'])) { $cid = intval($_REQUEST['catid']); } else { $cid = 0; } //get folders $cats = DOCMAN_Cats::getChildsByUserAccess($cid); //get items if ($cid) { $docs = DOCMAN_Docs::getDocsByUserAccess($cid, 'name', 'ASC', 999, 0); } else { $docs = array(); } //if ($entries_cnt) HTML_DMDoclink::createHeader(); HTML_DMDoclink::createFolders($cats, $cid); HTML_DMDoclink::createItems($docs, $cid); HTML_DMDoclink::createFooter(); }
function fetchCategoryList($id) { global $_DOCMAN, $_DMUSER; $children = DOCMAN_Cats::getChildsByUserAccess($id); $items = array(); foreach ($children as $child) { $cat = new DOCMAN_Category($child->id); // process content mambots DOCMAN_Utils::processContentBots($cat, 'description'); $item = new StdClass(); $item->links =& $cat->getLinkObject(); $item->paths =& $cat->getPathObject(); $item->data =& $cat->getDataObject(); $items[] = $item; } // display the entries return HTML_DMCategories::displayCategoryList($items); }
function getLinks($args) { global $_DOCMAN, $mainframe; $wf = WFEditorPlugin::getInstance(); jimport('joomla.filesystem.file'); require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_docman' . DS . 'docman.class.php'; //DOCMan core interaction API $_DOCMAN = new dmMainFrame(_DM_TYPE_DOCLINK); // Load classes and language require_once $_DOCMAN->getPath('classes', 'utils'); $cid = isset($args->gid) ? $args->gid : 0; //get folders $categories = DOCMAN_Cats::getChildsByUserAccess($cid); $items = array(); $view = isset($args->view) ? $args->view : ''; switch ($view) { default: foreach ($categories as $category) { $items[] = array('id' => 'index.php?option=com_docman&view=category&gid=' . $category->id . WFLinkBrowser::getItemId('com_docman'), 'name' => $category->name, 'class' => 'folder docmanlinks'); } break; case 'category': //get items if ($cid) { $categories = DOCMAN_Cats::getChildsByUserAccess($cid); $documents = DOCMAN_Docs::getDocsByUserAccess($cid, 'name', 'ASC', 999, 0); } else { $categories = array(); $documents = array(); } foreach ($categories as $category) { $items[] = array('id' => 'index.php?option=com_docman&view=category&gid=' . $category->id . WFLinkBrowser::getItemId('com_docman'), 'name' => $category->name, 'class' => 'folder docmanlinks'); } foreach ($documents as $document) { $items[] = array('id' => 'index.php?option=com_docman&task=doc_' . $wf->getParam('docmanlinks_link', 'download') . '&gid=' . $document->id . WFLinkBrowser::getItemId('com_docman'), 'name' => $document->dmname, 'class' => 'file docmanlinks ' . JFile::getExt($document->dmfilename)); } break; } return $items; }