function &getTree(&$xmap, &$parent, &$params)
 {
     $db =& JFactory::getDBO();
     //DOCMan core interaction API
     include_once JPATH_SITE . "/administrator/components/com_docman/docman.class.php";
     global $_DOCMAN, $_DMUSER;
     if (!is_object($_DOCMAN)) {
         $_DOCMAN = new dmMainFrame();
     }
     if (!is_object($_DMUSER)) {
         $_DMUSER = $_DOCMAN->getUser();
     }
     $_DOCMAN->setType(_DM_TYPE_MODULE);
     $_DOCMAN->loadLanguage('modules');
     require_once $_DOCMAN->getPath('classes', 'utils');
     require_once $_DOCMAN->getPath('classes', 'file');
     require_once $_DOCMAN->getPath('classes', 'model');
     // get the parameters
     $menu = JSite::getMenu();
     $queryparams = $menu->getParams($parent->id);
     $catid = intval($queryparams->get('cat_id', NULL));
     if (!$catid) {
         $link_query = parse_url($parent->link);
         parse_str(html_entity_decode($link_query['query']), $link_vars);
         $catid = JArrayHelper::getValue($link_vars, 'gid', 0);
     }
     $include_docs = JArrayHelper::getValue($params, 'include_docs', 1);
     $include_docs = $include_docs == 1 || $include_docs == 2 && $xmap->view == 'xml' || $include_docs == 3 && $xmap->view == 'html';
     $params['include_docs'] = $include_docs;
     $doc_task = JArrayHelper::getValue($params, 'doc_task', 'doc_details');
     $params['doc_task'] = $doc_task;
     $priority = JArrayHelper::getValue($params, 'cat_priority', $parent->priority);
     $changefreq = JArrayHelper::getValue($params, 'cat_changefreq', $parent->changefreq);
     if ($priority == '-1') {
         $priority = $parent->priority;
     }
     if ($changefreq == '-1') {
         $changefreq = $parent->changefreq;
     }
     $params['cat_priority'] = $priority;
     $params['cat_changefreq'] = $changefreq;
     $priority = JArrayHelper::getValue($params, 'doc_priority', $parent->priority);
     $changefreq = JArrayHelper::getValue($params, 'doc_changefreq', $parent->changefreq);
     if ($priority == '-1') {
         $priority = $parent->priority;
     }
     if ($changefreq == '-1') {
         $changefreq = $parent->changefreq;
     }
     $params['doc_priority'] = $priority;
     $params['doc_changefreq'] = $changefreq;
     $menuid = $parent->id;
     $list = xmap_com_docman::getCategoryTree($xmap, $parent, $params, $catid, $menuid);
     return $list;
 }
Пример #2
0
 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;
 }
// link_type = the type of link to display (default = 0) List=0; Search=1; Details=2; Direct=3
// moduleclass_sfx = module class suffix (default='')
// show_list = show results using <ul> tag (default = 0) No=0; Yes=1
// text_pfx = text to show before list (default='')
// text_sfx = text to show after list (default='')
// limits = number of downloads to display (default = '')
// cat_limit = search a specific category ( or list ) if provided (default='')
// itid = override the passed itemid and use this one, if present (default='')
// order_by = how to order the results (default = 0) Most hits=0; Least hits=1; Newest=2;
//            oldest=3; Alphabet=4; Alphabet, reverse=5
// Include the DOCman class
include_once JPATH_ADMINISTRATOR . DS . "components" . DS . "com_docman" . DS . "docman.class.php";
//DOCman core interaction API
global $_DOCMAN, $_DMUSER;
if (!is_object($_DOCMAN)) {
    $_DOCMAN = new dmMainFrame();
    $_DMUSER = $_DOCMAN->getUser();
}
$_DOCMAN->setType(_DM_TYPE_MODULE);
$_DOCMAN->loadLanguage('modules');
// Include some other DOCman classes
require_once $_DOCMAN->getPath('classes', 'utils');
require_once $_DOCMAN->getPath('classes', 'file');
require_once $_DOCMAN->getPath('classes', 'model');
// get the parameters
$show_icon = (int) $params->def('show_icon', 1);
$show_counter = (int) $params->def('show_counter', 1);
$show_category = (int) $params->def('show_category', 1);
$link_type = (int) $params->def('link_type', 0);
$moduleclass_sfx = $params->get('moduleclass_sfx');
$show_list = (int) $params->def('show_list', 0);
Пример #4
0
/**
 * @version		$Id: helper.php 1041 2009-12-12 14:10:31Z mathias $
 * @category	DOCman
 * @package		DOCman15
 * @copyright	Copyright (C) 2003 - 2009 Johan Janssens and Mathias Verraes. All rights reserved.
 * @license		GNU GPLv2 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
 * @link     	http://www.joomladocman.org
 */
defined('_JEXEC') or die('Restricted access');
if (!defined('DS')) {
    define('DS', DIRECTORY_SEPARATOR);
}
require_once dirname(__FILE__) . DS . '..' . DS . 'docman.class.php';
global $_DOCMAN, $_DMUSER;
$_DOCMAN = new dmMainFrame();
$_DMUSER = $_DOCMAN->getUser();
require_once $_DOCMAN->getPath('classes', 'compat');
define('_DM_INSTALLER_ICONPATH', 'components/com_docman/images/');
jimport('joomla.filesystem.file');
jimport('joomla.filesystem.folder');
class DMStatus
{
    var $_success = true;
    var $_msgs = array();
    function &getInstance()
    {
        static $instance;
        if (!isset($instance)) {
            $instance = new DMStatus();
        }
Пример #5
0
<?php

/**
 * @version		$Id: docman.php 1607 2012-05-22 00:24:11Z johanjanssens $
 * @category	DOCman
 * @package		DOCman15
 * @copyright	Copyright (C) 2003 - 2012 Johan Janssens. All rights reserved.
 * @license		GNU GPLv2 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
 * @link     	http://www.joomladocman.org
 */
defined('_JEXEC') or die('Restricted access');
require_once JApplicationHelper::getPath('front_html');
require_once JApplicationHelper::getPath('class');
global $_DOCMAN, $_DMUSER, $Itemid, $gid, $task, $gid, $script, $ordering, $direction, $revision, $archive, $limitstart, $limit, $total;
$_DOCMAN = new dmMainFrame();
$_DOCMAN->loadLanguage('frontend');
$_DMUSER = $_DOCMAN->getUser();
require_once $_DOCMAN->getPath('classes', 'html');
require_once $_DOCMAN->getPath('classes', 'utils');
require_once $_DOCMAN->getPath('classes', 'theme');
require_once $_DOCMAN->getPath('classes', 'compat');
require_once $_DOCMAN->getPath('classes', 'token');
// Component Menu parameters
jimport('joomla.application.menu');
$menu =& JMenu::getInstance('site');
$params =& $menu->getParams($Itemid);
// Request vars
$task = JRequest::getVar("task", "");
$gid = JRequest::getInt("gid", $params->get('cat_id', 0));
$script = JRequest::getInt("script", 0);
$ordering = JRequest::getCmd("order", $_DOCMAN->getCfg('default_order'));
Пример #6
0
<?php

/**
 * @version		$Id: router.php 953 2009-10-14 20:38:38Z mathias $
 * @category	DOCman
 * @package		DOCman15
 * @copyright	Copyright (C) 2003 - 2009 Johan Janssens and Mathias Verraes. All rights reserved.
 * @license		GNU GPLv2 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
 * @link     	http://www.joomladocman.org
 */
defined('_JEXEC') or die('Restricted access');
require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_docman' . DS . 'docman.class.php';
require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_docman' . DS . 'classes' . DS . 'DOCMAN_utils.class.php';
global $_DOCMAN, $_DMUSER;
if (!is_object($_DOCMAN)) {
    $_DOCMAN = new dmMainFrame();
    $_DMUSER = $_DOCMAN->getUser();
}
class DocmanRouterHelper
{
    function getDoc($id)
    {
        static $docs;
        if (!isset($docs)) {
            $docs = array();
        }
        if (!isset($docs[$id])) {
            $docs[$id] = false;
            $db =& JFactory::getDBO();
            $docs[$id] = new mosDMDocument($db);
            $docs[$id]->load($id);
Пример #7
0
<?php

/**
 * @version		$Id: docman.searchbot.php 983 2009-11-27 10:35:10Z mathias $
 * @category	DOCman
 * @package		DOCman15
 * @copyright	Copyright (C) 2003 - 2009 Johan Janssens and Mathias Verraes. All rights reserved.
 * @license		GNU GPLv2 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
 * @link     	http://www.joomladocman.org
 */
defined('_JEXEC') or die('Restricted access');
include_once JPATH_ADMINISTRATOR . "/components/com_docman/docman.class.php";
//DOCman core interaction API
global $_DOCMAN, $_DMUSER;
if (!is_object($_DOCMAN)) {
    $_DOCMAN = new dmMainFrame();
    $_DMUSER = $_DOCMAN->getUser();
}
include_once $_DOCMAN->getPath('classes', 'utils');
/** Register our search function with Joomla */
$mainframe = JFactory::getApplication();
$mainframe->registerEvent('onSearch', 'botSearchDocman');
$mainframe->registerEvent('onSearchAreas', 'plgSearchDocmanAreas');
/**
 * @return array An array of search areas
 */
function &plgSearchDocmanAreas()
{
    static $areas = array('docman' => 'DOCman');
    return $areas;
}
/**
 * @version		$Id: admin.docman.php 1607 2012-05-22 00:24:11Z johanjanssens $
 * @category	DOCman
 * @package		DOCman15
 * @copyright	Copyright (C) 2003 - 2012 Johan Janssens. All rights reserved.
 * @license		GNU GPLv2 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
 * @link     	http://www.joomladocman.org
 */
defined('_JEXEC') or die('Restricted access');
$acl = JFactory::getACL();
$app = JFactory::getApplication();
require_once JApplicationHelper::getPath('admin_html');
require_once JApplicationHelper::getPath('class');
global $_DOCMAN, $_DMUSER, $cid, $gid, $id, $pend, $updatedoc, $sort, $view_type, $css, $task, $option;
$_DOCMAN = new dmMainFrame();
if (JRequest::getCmd('task') != 'doclink-listview') {
    // bit of a hack for doclink issue
    $_DOCMAN->loadLanguage('backend');
}
$_DMUSER = $_DOCMAN->getUser();
require_once $_DOCMAN->getPath('classes', 'html');
require_once $_DOCMAN->getPath('classes', 'utils');
require_once $_DOCMAN->getPath('classes', 'token');
$cid = JRequest::getVar('cid', array(0), 'request', 'array');
$gid = JRequest::getInt('gid', 0);
// retrieve some expected url (or form) arguments
$pend = JRequest::getWord('pend', 'no');
$updatedoc = JRequest::getInt('updatedoc', 0);
$sort = JRequest::getString('sort', 0);
$view_type = JRequest::getInt('view', 1);