


		{if $setting->get_setv_setting()->get_set_setting_type_st_id() == 1}
			<div class="full_width">
				<form method="post">
					<input type="hidden" name="action" value="settings_data_edit">
					<input type="hidden" name="set_id" value="{$setting->get_setv_setting_set_id()}">
					<input type="hidden" name="setv_id" value="{$setting->get_setv_id()}">
					<input type="hidden" name="st_name" value="{$setting->get_setv_setting()->get_set_setting_type()->get_st_setting_data_type()}">
					<div>
						<div class="full_width">
								<textarea name="set_val" id="set_val">{$setting->get_setv_text()}</textarea>
						</div>
					</div>


					<div>
						<div class="right">
					  		<input class="button black" type="submit" value="Mentés">
					    </div>
					</div>
				</form>
			</div>

			 <script>
			    CKEDITOR.replace( 'set_val' );
			</script>

		{elseif $setting->get_setv_setting()->get_set_setting_type_st_id() == 2}

			<div class="buttons">

				<a href="/admin/create/backup" class="addbutton add-big">Új biztonsági mentés</a>

			</div>
			<div class="list">

			{foreach $backups as $backup}
				{if
				$backup@first ||
				(
				$backups[$backup@index]->get_bu_date()|substr:5:2 != $backups[$backup@index-1]->get_bu_date()|substr:5:2
				)

				}
				{if !$backup@first &&
				$backups[$backup@index]->get_bu_date()|substr:5:2 != $backups[$backup@index-1]->get_bu_date()|substr:5:2
				}
				</div>
				{/if}
				<span onclick="block_action('block_{$backup->get_bu_date()|substr:0:4}{$backup->get_bu_date()|substr:5:2}');" class="date_separator clickable">{$backups[$backup@index]->get_bu_date()|substr:0:4}.
					{$months[$backups[$backup@index]->get_bu_date()|substr:5:2]}
					<img src="/_image/open_folder.png">
				</span>
				<div id="block_{$backup->get_bu_date()|substr:0:4}{$backup->get_bu_date()|substr:5:2}" class="month_block">
				{/if}
				<div class="list_item clickable" id="kid_{$backup->get_bu_id()}" onclick="open_kid_menu({$backup->get_bu_id()})">
					<img src="/_image/backup.png">
					<span class="bold">{$backup->get_bu_date()|date_format:"%Y.%m.%d %H:%M"}</span> #{$backup->get_bu_id()}
				</div>
				<div class="kid_menu" id="kid_menu_{$backup->get_bu_id()}">
					<div class="kid_submenu" onclick="download_backup('{$backup->get_bu_name()}')">
				  		<span>Letöltés</span>
				  		<img src="/_image/download.png">
			  		</div>
			  		<div class="kid_submenu" onclick="delete_backup('{$backup->get_bu_id()}')">
				  		<span>Törlés</span>
				  		<img src="/_image/delete.png">
			  		</div>
				</div>
				{if $backup@last}
				</div>
				{/if}
			{/foreach}
			</div>

		{elseif $setting->get_setv_setting()->get_set_setting_type_st_id() == 4}
			<div class="full_width">
				<form method="post">
					<input type="hidden" name="action" value="settings_data_edit">
					<input type="hidden" name="set_id" value="{$setting->get_setv_setting_set_id()}">
					<input type="hidden" name="setv_id" value="{$setting->get_setv_id()}">
					<input type="hidden" name="st_name" value="{$setting->get_setv_setting()->get_set_setting_type()->get_st_setting_data_type()}">
					<div>
						<div class="full_width">
							<label class="desc" for="uk_birth_year">{$setting->get_setv_setting()->get_set_name()}:</label>
							<input name="set_val" id="set_val" value="{$setting->get_setv_int()}">
						</div>
					</div>


					<div>
						<div class="right">
					  		<input class="button black" type="submit" value="Mentés">
					    </div>
					</div>
				</form>
			</div>
		{/if}





<script>

function open_block(block_id) {
	$("#"+block_id).slideDown("slow");
}

function close_block(block_id) {
	$("#"+block_id).slideUp("slow");
}

function block_action(block_id) {
	if ($("#"+block_id).is(':hidden')) {
		open_block(block_id);
	}
	else {
		close_block(block_id);
	}
}

function download_backup(bu_name) {
	window.open("/backup/"+bu_name+".sql", '_blank');
}

function delete_backup(bu_id) {
	location.href = "/admin/delete_backup/"+bu_id;
}


$( document ).ready(function() {
    var divs = $( "div[class=month_block]" );
	$( ".list" ).find( divs ).hide();
	var div_list = $( ".list" ).find( divs );

	if (div_list[0] !== undefined) {
		open_block(div_list[0].id);
	}

});


function open_kid_menu(uk_id) {
	$("#kid_menu_"+uk_id).slideToggle();
	if (!$("#kid_"+uk_id).hasClass('active_kid')) {
		$("#kid_"+uk_id).addClass('active_kid');
		$("#kid_"+uk_id).removeClass('list_item');
	}
	else {
		$("#kid_"+uk_id).removeClass('active_kid');
		$("#kid_"+uk_id).addClass('list_item');
	}

}


</script>
