You are here

function _datex_add_lib in Datex 7.3

Add datex javascript libraries.

2 calls to _datex_add_lib()
datex_popup_css_alter in datex_popup/datex_popup.module
Implements hook_css_alter().
datex_popup_js_alter in datex_popup/datex_popup.module
Implements hook_js_alter().

File

datex_popup/datex_popup.module, line 23

Code

function _datex_add_lib() {
  static $self_loaded = FALSE;
  if ($self_loaded) {
    return;
  }
  $self_loaded = TRUE;
  $datex_module_path = drupal_get_path('module', 'datex_popup');
  $min = variable_get('datex_popup_js_min', TRUE) ? '.min' : '';

  // Disabled for now
  $min = '';
  drupal_add_js($datex_module_path . '/asset/datex.js');
  drupal_add_js($datex_module_path . "/asset/PersianDate/dist/persian-date{$min}.js");
  drupal_add_js($datex_module_path . "/asset/pwt.datepicker/dist/js/persian-datepicker{$min}.js");
  $theme = variable_get('datex_popup_theme', 'none');
  if ($theme !== 'none') {
    drupal_add_css($datex_module_path . "/asset/pwt.datepicker/dist/css/theme/persian-datepicker-{$theme}.min.css");
  }
  else {
    drupal_add_css($datex_module_path . "/asset/pwt.datepicker/dist/css/persian-datepicker{$min}.css");
  }
}