<?php
$id = '';
if (!empty($this->zoneconfig['conf']['id']))
$id = ' id="' . $this->siteId . '_' . $this->zoneconfig['conf']['id'] . '"';
$data_melisKey = $this->melisKey;
$status = '';
?>
<?php if(!empty($this->siteId)) { ?>
<div <?= $id; ?> data-melisKey="<?= $data_melisKey; ?>">
<div class="spacing-x2 innerAll">
<?php if (!empty($this->modules)) { ?>
<div class="switch-all-container module-loading">
<div class="row d-flex flex-row justify-content-between mb-3">
<div class="col">
<h3 class="<?= ($this->isAdmin) ? 'module-loading-title' : ''; ?>"><?= $this->translate('tr_melis_cms_sites_module_loading'); ?></h3>
</div>
<div class="col">
<div class="switch-all-noti">
<div class="icon-cont clearfix">
<i class="fa fa-info-circle fa-lg float-right tip-info" data-toggle="tooltip" data-placement="left" title="<?=$this->translate('tr_meliscore_module_management_select_deselect_all_module_noti'); ?>"></i>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-5 col-sm-4">
<?php if(!$this->isAdmin) {?>
<div id="not-admin-notice">
<h5 class="float-left"><strong><?= $this->translate('tr_melis_cms_sites_module_load_no_access'); ?></strong></h5>
</div>
<?php } ?>
</div>
<div class="col-md-7 col-sm-8">
<div id="site-select-deselect-all-module" class="<?= $this->siteId ?>_main_switch make-switch " data-on-label="<?= $this->translate('tr_meliscore_common_active'); ?>" data-off-label="<?= $this->translate('tr_meliscore_common_inactive'); ?>" data-text-label="<?= $this->translate('tr_meliscore_tool_user_col_status'); ?>">
<input type="checkbox" <?= $status; ?> checked/>
</div>
</div>
</div>
</div>
<!-- modules -->
<div class="module-settings">
<div class="ms-heading d-flex flex-row justify-content-between">
<h4 id="meliscore-tool-module-content-title"><?= $this->translate('tr_meliscore_module_management_modules'); ?></h4>
<div class="ms-cont">
<div class="module-version-status">
<div class="row ">
<div class="col-md-6 col-sm-6 col-6"><!-- module-version-display -->
<h4 id="header-version" class="module-display-indicator hidden-xs">Version </h4>
</div>
<div class="col-md-6 col-sm-6 col-6">
<div class="icon-cont">
<i class="fa fa-info-circle fa-lg tip-info" data-toggle="tooltip" data-placement="left" title="<?=$this->translate('tr_meliscore_module_management_notification_tip'); ?>"></i>
</div>
</div>
</div>
</div>
</div>
</div>
<form>
<div class="module-sortable">
<?php
$currentEnabled = array();
foreach($this->modules as $moduleName => $moduleStatus)
{
if($moduleStatus === 1){
array_push($currentEnabled,$moduleName);
}
?>
<div class="module-cont clearfix">
<div class="float-left mod-name-container">
<h4 class="mod-name" title="<?= $moduleName; ?>"><?= $moduleName; ?></h4>
</div>
<div class="float-right">
<div class="row">
<div class="col-md-6 col-sm-6 col-xs-6 ">
<h4 class="module-display-indicator hidden-xs"><?= isset($this->modulesInfo[$moduleName]['version']) ? $this->modulesInfo[$moduleName]['version'] : 'v1.0'; ?> </h4>
</div>
<div class="col-md-6 col-sm-6 col-xs-6 ">
<div data-siteModule-name="<?= $moduleName; ?>" class="make-switch <?= $this->siteId ?>_module_switch module-switch" data-on-label="<?= $this->translate('tr_meliscore_common_active'); ?>" data-off-label="<?= $this->translate('tr_meliscore_common_inactive'); ?>" data-text-label="<?= $this->translate('tr_meliscore_tool_user_col_status'); ?>">
<?php
$status = $moduleStatus > 0 ? 'checked' : '';
?>
<input name="moduleLoad<?= $moduleName; ?>" data-siteModule-name="<?= $moduleName; ?>" type="checkbox" <?= $status; ?>/>
</div>
</div>
</div>
</div>
<div class="clearfix"></div>
</div>
<?php
}
?>
<input type="hidden" id="<?= $this->siteId ?>_currentEnabledModule" value='<?= json_encode($currentEnabled);?>'>
<input type="hidden" id="<?= $this->siteId ?>_sitesUsingModules" value='<?= json_encode($this->siteNames);?>'>
<input type="hidden" id="<?= $this->siteId ?>_siteModuleName" value='<?= $this->siteModuleName; ?>'>
</div>
</form>
</div>
<?php } else { ?>
<span class="alert alert-warning"><?= $this->translate('tr_melis_cms_sites_module_no_module_to_load');?></span>
<?php } ?>
</div>
</div>
<script type="text/javascript">
$(document).ready(function() {
// initialize jquery sortable
$(".module-sortable").sortable({
containment: "parent",
placeholder: "ui-sortable-placeholder",
opacity: 0.8,
revert: 300,
tolerance: "pointer",
});
});
</script>
<?php } ?>
|