
<?php
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper;
//for_use

/**
 * @extension       Marlev Template
 * @author          Lev Milicenco<support@marlev.it>
 * @link            http://www.marlev.it
 * @copyright       Copyright 2013 marlev.it All Rights Reserved
 * @license         http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
 */
defined('_JEXEC') or die;
$getlang = Factory::getApplication()->getLanguage();
//$langtag = explode("-", $getlang->getTag());
//$curlang = "title_" . $langtag[0];
?>
<div class="tm-cookie tm-config"  >
      <h3><?php echo Text::_("Cookie Alert");?></h3>
            <div class="slide-config-title"  >
                <?php echo Text::_("COM_TMARLEV_COOKIE_ALERT_LABEL") ?>
            </div>
       

        <?php echo $this->form->renderField("cookie_enable"); ?>
        <?php echo $this->form->renderField("cookie_position"); ?>
        <?php echo $this->form->renderField("cookie_style"); ?>
      
        <div class="control-group">
            <div class="control-label">
                <?php echo $this->form->getLabel('cookie_deflang'); ?>
            </div>
            <div class="controls">

                <select id="params_cookie_deflang"  name="params[cookie_deflang]" >
                    <?php
                    if (!isset($this->lang_params->params["cookie_deflang"]))
                        $n = 1;
                    else
                        $n = 2;

                    foreach ($this->lang_params->langs as $lang):
                        ?>
                        <option <?php if ((isset($this->lang_params->params["cookie_deflang"]) && $this->lang_params->params["cookie_deflang"] == $lang->lang_code) || $n == 1) echo 'selected="selected"'; ?> value="<?php echo $lang->lang_code; ?>"><?php echo $lang->title; ?></option>
                        <?php $n++;
                    endforeach;
                    ?>


                </select>

            </div>
            

        </div>
   
    <div class="tabs-config">
<?php echo HtmlHelper::_('uitab.startTabSet', 'myTab', array('active' => 'cookies-'.$getlang->getTag()));?>
    
    <?php foreach ($this->lang_params->langs as $key): 
                    echo HtmlHelper::_('uitab.addTab', 'myTab', 'cookies-'.$key->lang_code,  $key->title);
        $cookie_title = "";
        $cookie_desc = "";
        $cookie_accept = "";
        $cookie_more = "";
        $cookie_link = "";
        if (isset($this->lang_params->params["cookie_title_" . $key->lang_code]))
            $cookie_title = $this->lang_params->params["cookie_title_" . $key->lang_code];

        if (isset($this->lang_params->params["cookie_desc_" . $key->lang_code]))
            $cookie_desc = $this->lang_params->params["cookie_desc_" . $key->lang_code];

        if (isset($this->lang_params->params["cookie_accept_" . $key->lang_code]))
            $cookie_accept = $this->lang_params->params["cookie_accept_" . $key->lang_code];

        if (isset($this->lang_params->params["cookie_more_" . $key->lang_code]))
            $cookie_more = $this->lang_params->params["cookie_more_" . $key->lang_code];

        if (isset($this->lang_params->params["cookie_link_" . $key->lang_code]))
            $cookie_link = $this->lang_params->params["cookie_link_" . $key->lang_code];
        ?>
       
           
               <div class="slide-config-title"  >
                    <strong><?php echo Text::_("COM_TMARLEV_CONFIGURAZIONE_PER") . " " . $key->title; ?></strong>
              
                    </div>

            
                <div class="control-group">
                    <div class="control-label">
    <?php echo Text::_("TPL_MARLEV_TITLE") ?>
                    </div>
                    <div class="controls" style="min-width: 50%;" >
                        <input class="cookie_alert_title"  type="text" style="min-width: 50%;" value="<?php echo $cookie_title; ?>" name="params[cookie_title_<?php echo $key->lang_code ?>]">
                    </div>
                </div>

                <div class="control-group1" style="height: auto;" >
                    <div class="control-label">
    <?php echo Text::_("TPL_MARLEV_DESCRIPTION") ?><br/>
                         <span style="font-size: 12px;"><?php echo Text::_("TPL_MARLEV_COOKIE_DESK_BREAK_NEWLINE") ?></span>
                    </div>
                    <div class="controls" style="width: 48%;">
                     
                            <textarea class="cookie_alert_message" style="min-width: 50%;"   name="params[cookie_desc_<?php echo $key->lang_code ?>]"><?php echo $cookie_desc; ?></textarea>
                           
                       

                    </div>
                 
<div class="clearfix"></div>
                </div><div class="clearfix"></div>
                <div class="control-group">
                    <div class="control-label">
    <?php echo Text::_("TPL_MARLEV_TESTO_ACCETTO") ?>
                    </div>
                    <div class="controls">
                        <input class="cookie_alert_title" type="text" value="<?php echo $cookie_accept; ?>" name="params[cookie_accept_<?php echo $key->lang_code ?>]">
                    </div>
                </div>

                <div class="control-group">
                    <div class="control-label">
    <?php echo Text::_("TPL_MARLEV_TESTO_READMORE") ?>
                    </div>
                    <div class="controls">
                        <input class="cookie_alert_title" type="text" value="<?php echo $cookie_more; ?>" name="params[cookie_more_<?php echo $key->lang_code ?>]">
                    </div>
                </div>

                <div class="control-group">
                    <div class="control-label">
    <?php echo Text::_("TPL_MARLEV_LINK_COOKIE") ?>
                    </div>
                    <div class="controls" style="min-width: 50%;">
                        <input class="cookie_alert_title" type="text"  placeholder="http://miosito.it/cookie-policy" value="<?php echo $cookie_link; ?>" name="params[cookie_link_<?php echo $key->lang_code ?>]">
                    </div>
                    <div class="clearfix"></div>
                </div>
           
      



<?php echo HtmlHelper::_('uitab.endTab');?>
<?php endforeach; ?>
<?php  echo HtmlHelper::_('uitab.endTabSet');?>
         
        </div>
  <div class="clearfix"></div>
</div>

