Keyword

How to remove "select file from server"?

  • Thomas
  • Thomas's Avatar Topic Author
  • Offline
  • New Member
More
12 years 3 months ago #67434 by Thomas
How can we remove the option "select file from server" in the tab attachments in frontend editing?

Please Log in or Create an account to join the conversation.

More
12 years 3 months ago #67435 by Lefteris
Replied by Lefteris on topic Re: How to remove "select file from server"?
Hi. Make a template override to itemform.php

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Thomas
  • Thomas's Avatar Topic Author
  • Offline
  • New Member
More
12 years 3 months ago #67436 by Thomas
That works for the image tab, but not the attachments tab.
But it is ok, we can use the image tab.

Thanks

Please Log in or Create an account to join the conversation.

More
8 years 3 months ago #154929 by massimiliano
Replied by massimiliano on topic How to remove "select file from server"?
Old, but a little workaround can be this:

edit template file itemform.php
edit "addAttachmentButton" button's id and associate a new snippet of javascript to new id.
This is an example of javascript:
jQuery('#MyNewCustomButtonId').click(function(event) {
        event.preventDefault();
        var div = jQuery('<div/>', {
	        style : 'border-top: 1px dotted #ccc; margin: 4px; padding: 10px;'
	    }).appendTo(jQuery('#itemAttachments'));
	    var input = jQuery('<input/>', {
	        name : 'attachment_file[]',
	        type : 'file'
	    }).appendTo(div);
	    var input = jQuery('<input/>', {
	        name : 'attachment_existing_file[]',
	        type : 'text'
	    }).appendTo(div);
	    var input = jQuery('<input/>', {
	        value : K2Language[0],
	        type : 'button'
	    }).appendTo(div);
	    input.click(function() {
	        jQuery(this).parent().remove();
	    });
	    var br = jQuery('<br/>').appendTo(div);
	    var label = jQuery('<label/>').html(K2Language[1]).appendTo(div);
	    var input = jQuery('<input/>', {
	        name : 'attachment_title[]',
	        type : 'text',
	        'class' : 'linkTitle'
	    }).appendTo(div);
	    var br = jQuery('<br/>').appendTo(div);
	    var label = jQuery('<label/>').html(K2Language[2]).appendTo(div);
	    var textarea = jQuery('<textarea/>', {
	        name : 'attachment_title_attribute[]',
	        cols : '30',
	        rows : '3'
	    }).appendTo(div);
    });

Hope helpful.
M.

Please Log in or Create an account to join the conversation.

  • JoomlaWorks Support Team
  • JoomlaWorks Support Team's Avatar
  • Offline
  • Elite Member
More
8 years 3 months ago #154940 by JoomlaWorks Support Team
Replied by JoomlaWorks Support Team on topic How to remove "select file from server"?
Thank you for sharing this.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum