You are here

function _epsacrop_include_html in EPSA Crop - Image Cropping 6

2 calls to _epsacrop_include_html()
epsacrop_init in ./epsacrop.module
Implements hook_init
_epsacrop_form_after_build in ./epsacrop.module
Add scripts and styles on a node edit page.

File

./epsacrop.module, line 47
The main file of module

Code

function _epsacrop_include_html() {
  static $included = FALSE;
  if ($included === FALSE) {
    $path_module = drupal_get_path('module', 'epsacrop');
    drupal_add_js(array(
      'epsacrop' => array(
        'base' => base_path(),
        'path' => $path_module,
      ),
    ), 'setting');
    jquery_ui_add(array(
      'ui.dialog',
    ));
    drupal_add_js(EPSACROP_JCROP_PATH . '/js/jquery.Jcrop.min.js');
    drupal_add_js(EPSACROP_JSON2_PATH . '/json2.js');
    drupal_add_js($path_module . '/js/epsacrop.js');

    // We try to use the theme from jquery_ui module
    if (function_exists('jquery_ui_get_path')) {
      $css_path = jquery_ui_get_path() . '/themes/base/ui.all.css';
      if (!file_exists($css_path)) {
        $css_path = jquery_ui_get_path() . '/themes/default/ui.all.css';
      }
      drupal_add_css($css_path);
    }
    else {
      drupal_add_css(drupal_get_path('module', 'jquery_ui') . '/jquery.ui/themes/default/ui.all.css');
    }
    drupal_add_css(EPSACROP_JCROP_PATH . '/css/jquery.Jcrop.css');
    drupal_add_css($path_module . '/css/epsacrop.css');
    $included = TRUE;
  }
}