<h1>Dodaj produkt</h1>	
<script language="javascript" type="text/javascript">
urlStatic = '{$urlStatic}';
</script>

<form method="post" action="{url Product='AddLang' idProduct=$idProduct idElement=$idStructure}" enctype="multipart/form-data">
	{if isset($objProduct)}
		<input type="hidden" name="idProduct" value="{$objProduct->GetId()}" />
	{/if}

	<div class="panelRightTop"></div>
	<div class="panelRightBody">
		<div class="paddedContent">
			{assign var="additionalTitle" value=""}

			{dropDownContainer title="Ogólne" additionalTitle=$additionalTitle}
				<table width="100%" cellspacing="0" cellpadding="5" border="0" class="commonTable">
					<tbody>
					<tr>
							<td>Wprowadź dane elementu innej wersji językowej</td>
							<td>							
							<a href="#" ></a>
							<div>
								<select id="productLangId">
									<option value="">
																		
									</option>
									{foreach from=$arrayProduct key=idProductLang item=produktLang}
									<option value="{$idProductLang}" {if $objProduct->GetId() == $idProductLang}selected{/if}>
										{$produktLang}											
									</option>
									{/foreach}
								</select>
								<input type="button" value="uzupełnij" onclick="LoadProductLang('productLangId', '{url Product=AddLang idProduct=#i#d# idElement=$idStructure}');">
							</div>
							</td>
						</tr>
						<tr>
							<td>Nazwa:</td>
							<td>							
							{formField name='name' class='inputWidth141 input100percent' errorClass='validate' type='text' obj='objProduct' func='getName'}
							{if isset($error.name)}<div style="color: red;" id="actionError" class="validate">{$error.name}</div>{/if}
							</td>
						</tr>
						<tr>
							<td>Publikuj:</td>
							<td>{formField type='checkbox' name='publication' obj='objProduct' func='GetPublication'}</td>
						</tr>
						<tr>
					    <td class="noborder"><b>Data publikacji:</b></td>
					    <td class="noborder">
						<img src='{$urlStatic}/image/iconKalendarz.gif' alt='kalendarz' onclick="showKal(document.getElementById('datepub'));" />&nbsp;{formField type='input' name='datepublication'  errorClass='validate' obj='objProduct' func='GetDatePublicationWithoutTime' id='datepub'}
						{if isset($error.datepublication)}<div style="color: red;" id="actionError" class="validate">{$error.datepublication}</div>{/if}
						 </td>
					</tr>
					<tr>
					    <td><b>Godzina:</b></td>
					    <td>
						    {formField type='input' maxlength='2' errorClass='validate' name='timepublication' obj='objProduct' func='GetDatePublicationTime'}
						    <span class="grayText smallText">format (HH)</span>
						    
					    </td>
					</tr>
					{*<tr>
							<td>Kolejność:</td>
							<td>
							
							{formField name='tytul' class='inputWidth141 input100percent' errorClass='validate' type='text' obj='objProduct' func='GetTitle'}
							{if isset($error.tytul)}<div style="color: red;" id="actionError"  class="validate">{$error.tytul}</div>{/if}
							</td>
						</tr>*}
					</tbody>
				</table>
			{/dropDownContainer}
			{dropDownContainer title="Zdjecie"}
			<div class="floatLeft" style="margin-left: 10px;">
					{if $objProduct->GetPictureMini()}<img src="{$objProduct->GetPictureMiniUrl()}" />{/if}
				</div>
				<div class="cb"></div>
				<div class="articlePreviewRight">
					<input type="file" name="filename" />
				</div>
				<div class="cb"></div>
				<div class="articlePreviewRight">
					<input type="checkbox" name="deletePhoto" > Usuń obrazek
				</div>				
				<div class="cb"></div>
			{/dropDownContainer}
			
			{dropDownContainer title="Zajawka" isHidden=true}
				<div class="articlePreviewRight">
					{if isset($objProduct)}
						{assign var='zajawka' value=$objProduct->GetShortnote()}
					{else}
						{assign var='zajawka' value=''}
					{/if}
					{insertFckEditor width='620' height='159' name='zajawka' toolbar='Basic' value=$zajawka}
					<div class="validate" id="shortnoteHiddenError"></div>
					{if isset($error.zajawka)}<div style="color: red;" id="actionError"  class="validate">{$error.zajawka}</div>{/if}
				</div>
				<div class="clearBoth"></div>
			{/dropDownContainer}
			
			{dropDownContainer title="Treść}

				<div class="center">
					{if isset($objProduct)}
						{assign var='tresc' value=$objProduct->GetDescription()}
					{else}
						{assign var='tresc' value=''}
					{/if}
					{insertFckEditor width='620' height='380' name='tresc' toolbar='Formix' value=$tresc}
				</div>

			{/dropDownContainer}
					
			{dropDownContainer title="Parametry}

				<table cellspacing="0" cellpadding="0" border="0">
							<tr class="selAllRow">
								{*<td class="cornerTop"></td><td colspan="6"><a href="#">Zaznacz wszystkie</a> <a href="#">usuń</a>
								</td>*}
							</tr>
							<tr>
							{*<td class="selAll">&nbsp;</td> *}
							<th><div style="float:left; width:100%">Lp.{*<div class="sort"><a class="ascendingAct" href="#">&nbsp;</a><a class="descending" href="#">&nbsp;</a></div>*}</div></th>
							<th>Parametr{*<div class="sort"><a class="ascendingAct" href="#">&nbsp;</a><a class="descending" href="#">&nbsp;</a></div>*}</th>
							<th>Wartość{*<div class="sort"><a class="ascendingAct" href="#">&nbsp;</a><a class="descending" href="#">&nbsp;</a></div></th>*}
							{*<th class="noSort">Publikuj<div class="sort"><a class="ascendingAct" href="#">&nbsp;</a><a class="descending" href="#">&nbsp;</a></div>*}</th>							
							{*<th class="noSort"><a href="#" class="add">Dodaj</a> <div class="sort"><a class="ascendingAct" href="#">&nbsp;</a><a class="descending" href="#">&nbsp;</a></div></th>*}
						</tr>
						{assign var=x value=0}
						{foreach from=$arrayObjAttribute item=objAttribute}
						{assign var=x value=$x+1}
						<tr>
							{*<td class="selAll"><input name="Checkbox1" type="checkbox" /></td> *}
							<td>{$x}</td>
							<td><a href="#">{$objAttribute->GetDescription()}</a></td>
							<td><input type="text" value="{$objAttribute->GetValue()}" name="attr_value[{$objAttribute->GetId()}]" class="input" /></td>
							{*<td style="width:15px">
									<input name="Checkbox2" type="checkbox" checked="checked" />
								</td>
								<td style="width:15px">
								<a href="#" class="edit">edytuj</a><a href="#" class="delete">usuń</a>
							</td>*}
						</tr>
						{/foreach}
						<tr class="selAllRow">
								{*<td class="cornerBottom"></td><td colspan="6"><a href="#">Zaznacz wszystkie</a><a href="#">usuń</a>
								
								<div class="pager"><div class="perpage">wyświetl:<br/><select id="perpage" class="tiny " name="#"><option>10</option><option>25</option><option>50</option><option>100</option></select></div><a href="#" class="prvnext">&laquo; poprzednia</a><a href="#">1</a><a class="active" href="#">2</a><a href="#">3</a>...<a href="#">50</a><a href="#">51</a><a href="#">52</a>...<a href="#">100</a><a class="prvnext" href="#">następna &raquo;</a></div></td> *}
						</tr>

						</table>
			{/dropDownContainer}
			{dropDownContainer title="Dodaj zdjecia"}
			<iframe name="PhotoUpload" id="PhotoUpload" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" height="70" width="625"	src="{url Image='Form'}">
			<noscript>
			Do wyświetlenia konieczne jest działanie ramek (iframe).
			</noscript>
			</iframe>
			{/dropDownContainer}
			{dropDownContainer title="Zdjecia"}
			<div >
			{foreach from=$arrayImage item=image name=photo key=key}
			<div id="image_{$image->GetId()}" style="float:left; text-align: center; border:1px solid #000000; margin-right:5px; margin-bottom: 5px"><img src="{$image->GetFullUrlMiniId($objProduct->GetId(), 'Product')}" alt="test" />
			<div>
				<a href="#" onclick="DeletePhoto('{url Image=DeleteImage}', '{$image->GetId()}'); return false;"><img src="{$urlStatic}/image/Admin/iconDelete.gif" alt="Usuń" title="Usuń" border="0"/></a>
			</div>
			</div> {/foreach}
			</div>
			<div class="clearBoth"></div>
			<div name="PhotoDisplay" id="PhotoDisplay" class="PhotoDisplay">
			{if isset($arrayPhoto)}
			{foreach from=$arrayPhoto item=file name=photo key=key}<div style="float:left; text-align: center; border:1px solid #000000; margin-right:5px; margin-bottom: 5px"><img src="{$urlStatic}/temp/{$file.th}" alt="test"/></div> {/foreach}
			{/if}
			</div>
			<div class="cb"></div>
			{/dropDownContainer}
		
		</div>
		</div>
	<div class="cb"></div>
		<div class="panelButtons">
		{if isset($idStructure)}
			<input type="button" value="Anuluj" class="cancel" onclick="document.location.href='{url label=editStructure id=$idStructure}'" />
			{else}
			<input type="button" value="Anuluj" class="cancel" onclick="document.location.href='{url _value=$controller,index}'"/>
			{/if}
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<input type="submit" value="Zapisz" name="doProductAdd"/>
		</div>
	<input type="hidden" name="descriptionHidden" id="descriptionHidden" value="" />
<input type="hidden" name="shortnoteHidden" id="shortnoteHidden" value="" />
</form>
