/**
 * 
 * All content on this website (including text, images, source
 * code and any other original works), unless otherwise noted,
 * is licensed under a Creative Commons License.
 * 
 * http://creativecommons.org/licenses/by-nc-sa/2.5/
 * 
 * Copyright (C) 2004-2010 Open-Xchange, Inc.
 * Mail: info@open-xchange.com 
 * 
 * @author Matthias Biggeleben <matthias.biggeleben@open-xchange.com>
 * 
 */

/*jslint white: true, browser: true, devel: true, evil: true, forin: true, undef: true, eqeqeq: true, immed: true */

/*global ox, showNode, triggerEvent, configuration_askforSave, configfolder : true,
configparentfolder : true, oChangedParentFolder : true, unLoadFolderProps,
loadFolderProps */

ox.api.folder.viewProperties = function (id) {
    
    // get folder
    ox.api.folder.get({
        folder: id,
        success: function (data) {
            // show folder properties
            configuration_askforSave(function () {
                configfolder = id;
                activefolder = id;
                configparentfolder = oChangedParentFolder = -1;
                triggerEvent("OX_Switch_View", "configuration/folder/overview"); 
                unLoadFolderProps();
                loadFolderProps();
            });
        }
    });
};

ox.api.folder.exportContacts = function (id, action) {
    // download via iframe
    $("dlIframe").src = AjaxRoot + "/export?action=" + action + "&folder=" + id + "&session=" + session;
};


