<?php

defined( '_JEXEC' ) or die ;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Language\Text;
$configClass = EdocmanHelper::loadConfig();

if($configClass->enable_massdownload)
{
?>
	<div id="mass-download-system" class="mass-download-system level-1">
		<div class="mdp-level-1">
			<button id="mdp-toggle-btn" class="mdp-toggle-btn" title="<?php echo Text::_('EDOCMAN_MASS_DOWNLOAD'); ?>">
				<i class="fas fa-download"></i>
				<span class="badge" id="mdp-count-badge">0</span>
			</button>
		</div>
		
		<div class="mdp-level-2">
			<div class="mdp-bar">
				<div class="mdp-bar-info">
					<i class="fas fa-download"></i>
					<span><?php echo Text::_('EDOCMAN_MASS_DOWNLOAD'); ?></span>
					<span class="badge" id="mdp-bar-count">0</span>
				</div>
				<div class="mdp-bar-actions">
					<button id="mdp-download-btn" class="btn btn-primary" disabled title="<?php echo Text::_('EDOCMAN_DOWNLOAD_ALL'); ?>">
						<i class="fas fa-file-archive"></i> <?php echo Text::_('EDOCMAN_DOWNLOAD_ALL'); ?>
					</button>
					<button id="mdp-clear-btn" class="btn btn-danger" disabled title="<?php echo Text::_('EDOCMAN_CLEAR_ALL'); ?>">
						<i class="fas fa-trash"></i> <?php echo Text::_('EDOCMAN_CLEAR_ALL'); ?>
					</button>
					<button id="mdp-expand-btn" class="btn btn-secondary" title="<?php echo Text::_('EDOCMAN_EXPAND'); ?>">
						<i class="fas fa-chevron-up"></i>
					</button>
					<button id="mdp-minimize-btn" class="btn btn-secondary" title="<?php echo Text::_('EDOCMAN_MINIMIZE'); ?>">
						<i class="fas fa-chevron-down"></i>
					</button>
				</div>
			</div>
		</div>
		
		<div class="mdp-level-3">
			<div class="mdp-panel">
				<div class="mdp-panel-header">
					<h3>
						<i class="fas fa-download"></i>
						<?php echo Text::_('EDOCMAN_MASS_DOWNLOAD'); ?>
						<span class="badge" id="mdp-panel-count">0</span>
					</h3>
					<div class="mdp-panel-actions">
						<button id="mdp-panel-download-btn" class="btn btn-primary" disabled title="<?php echo Text::_('EDOCMAN_DOWNLOAD_ALL'); ?>">
							<i class="fas fa-file-archive"></i> <?php echo Text::_('EDOCMAN_DOWNLOAD_ALL'); ?>
						</button>
						<button id="mdp-panel-clear-btn" class="btn btn-danger" disabled title="<?php echo Text::_('EDOCMAN_CLEAR_ALL'); ?>">
							<i class="fas fa-trash"></i> <?php echo Text::_('EDOCMAN_CLEAR_ALL'); ?>
						</button>
						<button id="mdp-collapse-btn" class="btn btn-secondary" title="<?php echo Text::_('EDOCMAN_COLLAPSE'); ?>">
							<i class="fas fa-chevron-down"></i>
						</button>
					</div>
				</div>
				<div class="mdp-panel-body">
					<div id="mdp-file-list" class="mdp-file-list">
						<div class="mdp-empty-message">
							<i class="fas fa-info-circle"></i>
							<p><?php echo Text::_('EDOCMAN_NO_DOCUMENTS'); ?></p>
						</div>
					</div>
				</div>
			</div>
		</div>
		
		<div id="mdp-toast-container" class="mdp-toast-container"></div>
	</div>
	<?php
	Text::script('EDOCMAN_NO_DOCUMENTS');
	Text::script('EDOCMAN_DOCUMENT_ADDED');
	Text::script('EDOCMAN_DOCUMENT_REMOVED');
	Text::script('EDOCMAN_ALL_DOCUMENTS_CLEARED');
	Text::script('EDOCMAN_DOWNLOADING');
	Text::script('EDOCMAN_DOWNLOAD_STARTED');
	Text::script('EDOCMAN_DOWNLOAD_ERROR');
	Text::script('EDOCMAN_YOUR_BROWSER_WILL_DISPLAY_DOWNLOAD_DIALOG');
	Text::script('EDOCMAN_NOTICE');
	Text::script('EDOCMAN_THE_DOCUMENT_IS_ALREADY_IN_MASS_DOWNLOAD_LIST');
	Text::script('EDOCMAN_DOCUMENT_ADDED_NOTICE');
	Text::script('EDOCMAN_REMOVE');
	Text::script('EDOCMAN_CLEAR_ALL');
	Text::script('EDOCMAN_PREPARING_TO_DOWNLOAD_ALL_DOCUMENTS');
	Text::script('EDOCMAN_DOWNLOAD_STARTING');
	?>
	<script>
	const live_site = '<?php echo Uri::root()?>';
	</script>
	<script src="<?php echo Uri::root(); ?>components/com_edocman/assets/js/mass_download.js" type="text/javascript"></script>
<?php } ?>