You are here

function epsacrop_init in EPSA Crop - Image Cropping 6.2

Same name and namespace in other branches
  1. 6 epsacrop.module \epsacrop_init()

Implementation of hook_init

File

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

Code

function epsacrop_init() {
  if ((arg(0) == 'node' || arg(0) == "user") && (arg(1) == 'add' || arg(2) == 'edit' || arg(3) == "edit")) {
    $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
    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');
  }
}