Révision b4adf10d
Ajouté par Assos Assos il y a plus de 9 ans
drupal7/includes/ajax.inc | ||
---|---|---|
276 | 276 |
|
277 | 277 |
$extra_commands = array(); |
278 | 278 |
if (!empty($styles)) { |
279 |
$extra_commands[] = ajax_command_prepend('head', $styles);
|
|
279 |
$extra_commands[] = ajax_command_add_css($styles);
|
|
280 | 280 |
} |
281 | 281 |
if (!empty($scripts_header)) { |
282 | 282 |
$extra_commands[] = ajax_command_prepend('head', $scripts_header); |
... | ... | |
292 | 292 |
$scripts = drupal_add_js(); |
293 | 293 |
if (!empty($scripts['settings'])) { |
294 | 294 |
$settings = $scripts['settings']; |
295 |
array_unshift($commands, ajax_command_settings(call_user_func_array('array_merge_recursive', $settings['data']), TRUE));
|
|
295 |
array_unshift($commands, ajax_command_settings(drupal_array_merge_deep_array($settings['data']), TRUE));
|
|
296 | 296 |
} |
297 | 297 |
|
298 | 298 |
// Allow modules to alter any Ajax response. |
... | ... | |
1257 | 1257 |
'new' => $form['#build_id'], |
1258 | 1258 |
); |
1259 | 1259 |
} |
1260 |
|
|
1261 |
/** |
|
1262 |
* Creates a Drupal Ajax 'add_css' command. |
|
1263 |
* |
|
1264 |
* This method will add css via ajax in a cross-browser compatible way. |
|
1265 |
* |
|
1266 |
* This command is implemented by Drupal.ajax.prototype.commands.add_css() |
|
1267 |
* defined in misc/ajax.js. |
|
1268 |
* |
|
1269 |
* @param $styles |
|
1270 |
* A string that contains the styles to be added. |
|
1271 |
* |
|
1272 |
* @return |
|
1273 |
* An array suitable for use with the ajax_render() function. |
|
1274 |
* |
|
1275 |
* @see misc/ajax.js |
|
1276 |
*/ |
|
1277 |
function ajax_command_add_css($styles) { |
|
1278 |
return array( |
|
1279 |
'command' => 'add_css', |
|
1280 |
'data' => $styles, |
|
1281 |
); |
|
1282 |
} |
Formats disponibles : Unified diff
Udpate to 7.33