<script language="javascript" src="js/jupload.js" type="text/javascript"></script>
<script type="text/javascript"> 
<!-- //
{literal}
function ajaxFileUpload(updir,divid,ending)
{
	$("#loading_" + divid)
	.ajaxStart(function(){
		$(this).show();
		document.getElementById('buttonUpload_' + divid).value = '{/literal}{#Global_Wait#}{literal}';
		document.getElementById('buttonUpload_' + divid).disabled = true;
		
	})
	.ajaxComplete(function(){
		$(this).hide();
		document.getElementById('buttonUpload_' + divid).value = '{/literal}{#Global_Upload#}{literal}';
		document.getElementById('buttonUpload_' + divid).disabled = false;
	});

	$.ajaxFileUpload
	(
		{
			url:'index.php?do=shop&sub=esd_upload&updir=' + updir + '&divid=' + divid + '&ending=' + ending,
			secureuri:false,
			fileElementId:'fileToUpload_' + divid,
			dataType: 'json',
			success: function (data, status)
			{
				if(typeof(data.error) != 'undefined')
				{
					if(data.error != '')
					{
						document.getElementById('UpInf_' + divid).innerHTML  = data.error;
					}else
					{
						document.getElementById('UpInf_' + divid).innerHTML = data.msg;
						document.getElementById('newFile_' + divid).value =  data.html;
						
					}
				}
			},
			error: function (data, status, e)
			{
				document.getElementById('UpInf_' + divid).innerHTML = e;
			}
		}
	)
	
	return false;
}
// -->
</script>
{/literal}
<div class="popbox">
<div class="header">{#Shop_downloads_title#}</div>
<div class="headers"><small>{#Shop_downloads_titleInf#}</small></div>
<form method="post" action="">

<input type="hidden" name="id" value="{$smarty.request.id}" />
<input type="hidden" name="subaction" value="save" />
<table width="100%" border="0" cellpadding="3" cellspacing="0" class="tableborder">

  <tr>
    <td class="headers" align="center"><img src="{$tpl_dir}/images/delete.png" alt="" /></td>
    <td width="150" class="headers">{#Shop_downloads_hdl#}</td>
    <td width="110" class="headers">{#Shop_downloads_hdlt#}</td>
    <td class="headers">{#Shop_downloads_hdln#}</td>
    <td class="headers">{#Shop_downloads_hdld#}</td>
    <td class="headers">{#Shop_downloads_hdlp#}</td>
  </tr>

<tr>
<td colspan="6" class="subheaders"><strong>{#Shop_downloads_full#}</strong></td>
</tr>

{foreach from=$downloads_full item=dl}
<tr class="{cycle name='esd' values='first,second'}">
<td width="1%" align="center"><input {popup sticky=$config_vars.POPSTICKY  sticky=false text=$config_vars.Delete}  type="checkbox" name="Del[{$dl->Id}]" value="1"></td>
<td width="130">
<select class="input" style="width:210px" name="Datei[{$dl->Id}]">
{foreach from=$esds item=dlf}
<option value="{$dlf}" {if $dl->Datei==$dlf}selected="selected"{/if}>{$dlf}</option>
{/foreach}
</select></td>
<td width="110">
<select class="input" style="width:110px" name="DateiTyp[{$dl->Id}]">
<option value="full" {if $dl->DateiTyp=='full'}selected="selected"{/if}>{#Shop_downloads_full#}</option>
<option value="update" {if $dl->DateiTyp=='update'}selected="selected"{/if}>{#Shop_downloads_update#}</option>
<option value="bugfix" {if $dl->DateiTyp=='bugfix'}selected="selected"{/if}>{#Shop_downloads_bugfix#}</option>
<option value="other" {if $dl->DateiTyp=='other'}selected="selected"{/if}>{#Shop_downloads_other#}</option>
</select></td>
<td>
<input class="input" style="width:210px" name="Titel[{$dl->Id}]" type="text" value="{$dl->Titel|koobispecialchars}"></td>
<td>
<textarea class="input"  wrap="xoff"  title="{#Shop_downloads_otherDlTimeClick#}" style="width:280px;height:50px" onclick="this.style.height='200px'" onmouseout="this.style.height='50px'" name="Beschreibung[{$dl->Id}]">{$dl->Beschreibung|koobispecialchars}</textarea></td>
<td>
<input class="input"  name="Position[{$dl->Id}]" type="text" size="2" maxlength="3" value="{$dl->Position}"></td>
</tr>
{/foreach}


<tr>
<td colspan="6" class="subheaders"><strong>{#Shop_downloads_update#}</strong></td>
</tr>

{foreach from=$downloads_updates item=dl}
<tr class="{cycle name='esd' values='first,second'}">
<td width="1%" align="center"><input {popup sticky=$config_vars.POPSTICKY  sticky=false text=$config_vars.Delete} type="checkbox" name="Del[{$dl->Id}]" value="1"></td>
<td width="130">
<select class="input" style="width:210px" name="Datei[{$dl->Id}]">
{foreach from=$esds item=dlf}
<option value="{$dlf}" {if $dl->Datei==$dlf}selected="selected"{/if}>{$dlf}</option>
{/foreach}
</select></td>
<td width="110">

<select class="input" style="width:110px" name="DateiTyp[{$dl->Id}]">
<option value="full" {if $dl->DateiTyp=='full'}selected="selected"{/if}>{#Shop_downloads_full#}</option>
<option value="update" {if $dl->DateiTyp=='update'}selected="selected"{/if}>{#Shop_downloads_update#}</option>
<option value="bugfix" {if $dl->DateiTyp=='bugfix'}selected="selected"{/if}>{#Shop_downloads_bugfix#}</option>
<option value="other" {if $dl->DateiTyp=='other'}selected="selected"{/if}>{#Shop_downloads_other#}</option>
</select></td>
<td>
<input class="input" style="width:210px" name="Titel[{$dl->Id}]" type="text" value="{$dl->Titel|koobispecialchars}"></td>
<td>
<textarea class="input" wrap="xoff" title="{#Shop_downloads_otherDlTimeClick#}" style="width:280px;height:50px" onclick="this.style.height='200px'" onmouseout="this.style.height='50px'" name="Beschreibung[{$dl->Id}]">{$dl->Beschreibung|koobispecialchars}</textarea></td>
<td>
<input class="input" name="Position[{$dl->Id}]" type="text" size="2" maxlength="3" value="{$dl->Position}"></td>
</tr>
{/foreach}


<tr>
<td colspan="6" class="subheaders"><strong>{#Shop_downloads_bugfix#}</strong></td>
</tr>
{foreach from=$downloads_bugfixes item=dl}
<tr class="{cycle name='esd' values='first,second'}">
<td width="1%" align="center"><input {popup sticky=$config_vars.POPSTICKY  sticky=false text=$config_vars.Delete}  type="checkbox" name="Del[{$dl->Id}]" value="1"></td>
<td width="130">
<select class="input" style="width:210px" name="Datei[{$dl->Id}]">
{foreach from=$esds item=dlf}
<option value="{$dlf}" {if $dl->Datei==$dlf}selected="selected"{/if}>{$dlf}</option>
{/foreach}
</select></td>
<td width="110">
<select class="input"  style="width:110px" name="DateiTyp[{$dl->Id}]">
<option value="full" {if $dl->DateiTyp=='full'}selected="selected"{/if}>{#Shop_downloads_full#}</option>
<option value="update" {if $dl->DateiTyp=='update'}selected="selected"{/if}>{#Shop_downloads_update#}</option>
<option value="bugfix" {if $dl->DateiTyp=='bugfix'}selected="selected"{/if}>{#Shop_downloads_bugfix#}</option>
<option value="other" {if $dl->DateiTyp=='other'}selected="selected"{/if}>{#Shop_downloads_other#}</option>
</select></td>
<td>
<input class="input" style="width:210px" name="Titel[{$dl->Id}]" type="text" value="{$dl->Titel|koobispecialchars}"></td>
<td>
<textarea class="input" wrap="xoff" title="{#Shop_downloads_otherDlTimeClick#}" style="width:280px;height:50px" onclick="this.style.height='200px'" onmouseout="this.style.height='50px'" name="Beschreibung[{$dl->Id}]">{$dl->Beschreibung|koobispecialchars}</textarea></td>
<td>
<input class="input" name="Position[{$dl->Id}]" type="text" size="2" maxlength="3" value="{$dl->Position}"></td>
</tr>
{/foreach}


<tr>
<td colspan="6" class="subheaders"><strong>{#Shop_downloads_other#}</strong></td>
</tr>
{foreach from=$downloads_other item=dl}
<tr class="{cycle name='esd' values='first,second'}">
<td width="1%" align="center"><input {popup sticky=$config_vars.POPSTICKY  sticky=false text=$config_vars.Delete}  type="checkbox" name="Del[{$dl->Id}]" value="1"></td>
<td width="130">
<select class="input" style="width:210px" name="Datei[{$dl->Id}]">
{foreach from=$esds item=dlf}
<option value="{$dlf}" {if $dl->Datei==$dlf}selected="selected"{/if}>{$dlf}</option>
{/foreach}
</select></td>
<td width="110">
<select class="input" style="width:110px" name="DateiTyp[{$dl->Id}]">
<option value="full" {if $dl->DateiTyp=='full'}selected="selected"{/if}>{#Shop_downloads_full#}</option>
<option value="update" {if $dl->DateiTyp=='update'}selected="selected"{/if}>{#Shop_downloads_update#}</option>
<option value="bugfix" {if $dl->DateiTyp=='bugfix'}selected="selected"{/if}>{#Shop_downloads_bugfix#}</option>
<option value="other" {if $dl->DateiTyp=='other'}selected="selected"{/if}>{#Shop_downloads_other#}</option>
</select></td>
<td>
<input class="input" style="width:210px" name="Titel[{$dl->Id}]" type="text" value="{$dl->Titel|koobispecialchars}"></td>
<td>
<textarea class="input" wrap="xoff" title="{#Shop_downloads_otherDlTimeClick#}" style="width:280px;height:50px" onclick="this.style.height='200px'" onmouseout="this.style.height='50px'" name="Beschreibung[{$dl->Id}]">{$dl->Beschreibung|koobispecialchars}</textarea></td>
<td>
<input name="Position[{$dl->Id}]" type="text" size="2" maxlength="3" value="{$dl->Position}"></td>
</tr>
{/foreach}
</table>
<br />
<input type="submit" class="button" value="{#Save#}">
</form>
<br />
<br />
<div class="header">{#Shop_downloads_newfile#}</div>
<form method="post" action="">
<input type="hidden" name="id" value="{$smarty.request.id}" />
<input type="hidden" name="subaction" value="new" />
<table width="100%" border="0" cellpadding="3" cellspacing="0" class="tableborder">

  <tr>
    <td width="150" class="headers">{#Shop_downloads_hdl#}</td>
    <td width="110" class="headers">{#Shop_downloads_hdlt#}</td>
    <td class="headers">{#Shop_downloads_hdln#}</td>
    <td class="headers">{#Shop_downloads_hdld#}</td>
    <td class="headers">{#Shop_downloads_hdlp#}</td>
  </tr>
 <tr class="second">
<td width="130" valign="top" nowrap="nowrap">
<select class="input" style="width:325px" name="Datei">
{foreach from=$esds item=dlf}
<option value="{$dlf}">{$dlf}</option>
{/foreach}
</select>
<br />
<strong>{#Upload_new#}</strong><br />
{if $can_upload==1}
<!-- Uploadform  -->  
	<!-- Status Upload -->  
    <div id="UpInf_1"></div><div id="loading_1" align="center"  style="display:none;"><img style="margin-bottom:15px" src="{$imgpath}/loading.gif" alt="" /></div>
   <!-- Status Upload -->  
   <input id="fileToUpload_1" type="file" size="25" name="fileToUpload_1" class="input" />
   <input type="button" class="button" id="buttonUpload_1" onclick="return ajaxFileUpload('','1','');" value="{#Global_Upload#}" />
   <input type="hidden" name="newFile_1" id="newFile_1" />
<!-- Uploadform -->   
{else}
<small>{#Upload_NotWritable#}</small>
{/if}
</td>
<td width="110" valign="top">
<select class="input" style="width:110px" name="DateiTyp">
<option value="full">{#Shop_downloads_full#}</option>
<option value="update">{#Shop_downloads_update#}</option>
<option value="bugfix">{#Shop_downloads_bugfix#}</option>
<option value="other">{#Shop_downloads_other#}</option>
</select></td>
<td valign="top">
<input class="input" style="width:130px" name="Titel" type="text" value="Name"></td>
<td valign="top">
<textarea class="input" wrap="xoff" title="{#Shop_downloads_otherDlTimeClick#}" style="width:230px;height:50px" onclick="this.style.height='200px'" onmouseout="this.style.height='50px'" name="Beschreibung"></textarea></td>
<td valign="top">
<input class="input" name="Position" type="text" size="2" maxlength="3" value="1"></td>
</tr>
</table>
<input type="submit" class="button big" value="{#Save#}">


</form>

<p>&nbsp;</p>
<hr noshade="noshade" size="1">
<p align="center">
<input type="button" onclick="window.close();" class="button" value="{#Close#}">
</p>
</div>