| 1 |
<?php |
<?php |
| 2 |
// $Id: conditional_styles.theme.inc,v 1.3 2008/09/14 10:06:03 johnalbin Exp $ |
// $Id: conditional_styles.theme.inc,v 1.4 2008/09/14 23:26:47 johnalbin Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 39 |
// implementation: foreach ($array AS $key => &$value) {} |
// implementation: foreach ($array AS $key => &$value) {} |
| 40 |
|
|
| 41 |
// Process the conditional stylesheets for every active theme. |
// Process the conditional stylesheets for every active theme. |
| 42 |
|
global $language; |
| 43 |
$themes = list_themes(); |
$themes = list_themes(); |
| 44 |
foreach (array_keys($themes) AS $theme) { |
foreach (array_keys($themes) AS $theme) { |
| 45 |
// We only need to process active themes. |
// We only need to process active themes. |
| 75 |
// Don't allow non-existent stylesheets to clutter the logs with 404. |
// Don't allow non-existent stylesheets to clutter the logs with 404. |
| 76 |
if (file_exists("./$path/$file")) { |
if (file_exists("./$path/$file")) { |
| 77 |
$output .= "<link type=\"text/css\" rel=\"stylesheet\" media=\"$media\" href=\"$base_path$path/$file$query_string\" />\n"; |
$output .= "<link type=\"text/css\" rel=\"stylesheet\" media=\"$media\" href=\"$base_path$path/$file$query_string\" />\n"; |
| 78 |
|
if ($language->direction == LANGUAGE_RTL){ |
| 79 |
|
$file_rtl = str_replace('.css', '-rtl.css', $file); |
| 80 |
|
if (file_exists("./$path/$file_rtl")) { |
| 81 |
|
$output .= "<link type=\"text/css\" rel=\"stylesheet\" media=\"$media\" href=\"$base_path$path/$file_rtl$query_string\" />\n"; |
| 82 |
|
} |
| 83 |
|
} |
| 84 |
} |
} |
| 85 |
} |
} |
| 86 |
} |
} |