/// class PD.Manage.Modules.Rules.UploadZipDialog
// using PD.Web.UI.SingleUploadDialog

PD.Manage.Modules.Rules.UploadZipDialog =
PD.Web.UI.SingleUploadDialog.extend({

    //===================================
    // CONSTRUCTOR
    //===================================

    init: function (options) {

        this._super($.extend(true, {
            config: {
                resizable: false,
                height: "130px",
                width: "400px",
                title: "Upload Zip Package"
            }
        }, options));

    },

    //===================================
    // PRIVATE METHODS
    //===================================

    executePostUploadAction: function (e) {

        var that = this,
            uploadId = e[0].target_name,
            service = new PD.Manage.Services.RulesService();

        service.addPackage(uploadId, function (result) {

            PD.context.get_default().get_events().publish("rules/add");
            that.close({
                command: "ok"
            });

        }, function (e) {
            that.close();
        });

    }

});

PD.Manage.Modules.Rules.UploadZipDialog.open = function (options) {
    return new PD.Manage.Modules.Rules.UploadZipDialog(options);
};