<?php
/**
 * @author Lukas Havlicek
 * @version 1.0
 */

$this->headTitle($this->projectName);
$this->placeholder('title')->set($this->t('nastaveni-f'));
?>

<h1 class="page_title"><?=$this->t('nastaveni-f')?></h1>
        <h1 class="group_title"><?=$this->t('nastaveni-f')?></h1>
            <div class="main_inner2">
    			<div class="main_inner">
    			
    				 <div class="left_column">
    	                <div class="left_column_item">
    	                    <?=$this->action('left-menu', 'layout', 'admin', array('leftmenu' => $this->leftmenu)); ?>
    	                </div>
    	            </div>
    	            
    				<div class="main_text_right">
                        <h2 class="section_heading"><?=$this->t('nastaveni-f')?></h2>
                        
                        <?php if ($this->msg) : ?>
                        	<div class="ok_box">
								<?=$this->t('zmeny-byly-ulozeny-AF')?>!                        	
                        	</div>
                        <?php endif; ?>
                        
                        <?php if ($this->data->count()) : ?>
                        <form action="<?=$this->baseUrl()?>/admin/settings" method="post">
                        	
                         	<?php foreach ($this->data as $i) : ?>
                         		<?php 
                         			$inputFirst = false;
                         			if ($i->input_type == 'checkbox') $inputFirst = true;
                         		
                         			if ($i->value_int != null) $value = 'value_int';
                         			elseif ($i->value_decimal != null) $value = 'value_decimal';
                         			else $value = 'value_string';
                         		?>
                         		<?php if (!$inputFirst) : ?>      	
                         		<label for="<?=$i->key?>"><?=$this->t($i->key)?>:</label>
                         		<?php endif; ?>
                         			<input class="<?=($i->input_type == 'checkbox') ? 'checkbox' : 'short'?>"
                         				   type="<?=$i->input_type?>" 
                         				   name="<?=$i->key?>" 
                         				   value="<?=$i->$value?>" 
                         				   <?php if ($i->input_type == 'checkbox' && $i->$value) echo 'checked="checked"';?> />
                         		<?php if ($inputFirst) : ?>      	
                         			<label for="<?=$i->key?>"><?=$this->t($i->key)?>:</label>
                         		<?php endif; ?>
                         		 
                         	<?php endforeach; ?>
							<br />
                         	<div class="submit_line">
		                  		<button class="inline_button"><?=$this->t('ulozit-f')?></button>
							</div>	    
                        </form>
                        <?php endif; ?>
                    </div>
    			</div>
			</div>