cancel
Showing results for 
Search instead for 
Did you mean: 

Modifying the upload files dialog

rodrigoa
Champ in-the-making
Champ in-the-making
Hi all,

I have been reading how to customize the Upload Files Dialog, but I need to do something diferent. I need to add a button on the left side of file, to allow the user to change the type of the File. I am trying to add one button that calls the same function which is called in the link "Change the Type" on the "Actions sur le Document".

If there is anyone that can help me, I would be very grateful.

Thanks all,

Rodrigo.
2 REPLIES 2

rodrigoa
Champ in-the-making
Champ in-the-making
Hi all,

Just to explain what I have already done.

In the file flash-upload.get.html.ftl I created the button:

        <div id="${el}-left-div" class="fileupload-left-div">
            <span class="fileupload-fileButton-span">
               <button class="fileupload-file-button2" value="Changer le type" disabled="true" tabindex="0">${msg("Changer le type")}</button>
            </span>
        </div>

and in the flash-upload.js I created the action:

            var fButton_changer = Dom.getElementsByClassName("fileupload-file-button2", "button", templateInstance);
            if (fButton_changer.length == 1)
            {
               var fileButton_changer = new YAHOO.widget.Button(fButton_changer[0],
               {
                  type: "button",
                  disabled: false
               });
               fileButton_changer.subscribe("click", function()
               {
                  this._onFileButtonChangeClickHandler(flashId, oRecord.getId());
               }, this, true);
               this.fileStore[flashId].fileButton_changer = fileButton_changer;
            }

In this part of my code, I call the function this._onFileButtonChangeClickHandler(flashId, oRecord.getId());. This function I declared at the same file:

    _onFileButtonChangeClickHandler: function FlashUpload__onFileButtonChangeClickHandler(flashId, recordId)
      {
        console.log("*** onFileButtonChangeClickHandler ***");
      },

But now, I need to call the function onActionChangeType: function dlA_onActionChangeType(asset) in the file actions.js.

Thanks all,

Rodrigo

jpfi
Champ in-the-making
Champ in-the-making
Hi,
as far as I know is there a perhaps uncomment documet-type-dropdown box that can be activated in the site-webscript:
just add your selectable types here \share\WEB-INF\classes\alfresco\site-webscripts\org\alfresco\components\upload\flash-upload.get.js:

/**
* Custom content types
*/
function getContentTypes()
{
   // TODO: Data webscript call to return list of available types
   var contentTypes = [
   {
      id: "cm:content",
      value: "cm_content"
   }];

   return contentTypes;
}

model.contentTypes = getContentTypes();

cheers, jan