Example #1
0
function fetchSearchForm($gid, $itemid)
{
    global $search_mode, $ordering, $invert_search, $reverse_order, $search_where, $search_phrase, $search_catid;
    // category select list
    $options = array(mosHTML::makeOption('0', _DML_ALLCATS));
    $lists['catid'] = dmHTML::categoryList($search_catid, "", $options);
    $mode = array();
    $mode[] = mosHTML::makeOption('any', _DML_SEARCH_ANYWORDS);
    $mode[] = mosHTML::makeOption('all', _DML_SEARCH_ALLWORDS);
    $mode[] = mosHTML::makeOption('exact', _DML_SEARCH_PHRASE);
    $mode[] = mosHTML::makeOption('regex', _DML_SEARCH_REGEX);
    $lists['search_mode'] = mosHTML::selectList($mode, 'search_mode', 'id="search_mode" class="inputbox"', 'value', 'text', $search_mode);
    $orders = array();
    $orders[] = mosHTML::makeOption('newest', _DML_SEARCH_NEWEST);
    $orders[] = mosHTML::makeOption('oldest', _DML_SEARCH_OLDEST);
    $orders[] = mosHTML::makeOption('popular', _DML_SEARCH_POPULAR);
    $orders[] = mosHTML::makeOption('alpha', _DML_SEARCH_ALPHABETICAL);
    $orders[] = mosHTML::makeOption('category', _DML_SEARCH_CATEGORY);
    $lists['ordering'] = mosHTML::selectList($orders, 'ordering', 'id="ordering" class="inputbox"', 'value', 'text', $ordering);
    $lists['invert_search'] = '<input type="checkbox" class="inputbox" name="invert_search" ' . ($invert_search ? ' checked ' : '') . '/>';
    $lists['reverse_order'] = '<input type="checkbox" class="inputbox" name="reverse_order" ' . ($reverse_order ? ' checked ' : '') . '/>';
    $matches = array();
    if ($search_where && count($search_where) > 0) {
        foreach ($search_where as $val) {
            $matches[] = mosHTML::makeOption($val, $val);
        }
    } else {
        $matches[] = mosHTML::makeOption('search_description', 'search_description');
    }
    $where = array();
    $where[] = mosHTML::makeOption('search_name', _DML_NAME);
    $where[] = mosHTML::makeOption('search_description', _DML_DESCRIPTION);
    $lists['search_where'] = mosHTML::selectList($where, 'search_where[]', 'id="search_where" class="inputbox" multiple="multiple" size="2"', 'value', 'text', $where);
    return HTML_DMSearch::searchForm($lists, $search_phrase);
}
Example #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());
}
Example #3
0
function copyDocumentForm($cid)
{
    $database = JFactory::getDBO();
    if (!is_array($cid) || count($cid) < 1) {
        echo "<script> alert('" . _DML_SELECT_ITEM_COPY . "'); window.history.go(-1);</script>\n";
        exit;
    }
    // query to list items from documents
    $cids = implode(',', $cid);
    $query = "SELECT dmname FROM #__docman WHERE id IN ( " . $cids . " ) ORDER BY id, dmname";
    $database->setQuery($query);
    $items = $database->loadObjectList();
    // category select list
    $options = array(JHTML::_('select.option', '1', _DML_SELECT_CAT));
    $lists['categories'] = dmHTML::categoryList("", "", $options);
    HTML_DMDocuments::copyDocumentForm($cid, $lists, $items);
}