We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Couple File Manager modal requests

Developer Preview

Brandon Kelly's avatar
Brandon Kelly
257 posts
14 years ago
Brandon Kelly's avatar Brandon Kelly

Since you guys are doing all this work on the File Manager, this might be a good time to voice a couple requests I have.

It would be nice if $.ee_filebrowser.add_trigger accepted an optional 4th parameter, a settings object, where we could easily tell the File Manager which file directory it should be limited to, and whether it should allow all file types, or just images.

Currently in EE, Filemanager._upload_file() determines which file types should be allowed by actually unserializing the field settings and looking at the field_content_type value. But for something like Matrix, where a single field could have multiple file columns, the whole field can’t have any single content type set. So the Content Type setting in Matrix’s File celltype has never been able to be enforced – it simply determines whether the button says “Add File” or “Add Image”.

In EE 2.2, you added the Upload Directory setting to File fields, but it’s up to the File fieldtype to actually hide the File Directory dropdown, and reload the File Manager iframe with “&dir;_override=” set in its src= attribute. While it’s not difficult for me to just duplicate all that code (as I already have locally), wouldn’t it be a lot simpler for the File Manager JS to do all that itself, simply based on whether settings.directory is set to a number or not?

Here’s kindof what I’m picturing for ee_filebrowser.js:

$.ee_filebrowser.add_trigger = function(el, field_name, settings, callback) {
    if (! callback) {
        if ($.isFunction(field_name)) {
            callback = field_name;
            field_name = 'userfile';
            settings = { content_type: 'any', directory: 'all' };
        }
        else if ($.isFunction(settings)) {
            callback = settings;
            settings = { content_type: 'any', directory: 'all' };
        }
    }
    ...
};

(Obviously it would be more involved than that – you’d have to actually enforce the settings, but you get the idea…)

       
buggles's avatar
buggles
32 posts
14 years ago
buggles's avatar buggles

I’d just like to second this request.

       
Robin Sowell's avatar
Robin Sowell
13,255 posts
14 years ago
Robin Sowell's avatar Robin Sowell

Agreed- I did the js for the hiding bit and am really not satisfied with the approach. So it was already on the list for work this sprint. Think this would be a preferable way to go at it.

       
Brandon Kelly's avatar
Brandon Kelly
257 posts
14 years ago
Brandon Kelly's avatar Brandon Kelly

Sweet. Keep me posted!

       
Wes Baker's avatar
Wes Baker
343 posts
14 years ago
Wes Baker's avatar Wes Baker

Brandon, I think I got it all squared away. We’re looking to send out another dev preview before the final release and it will have the ability to set a content_type and directory when calling add_trigger.

Wes

       
Brandon Kelly's avatar
Brandon Kelly
257 posts
14 years ago
Brandon Kelly's avatar Brandon Kelly

Good to hear, Wes. Are you guys still planning on getting EE 2.2 out on Wednesday? I’m starting to get a little antsy for the update, so I can make sure Matrix 2.2.2 is ready to go when EE 2.2 is publicly released.

       
Wes Baker's avatar
Wes Baker
343 posts
14 years ago
Wes Baker's avatar Wes Baker

That’s our plan, but we’re not ready to guarantee that it’ll be out then.

Wes

       
Brandon Kelly's avatar
Brandon Kelly
257 posts
14 years ago
Brandon Kelly's avatar Brandon Kelly

Ok. Well, I’ve said this on at least a couple occasions, but I’ll say it again: If you guys want to get serious about this add-on developer program, you really need to get in the habit of sending out release candidates at least one week in advance of the actual release. Especially for a big release like this that requires us to update our code, it’s pretty nerve-racking to not have an updated RC and be told that you’re planning on releasing it in 6 days.

It’s supposed to work in your favor too – if you give yourselves a full week to QA the release after you think it’s all good to go, you’ll have a chance to find and squash a few more bugs, and have the confidence that you’re releasing something stable.

       
Wes Baker's avatar
Wes Baker
343 posts
14 years ago
Wes Baker's avatar Wes Baker

Greg posted that we released a new version this past Tuesday (the 14th) in this forum. Here’s the post. If we have to push the release back and there’s enough changes to warrant another dev build, we’ll send out another.

Wes

       
Brandon Kelly's avatar
Brandon Kelly
257 posts
14 years ago
Brandon Kelly's avatar Brandon Kelly

Ah, great, thanks! Didn’t see that – is there a way you guys can send email notifications for important new threads like that?

       
Wes Baker's avatar
Wes Baker
343 posts
14 years ago
Wes Baker's avatar Wes Baker

I’ll ask around about it, but the intention is to change the way we’re talking to third party developers. Though that will have to wait until after 2.2 is released.

Wes

       
Brandon Kelly's avatar
Brandon Kelly
257 posts
14 years ago
Brandon Kelly's avatar Brandon Kelly

So how does the new add_trigger function work? All of the JS in the new preview is compressed.

       
Wes Baker's avatar
Wes Baker
343 posts
14 years ago
Wes Baker's avatar Wes Baker

I just sent you the uncompressed javascript, let me know if you need anything else.

       
Brandon Kelly's avatar
Brandon Kelly
257 posts
14 years ago
Brandon Kelly's avatar Brandon Kelly

Sweet, thanks! Looks like it pretty much works like I suggested 😊

       
Brian Litzinger's avatar
Brian Litzinger
704 posts
14 years ago
Brian Litzinger's avatar Brian Litzinger

Any chance I can get a copy of that uncompressed JS too? 😊

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.