/// class PD.Manage.Modules.UserCreateDialogCommand

PD.Manage.Modules.UserCreateDialogCommand =
PD.Commands.Command.extend({

    //===================================
    // PUBLIC METHODS
    //===================================

    setDefaults: function () {
        this.props("id", "user/create-dialog");
        this.props("enabled", true);
        this.props("icon", PD.Path.to16x16("plus.png"));
        this.props("label", "New User");
        this.props("tooltip", "Create a new User.");
    },

    execute: function (e) {
        this._super(e);

        ProspectDirector.Web.UI.FeatureSets.NHibTargetEditorDialog.open({
            config: {
                title: "New User"
            },
            data: {
                layoutType: ProspectDirector.Web.UI.FeatureSets.Layouts.TabStripLayout,
                targetArbiter: "ProspectDirector.Web.Manage.Modules.Security.UserArbiter",
                targetType: "ProspectDirector.Web.Manage.Modules.Security.UserUIO"
            },
            callbacks: {
                ok: function (sender, e) {

                    PD.context.get_default().get_events().publish("user/create", {
                        id: e.target.id
                    });

                }
            }
        });

    }

});