<?php
/**
 * @package     DOCman
 * @copyright   Copyright (C) 2019 Timble CVBA. (http://www.timble.net)
 * @license     GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
 * @link        http://www.joomlatools.com
 */

$config = [
    'aliases' => [
        'connect'                        => 'com:docman.controller.connect',
        'docman.users'                   => 'com:docman.database.table.users',
        'lib:database.query.select'      => 'com:docman.database.query.select',
        'com:base.database.query.select' => 'com:docman.database.query.select'
    ],
    'identifiers' => [
        'com:docman.view.behavior.notifiable' => [
            'notifiers' => [
                'com:docman.notifier.email'
            ]
        ],
        'com:base.dispatcher.page' => [
            'behaviors' => [
                'com:docman.dispatcher.behavior.licensable'
            ],
            'blocks' => [
                'com:docman.block.attachments',
                'com:docman.block.list',
                'com:docman.block.tree',
                'com:docman.block.flat',
                'com:docman.block.submit',
                'com:docman.block.search'
            ],
            'endpoints' => [
                '~documents' => [
                    'route' => 'component=docman',
                    'title' => 'Documents',
                ],
            ]
        ],
        'com:scheduler.controller.dispatcher' => [
            'jobs' => [
                'com:docman.job.license',
                'com:docman.job.multidownload',
                'com:docman.job.scans',
                'com:docman.job.emails',
                'com:docman.job.documents',
                'com:docman.job.categories'
            ]
        ],
    ]
];

// Enable group joins on multi-site environments for proper per site user filtering

if (is_multisite()) {
    $config['identifiers']['com:base.model.users'] = ['behaviors' => ['com:docman.model.behavior.groupable']];
}

return $config;
