summaryrefslogtreecommitdiff
path: root/includes/common.inc
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-03-21 21:14:30 +0000
committerDries Buytaert <dries@buytaert.net>2010-03-21 21:14:30 +0000
commit9b8c393d4ef0883d8e1bb0d2c7059c52a8ad4fe1 (patch)
treec97be697fd0d1a47979f9621f458f0b70bc4501a /includes/common.inc
parentff5194c862c796e47e06e0cb45451d6d2710eeaf (diff)
downloadbrdo-9b8c393d4ef0883d8e1bb0d2c7059c52a8ad4fe1.tar.gz
brdo-9b8c393d4ef0883d8e1bb0d2c7059c52a8ad4fe1.tar.bz2
- Patch #443514 by casey, sun: stylesheet override logic prevents loading of stylesheets of third-party libraries.
Diffstat (limited to 'includes/common.inc')
-rw-r--r--includes/common.inc9
1 files changed, 8 insertions, 1 deletions
diff --git a/includes/common.inc b/includes/common.inc
index 373eb645d..6751321b4 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -2635,6 +2635,12 @@ function drupal_add_html_head_link($attributes, $header = FALSE) {
* have any or all of the following keys:
* - 'type': The type of stylesheet being added. Available options are 'file',
* 'inline' or 'external'. Defaults to 'file'.
+ * - 'basename': Force a basename for the file being added. Modules are
+ * expected to use stylesheets with unique filenames, but integration of
+ * external libraries may make this impossible. The basename of
+ * 'modules/node/node.css' is 'node.css'. If the external library "node.js"
+ * ships with a 'node.css', then a different, unique basename would be
+ * 'node.js.css'.
* - 'weight': The weight of the stylesheet specifies the order in which the
* CSS will appear when presented on the page. Available constants are:
* - CSS_SYSTEM: Any system-layer CSS.
@@ -2742,7 +2748,8 @@ function drupal_get_css($css = NULL) {
$previous_item = array();
foreach ($css as $key => $item) {
if ($item['type'] == 'file') {
- $basename = basename($item['data']);
+ // If defined, force a unique basename for this file.
+ $basename = isset($item['basename']) ? $item['basename'] : basename($item['data']);
if (isset($previous_item[$basename])) {
// Remove the previous item that shared the same base name.
unset($css[$previous_item[$basename]]);