In an attempt to get the button to do anything, I copied the code to create a new folder in the toolbar.js file. Here are the parts of the code that I changed:
/**
* Fired by YUI when parent element is available for scripting.
* Component initialisation, including instantiation of YUI widgets and event listener binding.
*
* @method onReady
*/
onReady: function DLTB_onReady()
{
// New Folder button: user needs "create" access
this.widgets.newFolder = Alfresco.util.createYUIButton(this, "newFolder-button", this.onNewFolder,
{
disabled: true,
value: "create"
});
// ADDED by DAD 2010_05_07
// genMaps button: user needs "create" access
this.widgets.genMaps = Alfresco.util.createYUIButton(this, "genMaps-button", this.onGenMaps,
{
disabled: true,
value: "create"
});
//END OF ADD
// File Upload button: user needs "create" access
this.widgets.fileUpload = Alfresco.util.createYUIButton(this, "fileUpload-button", this.onFileUpload,
{
disabled: true,
value: "create"
});
and:
/**
* Generate Maps button click handler
*
* @method onGenMaps
* @param e {object} DomEvent
* @param p_obj {object} Object passed back from addListener method
*/
onGenMaps: function DLTB_onGenMaps(e, p_obj)
{
var actionUrl = Alfresco.constants.PROXY_URI + $combine("slingshot/doclib/action/folder/site", this.options.siteId, this.options.containerId, Alfresco.util.encodeURIPath(this.currentPath));
var doSetupFormsValidation = function DLTB_oNF_doSetupFormsValidation(p_form)
{
// Validation
p_form.addValidation(this.id + "-createFolder-name", Alfresco.forms.validation.mandatory, null, "blur");
p_form.addValidation(this.id + "-createFolder-name", Alfresco.forms.validation.nodeName, null, "keyup");
p_form.addValidation(this.id + "-createFolder-name", Alfresco.forms.validation.length,
{
max: 256,
crop: true
}, "keyup");
p_form.addValidation(this.id + "-createFolder-title", Alfresco.forms.validation.length,
{
max: 256,
crop: true
}, "keyup");
p_form.addValidation(this.id + "-createFolder-description", Alfresco.forms.validation.length,
{
max: 512,
crop: true
}, "keyup");
p_form.setShowSubmitStateDynamically(true, false);
};
if (!this.modules.createFolder)
{
this.modules.createFolder = new Alfresco.module.SimpleDialog(this.id + "-createFolder").setOptions(
{
width: "30em",
templateUrl: Alfresco.constants.URL_SERVICECONTEXT + "modules/documentlibrary/create-folder",
actionUrl: actionUrl,
doSetupFormsValidation:
{
fn: doSetupFormsValidation,
scope: this
},
firstFocus: this.id + "-createFolder-name",
onSuccess:
{
fn: function DLTB_onNewFolder_callback(response)
{
var folder = response.json.results[0];
YAHOO.Bubbling.fire("folderCreated",
{
name: folder.name,
parentPath: folder.parentPath,
nodeRef: folder.nodeRef
});
Alfresco.util.PopupManager.displayMessage(
{
text: this.msg("message.new-folder.success", folder.name)
});
},
scope: this
}
});
}
else
{
this.modules.createFolder.setOptions(
{
actionUrl: actionUrl,
clearForm: true
});
}
this.modules.createFolder.show();
},
/**
* File Upload button click handler
The button is generated on the page, and the images are loaded….I must be missing something either in above code or in another file.
Thanks in advance for any help.