You are here

function jquery_colorpicker_init in Jquery Colorpicker 6

Same name and namespace in other branches
  1. 6.2 jquery_colorpicker.module \jquery_colorpicker_init()

File

./jquery_colorpicker.module, line 11

Code

function jquery_colorpicker_init() {
  global $user;
  if (variable_get('jquery_colorpicker_ie6_support', 0) && user_access('administer jquery colorpicker', $user)) {
    $path = drupal_get_path('module', 'jquery_colorpicker') . '/twin_helix/';
    if (!is_file($path . 'blank.gif')) {
      drupal_set_message(t('You have enabled IE6 support for Jquery Colorpicker, but are missing the required file !blank.gif. This file can be downloaded from !twin_helix and should saved in !path', array(
        '!twin_helix' => l('Twin Helix', 'http://www.twinhelix.com/css/iepngfix/', array(
          'html' => TRUE,
        )),
        '!path' => '<strong>' . $path . '</strong>',
        '!blank.gif' => '<strong>blank.gif</strong>',
      )), 'error');
    }
    if (!is_file($path . 'iepngfix.htc')) {
      drupal_set_message(t('You have enabled IE6 support for Jquery Colorpicker, but are missing the required file !iepngfix.htc. This file can be downloaded from !twin_helix and should saved in !path', array(
        '!twin_helix' => l('Twin Helix', 'http://www.twinhelix.com/css/iepngfix/', array(
          'html' => TRUE,
        )),
        '!path' => '<strong>' . $path . '</strong>',
        '!iepngfix.htc' => '<strong>iepngfix.htc</strong>',
      )), 'error');
    }
    if (!is_file($path . 'iepngfix_tilebg.js')) {
      drupal_set_message(t('You have enabled IE6 support for Jquery Colorpicker, but are missing the required file !iepngfix_tilebg.js. This file can be downloaded from !twin_helix and should saved in !path', array(
        '!twin_helix' => l('Twin Helix', 'http://www.twinhelix.com/css/iepngfix/', array(
          'html' => TRUE,
        )),
        '!path' => '<strong>' . $path . '</strong>',
        '!iepngfix_tilebg.js' => '<strong>iepngfix_tilebg.js</strong>',
      )), 'error');
    }
  }
  variable_set('jquery_colorpicker_ie6_page', 0);
}