You are here

function imagepicker_thickbox_js in Image Picker 6.2

hook into (patched) thickbox module.

File

./imagepicker.functions.inc, line 2280
Imagepicker functions

Code

function imagepicker_thickbox_js() {
  global $user;
  if (imagepicker_get_thickbox_perms()) {
    $width = variable_get('imagepicker_advanced_iframe_width', "100%");
    if (isset($user->imagepicker_advanced_iframe_width) && $user->imagepicker_advanced_iframe_width) {
      $width = $user->imagepicker_advanced_iframe_width;
    }
    if (preg_match("/%\$/", $width)) {
      $width = '630';
    }
    $height = variable_get('imagepicker_advanced_iframe_height', 500);
    if (isset($user->imagepicker_advanced_iframe_height) && $user->imagepicker_advanced_iframe_height) {
      $height = $user->imagepicker_advanced_iframe_height;
    }
    drupal_add_js(array(
      'imagepicker_thickbox' => array(
        'width' => $width,
        'height' => $height,
      ),
    ), 'setting');
    drupal_add_js(IMAGEPICKER_PATH . '/imagepicker_thickbox.js');
  }
}