{*
  Template for the edit interface
  $Id: edit_news.tpl,v 1.00 2006/10/26 20:00:00
*}

<!-- {$smarty.template} -->
<div id="title">{if $news.id}<a href="show_news.php?id=$news.id">{$news.q_title}</a>{else} {/if}</div>
<div id="actions">
    <div id="barre-onglet">

{if $news.id || $xmlimport}
	{if $news.id}
		<form action="show_news.php" method="get" name="show">
			<input type="hidden" name="id" value="{$news.id}" />
			<input type="submit" class="onglet" value="{$lang.view}" />
		</form>
	{else}
		<form action="edit_news.php" method="get" name="import">
			<input type="hidden" name="import" value="xml" />
			<input type="submit" class="onglet" value="Import" />
		</form>
	{/if}
	{if $news.seegallery}
        <form action="gallery.php" name="galleryform">
            <input type="hidden" name="subcat" value="{$news.id}"/>
            <input type="hidden" name="cat" value="2" />
            <input type="submit" value="{$lang.gallery}" class="onglet"/>
        </form>
	{/if}
	{if $news.commentable}
			<form action="comments.php" name="mkcommentform">
				<input type="hidden" name="subcat" value="{$news.id}"/>
				<input type="hidden" name="cat" value="2" />
				<input type="submit" value="{$lang.comment}" class="onglet"/>
			</form>
	{/if}
	{if $news.prev_id || $news.next_id}
			<form action="show_news.php" name="prevform">
				<input type="hidden" name="id" value="{$news.prev_id}"/>
				<input type="submit" class="onglet" value="<" {if !$news.prev_id}disabled="disabled"{/if} accesskey="," />
			</form>
			<form action="show_news.php" name="nextform">
				<input type="hidden" name="id" value="{$news.next_id}"/>
				<input type="submit" class="onglet" value=">" {if !$news.next_id}disabled="disabled"{/if} accesskey="." />
			</form>
	{/if}
	</div>
	<!-- /actions -->
	<div id="barre-season">
		<form action="edit_news.php" name="editform">
				<input type="submit" value="{$lang.newdata}" class="onglet"/>
		</form>
		<form action="edit_news.php" name="editform">
				<input type="hidden" name="id" value="{$news.id}"/>
				<input type="submit" value="{$lang.edit}" class="onglet"/>
		</form>
		<form action="delete.php" name="deleteform">
				<input type="hidden" name="id" value="{$news.id}"/>
				<input type="hidden" name="cat" value="7"/>
				<input type="submit" value="{$lang.del}" onclick="return(confirm('{$news.q_title|escape:javascript}: {$lang.msg_really_del}?'))" class="onglet"/>
		</form>
	</div>
{/if}
</div>

<script language="JavaScript" type="text/javascript" src="javascript/edit.js"></script>
<script language="JavaScript" type="text/javascript">
{literal}
function add() {
document.edi.category.options[document.edi.category.options.length] = new Option(document.edi.newcat.value,document.edi.newcat.value);
document.edi.newcat.value = '';
}
{/literal}
</script>

{if $http_error}<div class="center">{$http_error}</div>{/if}

<div id="pagecontent">

<div id="edit">

<form action="edit_news.php" id="edi" name="edi" method="post" enctype="multipart/form-data">
  <input type="hidden" name="id" id="id" value="{$news.id}" />
  <input type="hidden" name="save" id="save" value="1" />
  
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
      <td class="td-value">

      <table width="100%" cellspacing="0" cellpadding="5" border="0">
        <tr>
          <td class="td-opt"><h4>{$lang.title}:</h4></td>
          <td class="td-value">
            <input type="text" name="title" value="{$news.q_title}"  size="40" maxlength="255" />
          </td>
        </tr>
		<tr>
          <td class="td-opt"><h4>{$lang.category}:</h4></td>
          <td class="td-value">
		  	<select name="category">
			<option value="0">---{$lang.category}---</option>
			{foreach item=category from=$categoryselect}
			<option value="{$category.category}" {if $category.category == $news.q_category}Selected{/if}>{$category.category}</option>
			{/foreach}
			</select>
			<input type="text" size="15" name="newcat"><input type="button" onclick="javascript:add();" value="{$lang.add}">
          </td>
        </tr>
		<tr>
          <td class="td-opt"><h4>{$lang.language}:</h4></td>
          <td class="td-value">
		  	<select name="language">
			<option value="0">---{$lang.language}---</option>
			{foreach item=language from=$languageselect}
			<option value="{$language.id}" {if $language.id == $news.q_language}Selected{/if}>{$language.val}</option>
			{/foreach}
			</select>
          </td>
        </tr>
		<tr>
          <td class="td-opt"><h4>{$lang.pubdate}:</h4></td>
          <td class="td-value"><input type="text" name="pubdate" id="pubdate" value="{$news.q_pubdate}" size="8" maxlength="8" />  (DDMMYYYY)</td>
        </tr>        
      </table>
      </td>
      <td class="td-value">
      <table width="100%" cellspacing="0" cellpadding="5">		
		<tr>
          <td class="td-opt"><h4>{$lang.link}:</h4></td>
          <td class="td-value"><input type="text" name="link" id="link" value="{$news.q_link}" size="40" maxlength="255" /></td>
        </tr>
		<tr>
          <td class="td-opt"><h4>{$lang.newsfrom}:</h4></td>
          <td class="td-value"><input type="text" name="newsfrom" id="newsfrom" value="{$news.q_newsfrom}" size="40" maxlength="255" /></td>
        </tr>
        <tr>
          <td class="td-opt"><h4>{$lang.logourl}:</h4></td>
          <td class="td-value">
          	<input type="text" name="imgurl" id="imgurl" value="{$news.q_imgurl}"  size="40" maxlength="255" />
            <a href="javascript:void(lookupImage(document.edi.name.value))"><img src="images/search.gif" alt="" align="middle" /></a>
          </td>
        </tr>		
        <tr>
          <td class="td-opt"><h4>{$lang.logoupload}:</h4></td>
          <td class="td-value"><input type="file" name="coverupload" id="coverupload" size="35" /></td>
        </tr>
        
      </table>
      </td>
    </tr>
	<tr>
          <td class="td-opt" colspan="2"><h4>{$lang.summary}:</h4></td>
	</tr>
	<tr>
          <td class="td-value" colspan="2" align="center"><textarea style="width:98%" cols="30" rows="4" name="summary" id="plot" wrap="virtual">{$news.q_summary}</textarea></td>
    	</tr>
	<tr>
          <td class="td-opt" colspan="2"><h4>{$lang.comments}:</h4></td>
	</tr>
	<tr>
          <td class="td-value" colspan="2" align="center"><textarea style="width:98%" cols="30" rows="15" name="plot" id="plot" wrap="virtual">{$news.q_plot}</textarea></td>
    </tr>
	<tr>
		<td colspan="2">	
		<div id="barre-season">
		<input style="width:100%;" type="submit" class="btn-search" value="{$lang.save}" id="savebutton" accesskey="s" />
		</div>
		</td>
	</tr>
  </table>
</form>

<script language="JavaScript" type="text/javascript">
		document.edi.title.focus();
</script>

</div>
<!-- /edit -->

</div>
<!-- /content -->
