<{if $actionName eq "ImageAdd"}>
<style type="text/css">
<!--
@import url("<{$moduleUrl|escape}>/css/style.css");
body { background: #fff; }
-->
</style>
<script type="text/javascript">
<!--//
window.attachEvent("onload", resizeTo(600, 600));
function hideDocumentElement(id) {
    var el = document.getElementById(id);
    if (el) el.style.display = 'none';
}

function showDocumentElement(id) {
    var el = document.getElementById(id);
    if (el) el.style.display = 'block';
}

//-->
</script>
<{/if}>
<h1 class="myuploaderHeader1"><{if $actionForm->get('image_id')}><{$smarty.const._MD_MYUPLOADER_LANG_IMAGE_EDIT}><{else}><{$smarty.const._MD_MYUPLOADER_LANG_ADD_A_NEW_IMAGE}><{/if}></h1>
<{if $actionForm->hasError()}>
<ul class="error">
  <{foreach item=message from=$actionForm->getErrorMessages()}>
  <li><{$message|xoops_escape}></li>
  <{/foreach}>
</ul>
<{/if}>
<form action="index.php?op=<{$actionName}>" enctype="multipart/form-data" method="post" id="myuploaderForm">
<fieldset>
<{xoops_token form=$actionForm}>
<{xoops_input type=hidden name=image_id value=$actionForm->get('image_id')}>
<{xoops_input type=hidden name=target value=$target}>
<!-- category -->
<label class="label" for="category_id"><{$smarty.const._MD_MYUPLOADER_LANG_CATEGORY}></label>
<div class="control">
  <select name="category_id" id="category_id">
  <{html_options options=$categories selected=$actionForm->get('category_id')}>
  </select>
</div>
<!-- title -->
<label class="label" for="image_title"><{$smarty.const._MD_MYUPLOADER_LANG_IMAGE_TITLE}></label>
<div class="control"><{xoops_input type=text name=image_title value=$actionForm->get('image_title') size=50 maxlength=100}></div>
<!-- description -->
<{if $moduleConfig.imagemanager_only}>
<input type="hidden" name="dohtml" value="0" />
<input type="hidden" name="doxcode" value="0" />
<input type="hidden" name="doimage" value="0" />
<input type="hidden" name="dobr" value="0" />
<label for="legacy_xoopsform_image_description" class="label"><{$smarty.const._MD_MYUPLOADER_LANG_IMAGE_CAPTION}></label>
<div class="control">
	<{if $actionName eq "ImageAdd"}>
<textarea id="legacy_xoopsform_image_description" name="image_description" cols="50" rows="5" onselect="xoopsSavePosition('legacy_xoopsform_image_description');" onclick="xoopsSavePosition('legacy_xoopsform_image_description');" onkeyup="xoopsSavePosition('legacy_xoopsform_image_description');"><{$actionForm->get('image_description')}></textarea>
	<{else}>
<textarea name="image_description" id="legacy_xoopsform_image_description" cols="50" rows="5"><{$actionForm->get('image_description')}></textarea>
	<{/if}>
</div>
<{else}>
<label for="image_description" class="label"><{$smarty.const._MD_MYUPLOADER_LANG_IMAGE_DESCRIPTION}></label>
<div class="control"><{xoops_dhtmltarea type=text name=image_description value=$actionForm->get('image_description')}></div>
<{*   options   *}>
<div class="label"><{$smarty.const._MD_MYUPLOADER_LANG_DESCRIPTION_OPTIONS}></div>
<div class="control">
	<{if $object->mHtmlAllowed}>
<!-- dohtml -->
<input type="checkbox" name="dohtml" id="dohtml" value="1"<{if $actionForm->get('dohtml')}> checked="checked"<{/if}> /><label for="dohtml"><{$smarty.const._MD_MYUPLOADER_LANG_HTML_ENABLED}></label><br />
	<{/if}>
<!-- doxcode -->
<input type="checkbox" name="doxcode" id="doxcode" value="1"<{if $actionForm->get('doxcode')}> checked="checked"<{/if}> /><label for="doxcode"><{$smarty.const._MD_MYUPLOADER_LANG_XCODE_ENABLED}></label><br />
<!-- doimage -->
<input type="hidden" name="doimage" id="doimage" value="1"<{if $actionForm->get('doimage')}> checked="checked"<{/if}> /><{*<label for="doimage"><{$smarty.const._MD_MYUPLOADER_LANG_IMAGE_ENABLED}></label><br />*}>
<!-- dobr -->
<input type="checkbox" name="dobr" id="dobr" value="1"<{if $actionForm->get('dobr')}> checked="checked"<{/if}> /><label for="dobr"><{$smarty.const._MD_MYUPLOADER_LANG_AUTO_BR}></label><br />
</div>
<{/if}>
<!-- filename -->
<label class="label" for="image_filename"><{$smarty.const._MD_MYUPLOADER_LANG_IMAGE_FILENAME}></label>
<div class="control"><{xoops_input type=file size=30 name=image_filename}>
<input type="checkbox" id="optlength" name="optlength" onclick="if(this.checked){showDocumentElement('length_options');}else{hideDocumentElement('length_options');};" />
<label for="optlength"><{$smarty.const._MD_MYUPLOADER_LANG_SHOW_OPTIONS}></label>
</div>
<!-- length option -->
<div id="length_options" style="display: none;">
<label class="label" for="resize_length"><{$smarty.const._MD_MYUPLOADER_LANG_RESIZE_LENGTH}></label>
<div class="control"><{xoops_input type=text name=resize_length value=$actionForm->get('resize_length')}></div>
<label class="label" for="thumb_length"><{$smarty.const._MD_MYUPLOADER_LANG_THUMB_LENGTH}></label>
<div class="control"><{xoops_input type=text name=thumb_length value=$actionForm->get('thumb_length')}></div>
</div>
<!-- active -->
<label class="label" for="image_active"><{$smarty.const._MD_MYUPLOADER_LANG_IMAGE_ACTIVE}></label>
<div class="control"><{xoops_input type=checkbox name=image_active value=1 default=$actionForm->get('image_active')}></div>
<!-- weight -->
<label class="label" for="image_weight"><{$smarty.const._MD_MYUPLOADER_LANG_IMAGE_WEIGHT}></label>
<div class="control"><{xoops_input type=text name=image_weight value=$actionForm->get('image_weight') }></div>
</fieldset>
<fieldset class="formSubmit">
<div class="label"></div>
<div class="control">
  <input type="submit" class="formButton" value="<{$smarty.const._SUBMIT}>"/>
  <input type="submit" class="formButton" value="<{$smarty.const._MD_MYUPLOADER_LANG_CANCEL}>" name="_form_control_cancel"/>
</div>
</fieldset>
</form>
<{if $actionName eq "ImageAdd"}>
<div style="text-align:center; margin:5px;">
  <input value="<{$smarty.const._CLOSE}>" type="button" onclick="javascript:window.close();" />
</div>
<{/if}>