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;
 }
Exemple #2
0
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());
}
Exemple #3
0
    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;
    }
Exemple #4
0
function fetchDocumentLicenseForm($uid, $inline = 0)
{
    $doc = new DOCMAN_Document($uid);
    return HTML_DMDownload::licenseDocumentForm($doc->getLinkObject(), $doc->getPathObject(), $doc->getDataObject(), $inline);
}