function plugin($id) { global $_DOCMAN; if (!$id) { return; } require_once $_DOCMAN->getPath('classes', 'model'); $doc = new DOCMAN_Document($id); $item = new StdClass(); $item->links =& $doc->getLinkObject(); $item->paths =& $doc->getPathObject(); $item->data =& $doc->getDataObject(); return $item; }
function showDocumentView($gid) { global $_DOCMAN; $database = JFactory::getDBO(); $doc = new DOCMAN_Document($gid); $data =& $doc->getDataObject(); //check if we need to display a license if ($_DOCMAN->getCfg('display_license') && ($data->dmlicense_display && $data->dmlicense_id)) { //fetch the license form $html = new StdClass(); $html->doclicense = fetchDocumentLicenseForm($gid, 1); //get the license text $license = new mosDMLicenses($database); $license->load($data->dmlicense_id); HTML_docman::pageDocumentLicense($html, $license->license); } else { download($doc, true); } }
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()); }
function createItems($rows) { global $_DOCMAN, $mosConfig_live_site; $html = ''; foreach ($rows as $row) { $doc = new DOCMAN_Document($row->id); $links = $doc->getLinkObject(); $paths = $doc->getPathObject(); $details = $doc->getDataObject(); $icon = $doc->getPath('icon', 1, '16x16'); $url = DOCMAN_Utils::_rawLink('doc_download', $details->id); if ($details->dmlastupdateon != "0000-00-00 00:00:00") { $itemtime = $details->dmlastupdateon; } else { $itemtime = $details->dmdate_published; } ?> <tr> <td><img src="<?php echo $icon; ?> " alt="<?php echo $details->dmname; ?> " /></td> <td><a href="javascript:;" onClick="onclickItem('<?php echo addslashes($details->dmname); ?> ', '<?php echo $url; ?> ', <?php echo $details->catid; ?> , '<?php echo $icon; ?> ', '<?php echo $details->filesize; ?> ', '<?php echo $itemtime; ?> ');"><?php echo $details->dmname; ?> </td> <td><?php echo $details->filesize; ?> </td> <td><?php echo $itemtime; ?> </td> </tr> <?php } return $html; }
function fetchDocumentLicenseForm($uid, $inline = 0) { $doc = new DOCMAN_Document($uid); return HTML_DMDownload::licenseDocumentForm($doc->getLinkObject(), $doc->getPathObject(), $doc->getDataObject(), $inline); }