<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->

<registration_magic>
    <requests>
        <request slug="cm_form_" allowed_actions="add,remove,duplicate,manage,update,quick_add,export,import"  controller="form_controller">

            <!--Action to handle create or edit forms-->
            <actions>
                <action name="add" success-action="cm_form_manage">
                    <model ref="forms" />
                    <service ref="services" />
                </action>

                <action name="quick_add" type="post">
                    <model ref="forms" />
                    <service ref="services" />
                </action>
                <!--List all the forms-->
                <action name="manage">
                    <model ref="forms" />
                    <service ref="services" />
                </action>

                <!--Remove form -->
                <action name="remove" >
                    <model ref="forms" />
                    <service ref="services" />
                </action>

                <action name="duplicate">
                    <model ref="forms" />
                    <service ref="services" />
                </action>

               <action name="export">
                    <model ref="forms" />
                    <service ref="services" />
                </action>
                <action name="update" success-action="cm_form_manage">
                    <model ref="forms" />
                    <service ref="services" />
                </action>
                <action name="import">
                    <model ref="forms" />
                    <service ref="services" />
                </action>
            </actions>

        </request>


        <request slug="cm_field_" allowed_actions="add,remove,duplicate,manage,update,set_order,add_page,delete_page,rename_page"  controller="field_controller">

            <!--Action to handle create or edit forms-->
            <actions>
                <action name="add" success-action="cm_field_manage">
                    <model ref="fields" />
                    <service ref="services" />
                </action>

                <!--List all the forms-->
                <action name="manage" >
                    <model ref="fields" />
                    <service ref="services" />
                </action>

                <!--Remove form -->
                <action name="remove" >
                    <model ref="fields" />
                    <service ref="services" />
                </action>

                <action name="duplicate">
                    <model ref="fields" />
                    <service ref="services" />
                </action>

                <action name="update" success-action="cm_form_manage">
                    <model ref="fields" />
                    <service ref="services" />
                </action>
                
                <action name="set_order">
                    <model ref="fields" />
                    <service ref="services" />
                </action>                
                
                <action name="add_page">
                    <model ref="fields" />
                    <service ref="services" />
                </action>
                
                <action name="delete_page">
                    <model ref="fields" />
                    <service ref="services" />
                </action>
                
                <action name="rename_page">
                    <model ref="fields" />
                    <service ref="services" />
                </action>
            </actions>

        </request>
        
        <!--Pricing Fields related-->
        <request slug="cm_paypal_field_" allowed_actions="add,manage,remove"  controller="paypal_field_controller">

            <!--Action to handle create or edit forms-->
            <actions>
                <action name="add" success-action="cm_paypal_field_manage">
                    <model ref="paypal_fields" />
                    <service ref="services" />
                </action>

                <!--List all the forms-->
                <action name="manage" >
                    <model ref="paypal_fields" />
                    <service ref="services" />
                </action>
                
                <action name="remove" >
                    <model ref="paypal_fields" />
                    <service ref="services" />
                </action>
            </actions>

        </request>

        <!--Setting related request mappings-->
        <request slug="cm_options_" allowed_actions="manage,general,security,autoresponder,thirdparty,payment,save"  controller="options">

            <actions>

                <!--Showing all the setting options-->
                <action name="manage" type="get">
                    <model ref="options" />
                    <service ref="setting_service" />
                </action>

                <!--General settings page-->
                <action name="general" success-action="cm_options_manage">
                    <model ref="options" />
                    <service ref="setting_service" />
                </action>
                
                <!--Security settings page-->
                <action name="security" success-action="cm_options_manage">
                    <model ref="options" />
                    <service ref="setting_service" />
                </action>

                <!--Third Party settings page-->
                <action name="thirdparty" success-action="cm_options_manage">
                    <model ref="options" />
                    <service ref="setting_service" />
                </action>

                <!--Autoresponder settings page-->
                <action name="autoresponder" success-action="cm_options_manage">
                    <model ref="options" />
                    <service ref="setting_service" />
                </action>

                <!--Autoresponder settings page-->
                <action name="payment" success-action="cm_options_manage">
                    <model ref="options" />
                    <service ref="setting_service" />
                </action>

                <!--Save settings
                <action name="save" success-action="cm_options_manage">
                    <model ref="options" />
                    <service ref="setting_service" />
                </action>
                -->


            </actions>

        </request>        

        <request slug="cm_support_" allowed_actions="forum,frontend"  controller="support_controller">

            <actions>
                <action name="forum">
                </action>
            </actions>
            
            <actions>
                <action name="frontend">
                </action>
            </actions>

        </request>

        <request slug="cm_user_form_" allowed_actions="process,edit_sub"  controller="front_form_controller">

            <!--Action to handle create or edit forms-->
            <actions>
                <action name="process">
                    <model ref="fields" />
                    <service ref="front_form_service" />
                </action>
                
                <action name="edit_sub">
                    <model ref="fields" />
                    <service ref="front_form_service" />
                </action>

            </actions>

        </request>

        <request slug="cm_dashboard_widget_" allowed_actions="display"  controller="dashboard_widget_controller">

            <!--Action to handle create or edit forms-->
            <actions>
                <action name="display">
                    <service ref="dashboard_widget_service" />
                </action>

            </actions>

        </request>
        
        
        <request slug="cm_submission_" allowed_actions="manage,print_pdf,view,remove,export,search,related"  controller="submission_controller">

            <!--Action to manage submissions from backend-->
            
            <actions>
                <action name="manage">
                    <service ref="services" />
                </action>
                <action name="view">
                    <model ref="submissions" />
                    <service ref="services" />
                </action>
                <action name="print_pdf">
                    <model ref="submissions" />
                    <service ref="services" />
                </action>
                <action name="remove">
                    <model ref="submissions" />
                    <service ref="services" />
                </action>
                <action name="export">
                    <model ref="submissions" />
                    <service ref="services" />
                </action>
                <action name="search">
                    <model ref="submissions" />
                    <service ref="services" />
                </action>    
                 <action name="related">
                    <model ref="submissions" />
                    <service ref="services" />
                </action>          
            </actions>

        </request>
        
        <request slug="cm_front_" allowed_actions="set_otp,submissions,log_off,reset_pass_page"  controller="front_controller">

            <!--Action to manage submissions from backend-->
            
            <actions>
                <action name="set_otp">
                    <service ref="front_service" />
                </action> 
                 
                <action name="submissions">
                    <service ref="front_service" />
                </action>
                
                <action name="log_off">
                    <service ref="front_service" />
                </action>                
                
                <action name="reset_pass_page">
                    <service ref="front_service" />
                </action>
                                        
            </actions>

        </request>

        <request slug="cm_analytics_" allowed_actions="show_form,show_field,reset"  controller="analytics_controller">

            <!--Action to display analytics-->
            
            <actions>
                <action name="show_form">
                    <service ref="analytics_service" />
                </action>   

                <action name="show_field">
                    <service ref="analytics_service" />
                </action>
                
                <action name="reset">
                    <service ref="analytics_service" />
                </action>         
            </actions>

        </request>

        <request slug="cm_invitations_" allowed_actions="manage"  controller="invitations_controller">

            <!--Action to display analytics-->
            
            <actions>
                <action name="manage">
                    <service ref="invitations_service" />
                </action>   

            </actions>

        </request>
        
        <request slug="cm_sent_emails_" allowed_actions="manage,view,remove"  controller="sent_emails_controller">

            <!--Action to display analytics-->
            
            <actions>
                <action name="manage">
                    <service ref="sent_emails_service" />
                </action>   
                
                <action name="view">
                    <service ref="sent_emails_service" />
                </action>
                
                <action name="remove">
                    <service ref="sent_emails_service" />
                </action>  

            </actions>

        </request>

        <request slug="cm_editor_actions_" allowed_actions="add_form,add_email,add_fields_dropdown_invites"  controller="editor_actions">

            <!--Action add FORM button near media in edit post page-->
            <actions>
                <action name="add_form">
                    <service ref="editor_actions_service" />
                </action>

                <action name="add_email">
                    <service ref="editor_actions_service" />
                </action>

                <action name="add_fields_dropdown_invites">
                    <service ref="editor_actions_service" />
                </action>

            </actions>

        </request>
        
        <request slug="cm_attachment_" allowed_actions="manage,download_all,download,download_selected"  controller="attachment_controller">

            <actions>

                <!--List all the existing roles-->
                <action name="manage" type="get">
                    <service ref="attachment_service" />
                </action>
                
                <action name="download_all" type="post">
                    <service ref="attachment_service" />
                </action>
                
                <action name="download_selected" type="post">
                    <service ref="attachment_service" />
                </action>
                
                <action name="download" type="get">
                    <service ref="attachment_service" />
                </action>
                
            </actions>

        </request>
        
        <request slug="cm_note_" allowed_actions="add,delete"  controller="notes_controller">

            <!--Action to manage submissions from backend-->
            <actions>
                <action name="add">
                    <model ref="notes" />
                    <service ref="notes_service" />
                </action>
                <action name="delete">
                    <model ref="notes" />
                    <service ref="notes_service" />
                </action>           
            </actions>

        </request>
        
        <request slug="cm_form_sett_" allowed_actions="general,limits,post_sub,autoresponder,view,mailchimp,ccontact,aweber,manage,access_control,qck_toggle,override"  controller="form_sett_controller">

            <actions>

                <!--                List all the existing roles-->
                <action name="general">
                    <model ref="forms" />
                    <service ref="services" />
                </action>
                
                <action name="manage">
                    <model ref="forms"/>
                    <service ref="services" />
                </action>

                <!--                Create a new role inherited from default roles-->
                <action name="limits">
                    <model ref="forms" />
                    <service ref="services" />
                </action>

                <!--                Delete user role-->
                <action name="post_sub">
                    <model ref="forms" />
                    <service ref="services" />
                </action>
                
                <!--                List all the existing roles-->
                <action name="autoresponder">
                    <model ref="forms" />
                    <service ref="services" />
                </action>
                
                <!--                List all the existing roles-->
                <action name="view">
                    <model ref="forms" />
                    <service ref="services" />
                </action>
                
                <!--                List all the existing roles-->
                <action name="mailchimp">
                    <model ref="forms" />
                    <service ref="mailchimp_service" />
                </action>
                <action name="ccontact">
                    <model ref="forms" />
                    
                </action>
                 <action name="aweber">
                    <model ref="forms" />
                   
                </action>
                <action name="access_control">
                    <model ref="forms" />
                    <service ref="services" />
                </action>
                
                <action name="qck_toggle">
                    <model ref="forms" />
                    <service ref="services" />
                </action>

                <action name="override">
                    <model ref="forms" />
                    <service ref="services" />
                </action>

            </actions>

        </request>

        
    </requests>

    <controllers>
        <controller name="form_controller" class="CM_Form_Controller" />
        <controller name="user_controller" class="CM_User_Controller" />
        <controller name="field_controller" class="CM_Field_Controller" />
        <controller name="notes_controller" class="CM_Note_Controller" />
        <controller name="paypal_field_controller" class="CM_PayPal_Field_Controller" />
        <controller name="support_controller" class="CM_Support_Controller" />
        <!--<controller name="settings" class="CM_Settings" />
        <controller name="submission" class="CM_Submission" />-->
        <controller name="options" class="CM_Options_Controller" />
        <controller name="front_form_controller" class="CM_Front_Form_Controller" />
        <controller name="submission_controller" class="CM_Submission_Controller" />
        <controller name="front_controller" class="CM_Front_Controller" />
        <controller name="editor_actions" class="CM_Editor_Actions_Controller" />
        <controller name="attachment_controller" class="CM_Attachment_Controller" />
        <controller name="analytics_controller" class="CM_Analytics_Controller" />
        <controller name="invitations_controller" class="CM_Invitations_Controller" />
        <controller name="dashboard_widget_controller" class="CM_Dashboard_Widget_Controller" />
        <controller name="form_sett_controller" class="CM_Form_Settings_Controller" />
        <controller name="sent_emails_controller" class="CM_Sent_Emails_Controller" />
    </controllers>

    <models>
        <model name="forms" class="CM_Forms" />
        <model name="fields" class="CM_Fields" />
        <model name="paypal_fields" class="CM_PayPal_Fields" />
        <model name="options" class="CM_Options" />
        <model name="submissions" class="CM_Submissions" />
        <model name="front_users" class="CM_Front_Users"/>
        <model name="notes" class="CM_Notes" />
    </models>

    <services>
        <service name="services" class="CM_Services" />
        <service name="user_services" class="CM_User_Services" />
        <service name="setting_service" class="CM_Setting_Service" />
        <service name="front_form_service" class="CM_Front_Form_Service" />
        <service name="front_service" class="CM_Front_Service" />
        <service name="editor_actions_service" class="CM_Editor_Actions_Service" />
        <service name="attachment_service" class="CM_Attachment_Service" />
        <service name="analytics_service" class="CM_Analytics_Service" />
        <service name="invitations_service" class="CM_Invitations_Service" />
        <service name="notes_service" class="CM_Note_Service" />
        <service name="mailchimp_service" class="CM_MailChimp_Service" />
        <service name="dashboard_widget_service" class="CM_Dashboard_Widget_Service" />
        <service name="sent_emails_service" class="CM_Sent_Emails_Service" />
    </services>

</registration_magic>
