/// class PD.Manage.Modules.Resources.DownloadZipFolderCommand

PD.Manage.Modules.Resources.DownloadZipFolderCommand =
PD.Commands.Command.extend({

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

    setDefaults: function () {

        this.props("id", this.inits("id") || "zip/download-folder");
        this.props("enabled", true);
        this.props("label", "Download Zip");
        this.props("icon", PD.Path.to16x16("folder_zip_down.png"));
        this.props("tooltip", "");
        this.props("canExecute", true);

        this.state("targetFolderId", null);

    },

    setState: function (state) {
        this._super(state);
        this.props("enabled", this.state("targetFolderId") && this.props("canExecute"));
    },

    execute: function (e) {
        this._super(e);
        
        PD.Web.MonitoredDownloadManager.download("~/Manage/Resources/GetFolderPackage", {
            folderId: this.state("targetFolderId")
        }, {
            dialogTitle: "Download Zip",
            dialogMessage: "Please wait while your zip is being created.",
        });

    }

});