<?php
$id = '';
if (!empty($this->zoneconfig['conf']['id'])) {
$id = ' id="' . $this->siteId . '_' . $this->zoneconfig['conf']['id'] . '"';
}
$data_melisKey = $this->melisKey;
?>
<?php if(!empty($this->siteId)) { ?>
<div <?= $id; ?> data-melisKey="<?= $data_melisKey; ?>">
<div class="spacing-x2 innerAll">
<div class="switch-all-container">
<div class="row">
<div class="col-md-12">
<h3 class="float-left"><?= $this->translate('tr_melis_cms_sites_tool_content_edit_site_config_tab') ?></h3>
</div>
</div>
</div>
<br>
<div class="alert alert-warning" role="alert">
<?= $this->translate('tr_melis_cms_sites_tool_config_array_warning'); ?>
</div>
<div class="row">
<div class="col-xs-12 col-md-2">
<div class="product-text-tab-container" >
<ul class="nav-tabs product-text-tab meliscms-site-language-homepage-list">
<!-- GENERAL TAB START -->
<li class="">
<a class="clearfix" data-toggle="tab" href="#general-config-<?= $this->siteId; ?>" aria-expanded="true" data-env-id="general">
<span><?= $this->translate('tr_melis_cms_sites_tool_general') ?></span>
</a>
</li>
<!-- GENERAL TAB END -->
<!-- OTHER LANGUAGES START -->
<?php foreach($this->activeSiteLangs as $lang) :?>
<li class="">
<a class="clearfix" data-toggle="tab" id="news_cms_lang_<?= $lang['slang_lang_id'] ?>" href="#<?= $lang['lang_cms_locale']; ?>-config-<?= $this->siteId; ?>" aria-expanded="true" data-env-id="<?= $lang['slang_lang_id'] ?>">
<span class="float-right">
<img src="<?= $this->serverUrl() . '/MelisCms/images/lang-flags/' . $lang['lang_cms_locale'] . '.png' ?>" class="float-right">
</span>
<span><?= $lang['lang_cms_name'] ?></span>
</a>
</li>
<?php endforeach; ?>
<!-- OTHER LANGUAGES END -->
</ul>
</div>
</div>
<div class="col-xs-12 col-md-3">
<div class="tab-content">
<!-- GENERAL TAB START -->
<div id="general-config-<?= $this->siteId; ?>" class="tab-pane product-text-tab-content">
<div class="bg-white">
<h4 class=""><i class="fa fa-map-marker"></i> <?= $this->translate('tr_melis_cms_sites_tool_general') ?></h4>
</div>
<div id="cms_site_config_general">
<?php
$form = clone $this->configForm;
$form->setAttribute('id', 'gen_' . $form->getAttribute('id'));
foreach ($form->getElements() as $element => $attributes) {
$el = $form->get((string) $element);
if ($el->getName() == 'sconf_id') {
if (array_key_exists(-1, $this->dbConfIds)) {
$el->setValue($this->dbConfIds[-1]);
}
}
$el->setName("gen_".$el->getName());
$el->setAttribute('id', $el->getName());
}
echo $this->form()->openTag($form);
echo $this->melisFieldCollection($form);
?>
<!-- ADDITIONAL INPUTS START -->
<?php if (!empty($this->config['site'][$this->siteName]['allSites'])) : ?>
<?php foreach ($this->config['site'][$this->siteName]['allSites'] as $configKey => $config) : ?>
<?php if (!is_array($config)) : ?>
<?php if (!empty($this->valuesFromDb['allSites'][$configKey])) : ?>
<label><?= $configKey ?></label>
<div class="input-group ">
<input type="text" class="form-control" name="gen_sconf_<?= $configKey ?>" id="gen_<?= $configKey ?>" value="<?= $config ?>">
<span class="input-group-addon"><i class="fa fa-database fa-lg" style="width: 20px;" title="<?= $this->translate('tr_melis_cms_sites_tool_database_value') ?>"></i></span>
</div>
<br>
<?php else : ?>
<label><?= $configKey ?></label>
<div class="input-group ">
<input type="text" class="form-control" name="gen_sconf_<?= $configKey ?>" id="gen_<?= $configKey ?>" value="<?= $config ?>">
<span class="input-group-addon"><i class="fa fa-cogs fa-lg" style="width: 20px;" title="<?= $this->translate('tr_melis_cms_sites_tool_default_value') ?>"></i></span>
</div>
<br>
<?php endif; ?>
<?php else : ?>
<label><?= $configKey ?> (array)</label>
<br>
<?php foreach ($config as $key => $value) : ?>
<?php if (!is_array($value)) : ?>
<div>
<?php if (!is_int($key)) : ?>
<label style="margin-left: 50px;"><?= $key ?></label>
<?php endif; ?>
<?php if (isset($this->valuesFromDb['allSites'][$configKey][$key])) : ?>
<div class="input-group" style="left: 50px;">
<input type="text" class="form-control" name="gen_sconf_<?= $configKey ?>[<?= $key ?>]" id="gen_<?= $key ?>" value="<?= $value ?>">
<span class="input-group-addon"><i class="fa fa-database fa-lg" style="width: 20px;" title="<?= $this->translate('tr_melis_cms_sites_tool_database_value') ?>"></i></span>
</div>
<?php else : ?>
<div class="input-group" style="left: 50px;">
<input type="text" class="form-control" name="gen_sconf_<?= $configKey ?>[<?= $key ?>]" id="gen_<?= $key ?>" value="<?= $value ?>">
<span class="input-group-addon"><i class="fa fa-cogs fa-lg" style="width: 20px;" title="<?= $this->translate('tr_melis_cms_sites_tool_default_value') ?>"></i></span>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
<?php endforeach; ?>
<?php endif; ?>
<?php endforeach; ?>
<?php else : ?>
<div class="alert alert-warning" role="alert">
<?= $this->translate('tr_melis_cms_sites_tool_general_no_data'); ?>
</div>
<?php endif; ?>
<!-- ADDITIONAL INPUTS END -->
<?php
echo $this->form()->closeTag();
?>
</div>
</div>
<!-- GENERAL TAB END -->
<!-- OTHER LANGUAGES START -->
<?php foreach ($this->activeSiteLangs as $lang) : ?>
<div id="<?= $lang['lang_cms_locale']; ?>-config-<?= $this->siteId; ?>" class="tab-pane product-text-tab-content">
<div class="bg-white">
<h4 class=""><i class="fa fa-map-marker"></i> <?= $lang['lang_cms_name']; ?></h4>
</div>
<div id="cms_domain_<?= $lang['slang_lang_id']; ?>">
<?php
$form = clone $this->configForm;
$form->setAttribute('id', $lang['slang_lang_id'] . '_' . $form->getAttribute('id'));
foreach ($form->getElements() as $element => $attributes) {
$el = $form->get((string) $element);
if ($el->getName() == 'sconf_id') {
if (array_key_exists($lang['slang_lang_id'], $this->dbConfIds)) {
$el->setValue($this->dbConfIds[$lang['slang_lang_id']]);
}
}
$el->setName($lang['slang_lang_id']."_".$el->getName());
$el->setAttribute('id', $el->getName());
}
echo $this->form()->openTag($form);
echo $this->melisFieldCollection($form);
?>
<!-- ADDITIONAL INPUTS START -->
<?php if (!empty($this->config['site'][$this->siteName][$this->siteId][$lang['lang_cms_locale']])) : ?>
<?php foreach ($this->config['site'][$this->siteName][$this->siteId][$lang['lang_cms_locale']] as $configKey => $config) : ?>
<?php if (!is_array($config)) : ?>
<?php if (!empty($this->valuesFromDb[$lang['lang_cms_locale']][$configKey])) : ?>
<label><?= $configKey ?></label>
<div class="input-group ">
<input type="text" class="form-control col-md-10" name="<?= $lang['slang_lang_id'] ?>_sconf_<?= $configKey ?>" id="<?= $lang['slang_lang_id'] ?>_sconf_<?= $configKey ?>" value="<?= $config ?>">
<span class="input-group-addon"><i class="fa fa-database fa-lg" style="width: 20px;" title="<?= $this->translate('tr_melis_cms_sites_tool_database_value') ?>"></i></span>
</div>
<br>
<?php else : ?>
<label><?= $configKey ?></label>
<div class="input-group ">
<input type="text" class="form-control col-md-10" name="<?= $lang['slang_lang_id'] ?>_sconf_<?= $configKey ?>" id="<?= $lang['slang_lang_id'] ?>_sconf_<?= $configKey ?>" value="<?= $config ?>">
<span class="input-group-addon"><i class="fa fa-cogs fa-lg" style="width: 20px;" title="<?= $this->translate('tr_melis_cms_sites_tool_default_value') ?>"></i></span>
</div>
<br>
<?php endif; ?>
<?php else : ?>
<label><?= $configKey ?> (array)</label>
<br>
<?php foreach ($config as $key => $value) : ?>
<?php if (!is_array($value)) : ?>
<div>
<?php if (!is_int($key)) : ?>
<label style="margin-left: 50px;"><?= $key ?></label>
<?php endif; ?>
<?php if (isset($this->valuesFromDb[$lang['lang_cms_locale']][$configKey][$key])) : ?>
<div class="input-group" style="left: 50px;">
<input type="text" class="form-control" name="<?= $lang['slang_lang_id'] ?>_sconf_<?= $configKey ?>[<?= $key ?>]" id="gen_<?= $key ?>" value="<?= $value ?>">
<span class="input-group-addon"><i class="fa fa-database fa-lg" style="width: 20px;" title="<?= $this->translate('tr_melis_cms_sites_tool_database_value') ?>"></i></span>
</div>
<?php else : ?>
<div class="input-group" style="left: 50px;">
<input type="text" class="form-control" name="<?= $lang['slang_lang_id'] ?>_sconf_<?= $configKey ?>[<?= $key ?>]" id="gen_<?= $key ?>" value="<?= $value ?>">
<span class="input-group-addon"><i class="fa fa-cogs fa-lg" style="width: 20px;" title="<?= $this->translate('tr_melis_cms_sites_tool_default_value') ?>"></i></span>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
<?php endforeach; ?>
<?php endif; ?>
<?php endforeach; ?>
<?php else : ?>
<div class="alert alert-warning" role="alert">
<?= $this->translate('tr_melis_cms_sites_tool_lang_no_data'); ?>
</div>
<?php endif; ?>
<!-- ADDITIONAL INPUTS END -->
<?php
echo $this->form()->closeTag();
?>
</div>
</div>
<?php endforeach; ?>
<!-- OTHER LANGUAGES END -->
</div>
</div>
</div>
</div>
</div>
<?php } ?>
|