<?xml version="1.0" encoding="UTF-8"?>
<openerp>
    <data>
        <record model="ir.ui.view" id="create_moodle_config_view">
            <field name="name">moodle.config.wizard.form</field>
            <field name="model">event.moodle.config.wiz</field>
            <field name="arch" type="xml">
                <form string="Configure Moodle" version="7.0">
                    <group>
                     <separator string="Server" colspan="4"/>
                     <field name="server_moodle"/>
                     <newline/>
                     <separator string="Connection with a Token" colspan="4"/>
                     <label string="The easiest way to connect OpenERP with a moodle server is to create a 'token' in Moodle. It will be used to authenticate OpenERP as a trustable application." colspan="4"/>
                     <field name="moodle_token"/>
                     <newline/>
                     <separator string="Connection with username and password" colspan="4"/>
                     <label string="Another approach is to create a user for OpenERP in Moodle. If you do so, make sure that this user has appropriate access rights." colspan="4"/>
                     <field name="moodle_username"/>
                     <field name="moodle_password" password="True"/>
                    </group>
                    <footer>
                        <button type="object" name="configure_moodle"
                            string="Apply" class="oe_highlight"  />
                            or
                            <button string="Cancel" class="oe_link" special="cancel" />
                    </footer>
                </form>
            </field>
        </record>

        <record model="ir.actions.act_window" id="configure_moodle">
            <field name="name">Configure Moodle</field>
            <field name="res_model">event.moodle.config.wiz</field>
            <field name="view_id" ref="create_moodle_config_view"/>
            <field name="view_type">form</field>
            <field name="view_mode">form</field>
            <field name="target">new</field>
        </record>

        <!-- register configuration wizard -->
        <record id="base.open_menu" model="ir.actions.todo">
            <field name="action_id" ref="configure_moodle"/>
            <field name="state">open</field>
        </record>

        <menuitem name="Moodle Configuration" parent="base.menu_marketing_config_root" id="wizard_moodle" action="configure_moodle"/>

    </data>
</openerp>
