_drupal_add_js
includes/common.inc, строка 1747
- Версии
- 5
_drupal_add_js($data, $type, $scope, $defer, $cache)
Helper function for drupal_add_js()
.
Связанные темы
Код
<?php
function _drupal_add_js($data, $type, $scope, $defer, $cache) {
static $javascript = array();
if (!isset($javascript[$scope])) {
$javascript[$scope] = array('core' => array(), 'module' => array(), 'theme' => array(), 'setting' => array(), 'inline' => array());
}
if (!isset($javascript[$scope][$type])) {
$javascript[$scope][$type] = array();
}
if (!is_null($data)) {
switch ($type) {
case 'setting':
$javascript[$scope][$type][] = $data;
break;
case 'inline':
$javascript[$scope][$type][] = array('code' => $data, 'defer' => $defer);
break;
default:
$javascript[$scope][$type][$data] = array('cache' => $cache, 'defer' => $defer);
}
}
return $javascript[$scope];
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии