Mine isn't. I've only looked at the 2.7 Imagepicker, not extensively used it, so if I've missed something there then you can ignore what follows.

You can also ignore this if you don't want Admin styling.

Anyhow, I'm working on an upload form element similar to your own. Plus some other off-Drupal URL admin pages. Probably not the best way to gain friendly interest, but your upload form is the best, so there. I wanted an Admin theme, because it's an admin page. Which I know is hell to pay in Drupal.

Way 1. Prefix your URL's with the word 'admin'. This triggers the Drupal admin styling, and is ever so tidy. But the admin prefix is a bit unpleasant (I mean, '/node' gets away with this, right?).

Way 2. After an hour of letting the code fall into theme registration I was still looking at horrible hacks like CSS stripping and hook_theme_registry_alter() when I hit on a daft solution. Use system.module's very own method of swinging in on the initial page render, something like,

function imagepicker_init() {
// Use the administrative theme if the user is looking at a page in the imagepicker/* path.
if (arg(0) == 'imagepicker') {
global $custom_theme;
$custom_theme = variable_get('admin_theme', '0');
drupal_add_css(drupal_get_path('module', 'system') .'/admin.css', 'module');
}

// Add the CSS from the system admin module.
drupal_add_css(drupal_get_path('module', 'system') .'/defaults.css', 'module');
drupal_add_css(drupal_get_path('module', 'system') .'/system.css', 'module');
drupal_add_css(drupal_get_path('module', 'system') .'/system-menus.css', 'module');
}

Disadvantage: will muck up custom styling. May have unexpected effects on a few pages, forcing new URL's.
Advantage: Instant admin theming. Just like that. Everywhere.

Rob

Comments

rcrowther’s picture

I've been round your interface a bit more, and I can see 'will muck up custom styling' would be an understatement - enabling this feature either way is quite an effort for imagepicker. Still, if you were interested, it might lead to a major depreciation session (I love depreciating code).

Rob.

hutch’s picture

If you want to theme the imagepicker_upload_form which is what I *think* you are wanting to do, you could try the following:

# add this to imagepicker.theme.inc
function theme_imagepicker_upload_form($form) {
  $output = '';
  $output .= '<!-- testing upload form -->';
  $output .= drupal_render($form);
  $output .= '<!-- /testing upload form -->';
  return $output;
}

# add this to function imagepicker_theme()

    'imagepicker_upload_form' => array(
      'arguments' => array(
        'form' => NULL,
      ),
    ),

Then flush the cache and navigate to the upload form and look in the source to see if the HTML comments in theme_imagepicker_upload_form are there, then you know it has 'taken'. I have just tested this and it works for me.

You can then tease the form apart and use drupal_render on different parts of the form, add HTML, etc.
If you have the devel module installed and can access /tmp you can use dd($form) and see the structure of the form.

If this works then function theme_imagepicker_upload_form can be copied to your theme's template.php as function mytheme_imagepicker_upload_form and you can hack around there ;-)

Hope this helps.

hutch’s picture

Status: Active » Closed (works as designed)