In media.variables.inc, the variable dialoga_get_theme_name is assigned the property 'seven', referring to the Seven administration theme.

'dialog_get_theme_name' => 'seven',

This variable assignment unnecessarily associates this contributed module with a specific theme. This variable variable should be genericized.

Comments

jessebeach’s picture

StatusFileSize
new692 bytes

This patch changes this set variable

'dialog_get_theme_name' => 'seven',

to

'dialog_get_theme_name' => variable_get('admin_theme'),

removing the modules dependency on the Seven theme.

jessebeach’s picture

StatusFileSize
new692 bytes
JacobSingh’s picture

Status: Active » Needs review

Should a variable be getting a variable? I guess so, because there are cases where the admin theme will not work w/ Media due to the tight spacing constraints. I suppose this is okay, but can I get a +1 from someone else?

David_Rothstein’s picture

I was wondering something similar as Jacob. In theory this patch makes sense, but not all sites will even be using an admin theme, in which case I think this will wind up using their default theme instead. I'm trying to imagine (for example) what a theme like Garland would look like inside the media dialog. It's probably worth taking a look to see what kind of disaster it is :)

Granted, many themes (including Garland) look pretty bad inside the Overlay also, and this is a similar situation. However, in those cases you might just choose not to use the Overlay module. Choosing not to use the media browser seems like a bigger sacrifice to me.

aaron’s picture

I have the same hesitation as @David_Rothstein. I don't think that in the vast majority of cases it should be a problem to hard-code it with Seven as the default, because AFAIK, it should be okay to use that theme even if it isn't enabled (can someone test that to make sure)? Thus, the only case I can think of where it might be a problem would be if someone has entirely removed the Seven theme from their file system. In which case they can also override the variable...

james.elliott’s picture

I think a better solution than setting the variable to a variable would be to add a configuration option to alter the setting from the UI.

JacobSingh’s picture

Status: Needs review » Needs work

+1 to a dropdown to select the theme in media settings.

JacobSingh’s picture

Title: media.variables.inc contains a hard-coded reference to the Seven theme when it should be referring to the configured admin theme » Provide a settings form for general media settings including media dialog theme and file extensions
Status: Needs work » Needs review
StatusFileSize
new4.59 KB

I'm renaming this because this patch does more than was specified.

I started with the original goal, but then we've got other bugs about not being able to change the allowed extensions without settings.php tomfoolery, and the form looked quite barren with only one field.

The descriptions are... wordy. But it's hard to explain wtf this stuff is. Please feel free to edit them and re-post patches.

james.elliott’s picture

Status: Needs review » Reviewed & tested by the community

R to the TBC

JacobSingh’s picture

Status: Reviewed & tested by the community » Fixed

Committed.

David_Rothstein’s picture

"It can be different from your site's theme because the many site themes do not work well in the small windows which media uses.

not sure what this means - maybe "the" isn't supposed to be there?

JacobSingh’s picture

Fixed

JacobSingh’s picture

Status: Fixed » Needs review
StatusFileSize
new2.64 KB

Here's an update which defaults to the admin theme when not specified.

JacobSingh’s picture

StatusFileSize
new3 KB

slight update to the submit hand;er.

JacobSingh’s picture

Status: Needs review » Fixed

Committed it w/o review.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.