Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2013-02-13 02:05:42

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

File already exists error message

Spotted this when attempting to upload a duplicate file – shouldn’t the “File already exists” message be a red one rather than a greenie?

Offline

#2 2013-02-13 09:02:51

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,269
Website GitHub

Re: File already exists error message

Yeah, there are a few other places on that panel in particular where the error level status isn’t set properly. Easy to fix, leave it with me.

EDIT: or Jukka :-)

Last edited by Bloke (2013-02-13 13:13:10)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#3 2013-02-13 09:11:03

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: File already exists error message

Thanks Stef. Whilst we’re on the subject of Files tabs – are there any plans afoot to add in some pluggable_ui()s to the File Edit page – similar to what’s been done on the Image Edit page?

Offline

#4 2013-02-13 09:47:51

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,269
Website GitHub

Re: File already exists error message

gomedia wrote:

are there any plans afoot to add in some pluggable_ui()s to the File Edit page – similar to what’s been done on the Image Edit page?

There should be some, yes. Loose plan is to pluggable_ui() as much as makes sense as each tab is revisited with markup changes. Whaddya need, and where?


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#5 2013-02-13 11:54:32

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: File already exists error message

Bloke wrote:

There should be some, yes. Loose plan is to pluggable_ui() as much as makes sense as each tab is revisited with markup changes. Whaddya need, and where?

Something along the lines of what’s been done to the Image tab would be fine thanks – i.e. where each subcomponent has its own pluggable_ui. I’m working on a File tab version of adi_image_tab & am rediscovering the quirks of ob_start() & pattern matching buffers. I’ve a client that’s going to be doing a lot of file uploads, so I’m trying to make it a little easier for them. One particular aspect, which I want to provide a way around, is the standard “Replace file replaces the file contents, but not the file name” scenario.

Offline

#6 2013-02-13 22:25:42

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Re: File already exists error message

I was going to plan my first plugin attempt for the file tab – can I not do that at the moment?

I was planning to add an image field, for client logo, site screenshot type senarios.

Offline

#7 2013-02-14 14:21:41

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,269
Website GitHub

Re: File already exists error message

tye wrote:

I was planning to add an image field, for client logo, site screenshot type senarios.

You can do that now, for sure. Hook into the file_ui / extend_detail_form event/step and you can add the image UI controls there. You’ll also need to do some database wrangling on the file event to create the new column (or table if you wish) to hold the image, etc.

How do I know it works? Because I’ve done it for a few people in the past. Even to the extent that the image was automatically associated if the name (+.jpg or .png) matched the filename. What we’re talking about here is just more stuff to allow you to replace content on the Files panel instead of just augmenting it. If you need to do that kind of thing you can approach it in at least two other ways, but it’s potentially ugly:

  1. jQuery
  2. buffer processing (str_replace)

If you want to look at smd_remote_file, I’ve got a new (4.5+) version that I haven’t got round to uploading yet which uses the ugly method to do its stuff. That plugin would be so much easier with better callbacks like those Adi mentioned…


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#8 2013-02-14 22:18:33

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Re: File already exists error message

Thanks Stef – I’ll download smd_remote_file which will probably help me blankly looking at files and code…. which is all I have done so far :)

Offline

#9 2013-02-15 00:49:06

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: File already exists error message

As of r5221 any individual admin-side input control rendered by the inputlabel() function can be customized through the pluggable UI events.

Any rendered inputLabel() widget goes through a callback event that follows the pattern {$event}_ui > inputlabel.{$name}. Works the same as any other callback event or pluggable UI spot.

Offline

#10 2013-02-15 00:56:12

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: File already exists error message

Thanks.

Offline

#11 2015-09-23 16:58:44

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,595
Website

Re: File already exists error message

tye wrote #270502:

I was planning to add an image field, for client logo, site screenshot type senarios.

Hi tye. Did you implement this in the end? If so, could you share your solution or plugin? I’d like to add publication covers to a downloads area…


TXP Builders – finely-crafted code, design and txp

Offline

#12 2015-09-23 22:32:46

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: File already exists error message

jakob wrote #295094:

I’d like to add publication covers to a downloads area…

On my pencil-notes-roadmap for adi_file_tab I’ve got written “File image field”. What kind of thing did you have in mind?

Offline

Board footer

Powered by FluxBB