Adding links to the menu

Applies to Web File Share version (291210)

The menus are defined inside the file "/path-to-WebFileShare/js/fileman/toolbars_and_menus.js".

To add a link on the main toolbar (next to the "Upload" and "File" options), you open the file in a text editor and add the following code after the line #185:

tbar.push('-');

tbar.push({

 text: FR.T('Your button'), scale: 'medium',

 icon: FR.iconsURL+'/the_icon.gif',

 handler: function() {

   document.location.href = 'http://www.google.com';

 }

});

  • The button's text can be set by replacing the text "Your button".
  • To change the target URL, replace in the above code "http://www.google.com" with your own address.
  • To set the icon, place a file named "the_icon.gif" inside "/path-to-WebFileShare/images/fileman/interface/icons/". If you don't want an icon for the button, simply delete the line that starts with "icon:".

If you want the button to open the page into a window, replace the line

document.location.href = 'http://www.google.com';

 

with the following code:

 

  FR.UI.popup({

      src: 'http://www.google.com/?',

      width: 680, height: 540, constrain: true, maximizable: true, autoDestroy: true

  });

 

Please note that this function automatically adds some variables to the specified URL. To avoid troubles, try ending your URL with a question mark (?) character.

 

 

Attached Files
There are no attachments for this article.
Comments
There are no comments for this article. Be the first to post a comment.
Name
Email
Security Code Security Code
Related Articles RSS Feed
Custom "Open with" actions
Viewed 1636 times since Wed, Nov 22, 2017
Adding custom functionality
Viewed 1959 times since Thu, Mar 6, 2014
Running custom scripts when users perform various actions
Viewed 2697 times since Thu, Mar 6, 2014
Counting file downloads
Viewed 3395 times since Thu, Mar 6, 2014
External Login Form
Viewed 2164 times since Wed, Nov 22, 2017
Translating Web File Share
Viewed 19545 times since Wed, Mar 5, 2014
Calculating MD5 Checksums
Viewed 1961 times since Thu, Mar 6, 2014
Hiding options from the "Open with..." menu
Viewed 1826 times since Thu, Mar 6, 2014
The API
Viewed 3771 times since Wed, Nov 22, 2017
File reference
Viewed 1972 times since Tue, Jun 10, 2014
MENU