locale_library_alter

function locale_library_alter

locale_library_alter(&$libraries, $module)

Implement hook_library_alter().

Provides the language support for the jQuery UI Date Picker.

File

modules/locale/locale.module, line 988
Add language handling functionality and enables the translation of the user interface to languages other than English.

Code

function locale_library_alter(&$libraries, $module) {
  if ($module == 'system' && isset($libraries['ui.datepicker'])) {
    global $language;
    // locale.datepicker.js should be added in the JS_LIBRARY group, so that
    // this attach behavior will execute early. JS_LIBRARY is the default for
    // hook_library_info_alter(), thus does not have to be specified explicitly.
    $datepicker = drupal_get_path('module', 'locale') . '/locale.datepicker.js';
    $libraries['ui.datepicker']['js'][$datepicker] = array();
    $libraries['ui.datepicker']['js'][] = array(
      'data' => array(
        'jquery' => array(
          'ui' => array(
            'datepicker' => array(
              'isRTL' => $language->direction == LANGUAGE_RTL,
              'firstDay' => variable_get('date_first_day', 0),
            ),
          ),
        ),
      ),
      'type' => 'setting',
    );
  }
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!locale!locale.module/function/locale_library_alter/7.x

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部