<?xml version="1.0"?>
<dbform:form xmlns:dbform="http://bitflux.org/dbforms2/1.0">

    <!--<dbform:javascript src="webinc/plugins/dbforms2/myfunctions.js"/>-->

    <dbform:fields table="podcasts" onsavejs="">

        <dbform:field name="post_title" type="text" descr="Title" onkeyup="updateUriField('field_post_title',document.getElementById('field_post_uri'));">
        </dbform:field>
        
        <dbform:field name="post_uri" type="text" descr="URI" onkeyup="this.edited = true;"/>

        <dbform:field 
            name="post_category"
            type="relation_n2m" 
            relationtable="blogposts2categories" 
            thisidfield="blogposts_id"
            thatidfield="blogcategories_id"
            descr="Category">
            
            <dbform:datasource type="foreign" namefield="fullname" idfield="id" table="blogcategories" order="l"/>
            <dbform:liveselect namefield="fullname" idfield="id" wherefields="fullname,fulluri" table="blogcategories" orderby="l" limit="35"/>

        </dbform:field>

        <dbform:field name="post_content" type="text_wysiwyg" descr="Content" isxml="true">
            <dbform:value></dbform:value>
        </dbform:field>

        <dbform:field name="post_date" type="date" descr="Date"></dbform:field>
        <dbform:field name="post_status" type="checkbox" descr="Enabled" default="1"/>
        
        <dbform:field name="post_comment_mode" type="select" descr="Comment Mode" default="3">
            <dbform:value name="1">Allow comments for 1 month</dbform:value>
            <dbform:value name="2">Always allow comments</dbform:value>
            <dbform:value name="3">No comments allowed</dbform:value>
        </dbform:field>
        
        <dbform:field name="post_author" type="select" descr="Author">
            <dbform:datasource type="foreign" namefield="user_login" idfield="id" table="users" order="user_login"></dbform:datasource>
        </dbform:field>
          
        <dbform:field name="post_podcast" type="file_browser" descr="Podcast"/>
        
    </dbform:fields>

    <dbform:chooser namefield="concat(post_title,' &lt;small&gt;(',id,')&lt;/small&gt;')" wherefields="post_title,post_content"  limit="35"/>    

</dbform:form>

