<mt:setvarblock name="page_title"><__trans phrase="Configuration File"></mt:setvarblock>
<mt:setvar name="complete" value="1">
<mt:include name="include/chromeless_header.tmpl">

<form method="post">
<input type="hidden" name="__mode" value="" />
<input type="hidden" name="step" value="seed" />
<input type="hidden" name="config" value="<mt:var name="config" escape="html">" />
<input type="hidden" name="set_static_uri_to" id="set_static_uri_to" value="<mt:var name=static_uri escape="html">">
<input type="hidden" name="default_language" value="<mt:var name="default_language">" />    

<mt:if name="file_not_found">
    <mtapp:statusmsg
        id="file_not_found"
        class="error">
        <__trans phrase="The [_1] configuration file can't be located." params="<mt:var name=MT_PRODUCT_NAME>">
    </mtapp:statusmsg>
    <p><em><__trans phrase="Please use the configuration text below to create a file named 'mt-config.cgi' in the root directory of [_1] (the same directory in which mt.cgi is found)." params="<mt:var name=MT_PRODUCT_NAME>"></em></p>
<mt:else>
    <mt:unless name="config_created">
        <mtapp:statusmsg
            id="config_error"
            class="error">
            <__trans phrase="The wizard was unable to save the [_1] configuration file." params="<mt:var name=MT_PRODUCT_NAME>">
        </mtapp:statusmsg>

        <p><em><__trans phrase="Confirm that your [_1] home directory (the directory that contains mt.cgi) is writable by your web server and then click 'Retry'." params="<mt:var name=MT_PRODUCT_NAME>"></em></p>
    <mt:else>
        <mtapp:statusmsg
            id="config_success"
            class="success">
            <__trans phrase="Congratulations! You've successfully configured [_1]." params="<mt:var name=MT_PRODUCT_NAME>">
        </mtapp:statusmsg>

        <p><__trans phrase="Your configuration settings have been written to the following file:"></p>
        <div class="mt-config-file-path">
            <mt:var name="config_file">
        </div>
        <p><__trans phrase="To change the settings, click the 'Back' button below."></p>
    </mt:unless>
</mt:if>

<mt:unless name="config_created">
<p id="config_settings_toggle"><a href="javascript:void(0)" onclick="showByID('config_settings'); hideByID('config_settings_toggle')"><__trans phrase="Show the mt-config.cgi file generated by the wizard"></a></p>
</mt:unless>

<p id="config_settings" style="display: none;">
    <textarea style="width: 100%; height: 300px; font-family: monospace" onclick="this.select()"><mt:include name="mt-config.tmpl"></textarea>
</p>

<mt:unless name="config_created">
<p>
    <input id="manually" class="cb" type="checkbox" name="manually" value="1" onclick="toggleConfig()" <mt:if name="manually">checked="checked"</mt:if>> <label for="manually"><__trans phrase="The mt-config.cgi file has been created manually."></label>
</p>
</mt:unless>

<div id="retry-buttons" class="actions-bar" <mt:if name="file_not_found">style="display:none;"</mt:if>>
<mt:unless name="config_created">
    <button
       name="retry"
       type="submit"
       onclick="go('retry');"
       class="retry action primary-button"
       ><__trans phrase="Retry"></button>
<mt:else>
    <button
       name="continue"
       type="submit"
       onclick="document.location.href='<mt:var name="mt_script">'; return false"
       class="action primary-button"
       ><__trans phrase="Continue"></button>
</mt:unless>
    <button 
       name="back"
       type="submit"
       onclick="go('previous_step');"
       class="goback action"
       ><__trans phrase="Back"></button>
</div>

<div id="automatic-buttons" class="actions-bar" <mt:unless name="file_not_found">style="display:none;"</mt:unless>>
    <button
       name="retry"
       type="submit"
       onclick="go('retry');"
       class="retry action primary-button"
       ><__trans phrase="Continue"></button>

    <button
       name="retry"
       type="submit"
       onclick="go('retry');"
       class="goback action"
       ><__trans phrase="Back"></button>
</div>

</form>
<script type="text/javascript">
/* <![CDATA[ */
function go(mode) {
    var f = document.forms[0];
    f['__mode'].value = mode;
}

function toggleConfig() {
    var manually = getByID('manually');
    var retry = getByID('retry-buttons');
    var automatic = getByID('automatic-buttons');
    if (manually) {
        if (manually.checked == true) {
            retry.style.display = 'none';
            automatic.style.display = 'block';
        } else {
            retry.style.display = 'block';
            automatic.style.display = 'none';
        }
    }
}
/* ]]> */
</script>
<mt:include name="include/chromeless_footer.tmpl">
