<div class="page-info">
    <div class="container">
      <div id="breadcrumbs">
       <a href='/' class="first">Home</a>\</div>
      <h1 class="page-title">Upload an Item </h1>
    </div>
  </div>
    <div id="content">
      <div class="container">
    {$errorMessage}
<div class="content-s">
{if !isset($hideForm)}

	  <script type="text/javascript" src="{$data_server}nicEditors/nicEdit.js"></script>
      <script type="text/javascript">
      {literal}bkLib.onDomLoaded(function() { nicEditors.allTextAreas() });{/literal}
      </script>	
	  
	  <form class="horizontal-form item-form disable-on-submit"  id="upload-form" method="post" enctype="multipart/form-data">
    <div class="content-box">
      <h3>Name & Description</h3>
      <div class="input-group">
        <label for="name">{$lang.name}</label>
        <div class="inputs">
          <input type="text" id="name" name="name" value="{$smarty.post.name|escape}" maxlength="50" style="width: 451px;" />
		  <small>Maximum 50 characters. Follow our <a href="/help/upload/" target="_blank">Item Title Naming Conventions</a>.</small>
        </div>
      </div>
      <div class="input-group">
        <label for="description">{$lang.description}</label>
        <div class="inputs">
          <textarea name="description" id="description">{$smarty.post.description}</textarea>
          <small>{$lang.upload_desc_info}</small>
        </div>
      </div>
    </div>
    <div class="content-box">
<h3>
  {$lang.files}
  
   <small class="header-note">Trouble uploading?<a href="/help/upload/" target="_blank"> Follow the upload instructions</a></small>
</h3>

<div id="upload-container">
  <div id="uploads" style="display: none;"></div>
  
<div id="fancy-upload">
					  	<span id="spanButtonPlaceHolder"></span>
							<input id="btnCancel" type="hidden" value="Cancel All Uploads" onclick="swfu.cancelQueue();" disabled="disabled" style="margin-left: 2px; font-size: 8pt; height: 29px;" />	
						  	<br />
						  	<div class="fieldset flash" id="fsUploadProgress">
									<span class="legend" style="display: none;">Queue files</span>
								</div>
								<div id="divStatus" style="display: none;">0 uploaded files</div>
								<br />
								<div id="divFileProgressContainer"></div>
								<div id="thumbnails"></div>
						  
</div>
</div>

<div id="upload_form_user_files_section">
 	<script type="text/javascript">
	//<![CDATA[
	  var initialUserFiles = [];

	  {literal}
		$(".iframe").fancybox({
			'width'				: 400,
			'height'			: 130,
	    'autoScale'     	: false,
	    'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'type'				: 'iframe'
		});
		{/literal}
	  
	//]]>
	</script>
	<div class="input-group">
      <label>{$lang.thumbnail}</label>
    <div class="inputs">
								  	<select class="input big ajaxinput" id="temporary_files_to_assign_thumbnail" name="thumbnail">
								  		<option class="placeholder" value=""></option>
								  		{if $smarty.session.temp.uploaded_files}
								  			{foreach from=$smarty.session.temp.uploaded_files item=s}
								  				<option class="placeholder" value="{$s.filename}" {if $smarty.post.thumbnail == $s.filename}selected="selected"{/if}>{$s.name}</option>
								  			{/foreach}
								  		{/if}
								  	</select>
								  	
	  <small>JPEG or PNG 80x80px Thumbnail</small>
    </div>
  </div>
  <div class="input-group">
      <label>{$lang.main_file}</label>
    <div class="inputs">
								  	<select class="input big ajaxinput" id="temporary_files_to_assign_source" name="main_file">
								  		<option class="placeholder" value=""></option>
								  		{if $smarty.session.temp.uploaded_files}
								  			{foreach from=$smarty.session.temp.uploaded_files item=s}
								  				<option class="placeholder" value="{$s.filename}" {if $smarty.post.main_file == $s.filename}selected="selected"{/if}>{$s.name}</option>
								  			{/foreach}
								  		{/if}
								  	</select>
	  <small>ZIP - All files for buyers, not including preview images</small>
    </div>
  </div>
  <div class="input-group">
      <label>Preview Screenshots</label>
    <div class="inputs">
								  	<select class="input big ajaxinput" id="temporary_files_to_assign_gallery_preview" name="theme_preview">
								  		<option class="placeholder" value=""></option>
								  		{if $smarty.session.temp.uploaded_files}
								  			{foreach from=$smarty.session.temp.uploaded_files item=s}
								  				<option class="placeholder" value="{$s.filename}" {if $smarty.post.theme_preview == $s.filename}selected="selected"{/if}>{$s.name}</option>
								  			{/foreach}
								  		{/if}
								  	</select>	  
	  <small>ZIP file of images (png/jpg) w/ optional text descriptions for display on the site</small>
    </div>
  </div>

    <div class="note">
      {$lang.filesize_info}
    </div>
</div>

    </div>

    <div class="content-box">
  <h3>{$lang.category_attributes}</h3>
  <div class="input-group">
    <label>{$lang.category}</label>
     <div class="inputs">
      <select name="category[]">{$categoriesSelect}</select>
    </div>
  </div>
  
  
  

  
  

  <div id="attribute_fields">
  
							  {if $attributes}
							  	{foreach from=$attributes item=a}
									<br /><div class="input-group">
									<label>{$a.name}</label>
									<div class="inputs">
									  	{if $a.type == 'select'}									  	
									      <select class="input big mt5" id="custom_attributes_{$a.id}" name="attributes[{$a.id}]">
									      	{foreach from=$a.attributes item=ai}
									      		<option value="{$ai.id}" {if $smarty.post.attributes[$a.id] == $ai.id}selected="selected"{/if}>{$ai.name}</option>
									      	{/foreach}
										  </select>
										  {elseif $a.type == 'multiple'}
									      <select multiple="multiple" id="custom_attributes_{$a.id}" name="attributes[{$a.id}]">
									      	{foreach from=$a.attributes item=ai}
									      		<option value="{$ai.id}" {if $smarty.post.attributes[$a.id] == $ai.id}selected="selected"{/if}>{$ai.name}</option>
									      	{/foreach}
										  </select>
										  {elseif $a.type == 'check'}
										  	{foreach from=$a.attributes item=ai}
								      		<input type="checkbox" name="attributes[{$a.id}][{$ai.id}]" value="{$ai.id}" {if isset($smarty.post.attributes[$a.id][$ai.id])}checked="checked"{/if} class="mt5"/> {$ai.name}<br />
								      	{/foreach}
										  {elseif $a.type == 'radio'}
										  	{foreach from=$a.attributes item=ai}
								      		<label><input type="radio" name="attributes[{$a.id}]" value="{$ai.id}" {if isset($smarty.post.attributes[$a.id]) && $smarty.post.attributes[$a.id] == $ai.id}checked="checked"{/if} /> {$ai.name} </label>
											{/foreach}
								      {else}
								      	<input type="text" name="attributes[{$a.id}]" value="{$smarty.post.attributes[$a.id]}" />
										  {/if}
			  						</div></div>
							  	{/foreach}
							  {/if}
						
	<div class="input-group">
      <label for="item_item_attributes_attributes_4_text_value">{$lang.demo_url}</label>
      <div class="inputs">
      <input autocomplete="off" id="custom_attributes_standard_Demo_URL" name="demo_url" type="text" value="{$smarty.post.demo_url|escape}" />
      <small>{$lang.demo_url_info}</small>
     </div>
   </div>										
 </div>


  <div class="note">Some of our fields allow you to select multiple values. Please use the CTRL key (PC) or COMMAND key (Mac) to select multiple items.</div>
</div>


      <div class="content-box">
	  
	  
	  
	  
	  
	    
  <div class="input-group">
    <label>{$lang.usage_tags}</label>
     <div class="inputs">
	 <input type="text" class="tagInput input big" name="tags[usage]" value="{$smarty.post.tags.usage|escape}" />
    </div>
  </div>
  
  

  <div class="input-group">
    <label>{$lang.style_tags}</label>
    <div class="inputs">
	<input type="text" class="tagInput input big" name="tags[style]" value="{$smarty.post.tags.style|escape}" />	     
    </div>
  </div>
  
  

  <div class="input-group">
    <label>{$lang.features_tags}</label>
    <div class="inputs">
     <input type="text" class="tagInput input big" name="tags[features]" value="{$smarty.post.tags.features|escape}" />	     
    </div>
  </div>
	  
	  
	  

      </div>

    <div class="content-box">
      <h3>{$lang.message_to_reviewer}</h3>
      <div class="input-group">
        <label for="comments_to_reviewer">{$lang.comment}</label>
        <div class="inputs">
          <textarea name="comments_to_reviewer" id="comments_to_reviewer">{$smarty.post.comments_to_reviewer}</textarea>
        </div>
      </div>
     
	 <div class="input-group">
        <label>Price</label>
        <div class="inputs">
           <input type="text" class="input big" name="suggested_price" value="{$smarty.post.suggested_price|escape}" />
        </div>
      </div>

      <div class="input-group">
        <label></label>
        <div class="inputs">
          <label for="got_proper_licenses">
           <input id="got_proper_licenses" name="source_license" type="checkbox" value="true" {if isset($smarty.post.source_license)}checked="checked"{/if} />
            Any images, sounds, video, code, flash, or other assets that are not my own work, have been appropriately licensed for use in the file preview or main download. Other than these items, this work is entirely my own and I have full rights to sell it on {$domain}.

          </label>
        </div>
      </div>
     <div class="form-submit">
     <input type="hidden" name="upload" value="yes" />
     <button type="submit" class="btn-icon upload">{$lang.upload}</button>
      </div>
    </div>
</form>
{/if}
</div><!-- end of item-left -->

<div class="sidebar-l sidebar-right">

  <h2 class="box-heading">Switch Upload Category</h2>
<div class="content-box">
  <form id="begin-upload" action="/" method="get" >
    <p>
      <select id="category" name="category">
          	{if $mainCategories}
          		{foreach from=$mainCategories item=c}
		          	<option value="{$c.id}" {if $smarty.get.category == $c.id}selected="selected"{/if}>{$c.name}</option>
          		{/foreach}
          	{/if}
      </select>
    </p>

     <button onclick="window.location='/upload/form/?category=' + document.getElementById('category').options[document.getElementById('category').selectedIndex].value;" type=button class="btn-icon submit auto-width">{$lang.switch_category}</button>
    <a href="/help/upload/" class="btn-icon help" role="button" target="_blank">Help</a>
</form>

</div>


  <h2 class="box-heading">Get your item accepted</h2>
<div class="content-box">
  <p>To give your item the best chance possible to be accepted, please make sure you've:</p>
  <ul class="fancy-list">
    <li>Read and follow the <a href='/help/upload/' target="_blank">upload instructions</a>.</li>
    <li>Added useful tags and ensured they're spelled correctly (this helps buyers find your file).</li>
    <li>Added a thorough and useful item description (this also helps buyers find your file).</li>
  </ul>
  
  <p>If you've done all that, you're ready to upload. Thanks for selling with {$domain}!</p>
</div>



  <h2 class="box-heading">Trouble Uploading?</h2>
  <div class="content-box">
    <p>
      Some users have experienced problems uploading. We've compiled a <a href="/help/upload/" target="_blank">list of things to check first</a> which might be of help.
      We're always working on improving our uploading infrastructure - but if you continue to experience problems please contact support.
    </p>
  </div>

  <h2 class="box-heading">Corrupt Zip Files</h2>
  <div class="content-box">
    <p>The following archive utilities have been found to generate non-standard zip files that our server is often unable to decompress:</p>
    <ul class="fancy-list">
      <li>7zip</li>
      <li>lzarc</li>
      <li>WinZip (Latest version)</li>
    </ul>
    <p>Please use another archive utility to reduce the chance of problems with your uploads.</p>
  </div>
</div>

      </div>
    </div>

<link href="/zipmarket/apps/{$smarty.get.module}/ajax/swfupload/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="{$data_server}/j_s/swfupload/swfupload.js"></script>
<script type="text/javascript" src="/zipmarket/apps/{$smarty.get.module}/ajax/swfupload/swfupload.queue.js"></script>
<script type="text/javascript" src="/zipmarket/apps/{$smarty.get.module}/ajax/swfupload/fileprogress.js"></script>
<script type="text/javascript" src="/zipmarket/apps/{$smarty.get.module}/ajax/swfupload/handlers.js"></script>

{literal}
<script type="text/javascript"> 
		var swfu;

		window.onload = function() {
			var settings = {
				flash_url : "{/literal}{$data_server}{literal}/j_s/swfupload/Flash/swfupload.swf",
				upload_url: "{/literal}/zipmarket/apps/{$smarty.get.module}{literal}/ajax/swfupload/doUpload.php",
				file_post_name: "file",
				file_size_limit : "500 MB",
				file_types : "{/literal}{$fileTypes}{literal}",
				file_types_description : "Files",
				file_upload_limit : 100,
				file_queue_limit : 0,
				debug: false,
				post_params: {
					'sessID': '{/literal}{$sessID}{literal}'
				},
				custom_settings : {
					progressTarget : "fsUploadProgress",
					cancelButtonId : "btnCancel"
				},

				// Button settings
				button_image_url: "/static/img/upload.png",
				button_width: 127,
        button_height: 31,
				button_placeholder_id: "spanButtonPlaceHolder",
				
				// The event handler functions are defined in handlers.js
				file_queued_handler : fileQueued,
				file_queue_error_handler : fileQueueError,
				file_dialog_complete_handler : fileDialogComplete,
				upload_start_handler : uploadStart,
				upload_progress_handler : uploadProgress,
				upload_error_handler : uploadError,
				upload_success_handler : uploadSuccess,
				upload_complete_handler : uploadComplete,
				queue_complete_handler : queueComplete	// Queue plugin event				
			};

			swfu = new SWFUpload(settings);
	     };
	</script>

{/literal}