cancel
Showing results for 
Search instead for 
Did you mean: 

Disabling the 'upload file' button based on directory name

haffi67
Champ in-the-making
Champ in-the-making
I'm trying to disable the "upload file" button which is in the toolbar.lib.ftl file, when the name of the current directory fulfills some critera (contains a specific word for example). The problem is that I can't seem to find out which variables to use for that purpose (I've really been searching the wiki and forums and I can't find just a general list of the variables that are available, I know that I have user, as in user.isAdmin and page, as in page.url, but where can I find a complete list?). Can anyone help me?
1 REPLY 1

erikwinlof
Confirmed Champ
Confirmed Champ
Try this:

1. Override the toolbar.get.head.ftl to include a new custom javascript file with a javascript class that extends the Alfresco.DocListToolbar class and overrides the onFilterChanged method. Make your overridden method disable the upload button ( this.widgets.fileUpload.set("disabled", true); ) when some conditions apply (and enable when they don't) and directly after that call the the super class method you overrid simply by calling Alfresco.DocListToolbar.superclass.onFilterChanged(this, layer, args)

2. Override the toolbar.get.html.ftl template and change the javascript class that is instantiated to become your new custom javascript class.

Cheers,

:: Erik