<input type="hidden" name="sectionid" value="[% article.data.sectionid %]" />
<input type="hidden" name="articleid" value="[% article.data.articleid %]" />
<input type="hidden" name="folderid"  value="[% article.data.folderid %]" />
<input type="hidden" name="userid"    value="[% article.data.userid %]" />
<input type="hidden" name="imageid"   value="[% article.data.imageid %]" />
<input type="hidden" name='doaction'  value='' />
<input type="hidden" name="recordid"  value='' />

<div class="boxer">
    <table width="100%">
    <tr><td width="85">Title *</td>
        <td width="10" class="alert">[% article.data.title_err %]</td>
        <td><input type="text" name="title" value="[% article.data.title %]" size="50" /></td>
    </tr>
    <tr>
        <td>Posted</td>
        <td class="alert">[% article.data.postdate_err %]</td>
        <td>on <input type="text" name="postdate" value="[% article.data.postdate %]" /> by [% article.data.name %]</td>
    </tr>
    <tr><td>Quickname *</td>
        <td class="alert">[% article.data.quickname_err %]</td>
        <td><input type="text" name="quickname" value="[% article.data.quickname %]" size="20" /></td>
    </tr>
    <tr><td>Publish Status *</td>
        <td class="alert">[% article.data.publish_err %]</td>
        <td>[% article.data.ddpublish %]</td>
    </tr>
    </table>
</div>

<input type="hidden" name="display" value="display0" />
<input type="hidden" name="list" value="[% article.blocks %]" />

[% FOREACH item = article.body %]
[% IF item %]
<input type="hidden" name="BLOCK[% item.orderno %]" value="[% item.type %],[% item.paraid %]" />
[% END %]
[% END %]

<div class="boxer">
    <table width="100%">

[% IF article.blocks %]

[% FOREACH item = article.body %]
[% IF item %]
[% IF item.type == 1 %]
    <tr><td width="80">[% item.orderno %] : Image</td>
        <td width="10" class="red">[% item.error %]</td>
        <td><input type="hidden" name="display[% item.orderno %]" value="" />
            <input type="hidden" name="gallery[% item.orderno %]" value="[% item.imageid %]" />
            <input type="file" name="IMAGEUPLOAD[% item.orderno %]" />
        [% IF item.link %]
            <img id="display[% item.orderno %]" src="[% webpath %]/[% item.link %]" alt="[% item.tag %]" />
        [% ELSE %]
            <img id="display[% item.orderno %]" src="[% webpath %]/images/blank.png" alt="" />
        [% END %]
            <br />[ <a href="javascript:DoPopup('display[% item.orderno %]')">Select from Gallery</A> ]
            <table>
            <tr><td>Align:</td><td colspan="3">[% item.ddalign %]</td></tr>
            <tr><td>HyperLink:</td><td><input type="text" name="IMAGELINK[% item.orderno %]" value="[% item.tag %]" /></td>
                <td>Tag:</td><td><input       type="text" name="IMAGETAG[% item.orderno %]"  value="[% item.tag %]" /></td></tr>
            <tr><td>Width:</td><td><input     type="text" name="width[% item.orderno %]"     value="[% item.width %]" /></td>
                <td>Height:</td><td><input    type="text" name="height[% item.orderno %]"    value="[% item.height %]" /></td></tr>
            </table>
            <p>Please note that when initially selecting images from the Photo Gallery, the loaded image wlll be the
            current raw size. Once the page is saved the image will be resized to the appropriate dimensions. In the
            width and height boxes, you may leave these blank or set to 0 to use the default settings (max 400x400 pixels).</p>
        </td>
    </tr>
[% END %]
[% IF item.type == 2 %]
    <tr><td width="80">[% item.orderno %] : Text</td>
        <td width="10" class="red">[% item.error %]</td>
        <td><textarea name="TEXT[% item.orderno %]" rows="15" cols="80" class="tinymce">[% item.body %]</textarea></td>
    </tr>
[% END %]
[% IF item.type == 3 %]
    <tr><td width="80">[% item.orderno %] : Link</td>
        <td width="10" class="red">[% item.error %]</td>
        <td><input type="text" name="LINK[% item.orderno %]" value="[% item.link %]" /></td>
    </tr>
[% END %]
    <tr><td></td>
        <td></td>
        <td>
        [ <a href="javascript:doSubmit('MoveUp',[% item.paraid %])">Move block up</a>
        | <a href="javascript:doSubmit('MoveDn',[% item.paraid %])">Move block down</a>
        | <a href="javascript:doSubmit('Delete',[% item.paraid %])">Delete block</a> ]</td>
    </tr>
[% END %]
[% END %]

[% ELSE %]
    <tr><td align="center">No content yet!</td></tr>
[% END %]

    </table>
<p align="center">[ <a href="javascript:doSubmit('AddImage',0)">Add an image</a> | <a href="javascript:doSubmit('AddPara',0)">Add a text block</a> ]</p>
<p align="center"><input type="submit" value="Submit" /></p>
</div>
