DotNetNuke Wiki


userFileManager jQuery plugin

Modified on 2012/05/21 11:41 AM by cathal Categorized as jQuery
This article is for a specific plugin. Please be sure to read the Introduction and Overview to jQuery Plugins which provides an introduction to the plugins.

userFileManager»

The user file manager is a jQuery plugin which integrates with users "my folder" files i.e. the area where all valid site users can upload files to by default e.g. profile avatars, journal uploads etc. This plugin is used by the dnnComposeMessage jQuery plugin when attachments are enabled, but it is also available for other core or 3rd party extensions.

To do so it's recommend that you use the Client Resource Management API to ensure only a single copy of the script is included and that it is minimized and compacted (if your install has chosen those options) e.g.

<dnn:DnnJsInclude ID="DnnJsInclude2" runat="server" FilePath="~/Resources/Shared/Components/UserFileManager/UserFileManager.js" Priority="102" />

Whilst it's not mandatory, it is recommended to also include the css file that provides for a common look & feel.

<dnn:DnnCssInclude ID="DnnCssInclude2" runat="server" FilePath="~/Resources/Shared/Components/UserFileManager/UserFileManager.css" />

An example of the available options is below:

 $.fn.userFileManager.defaultOptions = {
        openTriggerScope: 'body', // defines parent scope for openTriggerSelector, allows for event delegation
        openTriggerSelector: '#photoFromSite', // defined in template, opens dialog
        dialogClass: 'dnnFormPopup fileManagerPopup',
        width: '700px', // dialog width
        minHeight: '400px', // dialog height
        getItemsServiceUrl: '/DesktopModules/Journal/API/UserFile.ashx/GetItems',
        attachCallback: function (file) {
            // available properties .id, .modified, .name, .parentId, .size, .thumb_url, .type
            alert(file.name + ' attached.');
        },
        templatePath: '/Resources/Shared/Components/UserFileManager/Templates/',
        templateName: 'Default',
        templateExtension: '.html',
        /* localized text values: */
        title: 'My Files', // dialog title
        cancelText: 'Cancel', // dialog cancel button
        attachText: 'Attach', // dialog attach button
        nameHeaderText: 'Name',
        typeHeaderText: 'Type',
        lastModifiedHeaderText: 'Last Modified',
        fileSizeText: 'File size: '
    };

Attend A Webinar
Start  Professional Edition Trial
Have Someone Contact Me

Like Us on Facebook Join our Network on LinkedIn Follow DNN Corporate on Twitter Follow DNN on Twitter

Advertisers

Sponsors

DotNetNuke Corporation

DotNetNuke (DNN) provides a suite of solutions that make designing, building and managing feature-rich sites and communities fast, easy and cost-effective. The DotNetNuke Platform CMS is the foundation for more than one million websites worldwide. DNN Social, our newest solution, enables businesses to create immersive, interactive communities. Thousands of organizations like True Value Hardware, Bose, Cornell University, Glacier Water, Dannon, Delphi, USAA, NASCAR, Northern Health and the City of Denver have leveraged DNN to deploy highly engaging business- critical websites. Our rapid growth in product sales and deployments resulted in DotNetNuke Corp. being named one of the fastest growing private companies in America by Inc. Magazine in 2011 and 2012.