Added functions for custom css files registered by modules
[fa-stable.git] / includes / page / header.inc
index 9f785f4b3d93f02a81b0aca617a5cccc9f53c19c..ec80dc160973052d407325a37d60e7e951cc453c 100644 (file)
@@ -45,6 +45,22 @@ function help_url($context=null)
                .'&ctxhelp=1&lang='.$country, ENT_QUOTES);
 }
 
+function send_css($css = '')
+{
+       global $css_files;
+
+       css_files_ensure_init();
+
+       foreach ($css_files as $css_file)
+       {
+               echo "<link href='$css_file' rel='stylesheet' type='text/css'> \n";
+       }
+       if ($css)
+       {
+               echo "<link href='$css' rel='stylesheet' type='text/css'> \n";
+       }
+}
+
 function send_scripts()
 {
     global $SysPrefs, $path_to_root, $js_static, $js_path, $js_userlib;
@@ -78,11 +94,6 @@ function page_header($title, $no_menu=false, $is_index=false, $onload="", $js=""
        if (in_ajax())
                return; // just for speed up
 
-//     $jsext = substr_replace($_SERVER['PHP_SELF'], '.js', -4);
-
-//     if (file_exists($_SERVER['DOCUMENT_ROOT'].$jsext))
-//             add_js_ufile($jsext);
-
        $theme = user_theme();
 
        if ($SysPrefs->help_base_url != null && $SysPrefs->use_popup_windows && $js == '')
@@ -94,7 +105,7 @@ function page_header($title, $no_menu=false, $is_index=false, $onload="", $js=""
                add_js_source(get_js_open_window(900, 500));
        }
        if ($js!='')
-         add_js_source($js);
+               add_js_source($js);
 
        if (!isset($no_menu))
        {
@@ -127,11 +138,12 @@ function page_header($title, $no_menu=false, $is_index=false, $onload="", $js=""
        echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n";
        echo "<html dir='" . $_SESSION['language']->dir . "' >\n";
        echo "<head profile=\"http://www.w3.org/2005/10/profile\"><title>$title</title>";
+       if (strpos($_SERVER['HTTP_USER_AGENT'], 'Trident/7.0; rv:11.0') != -1) // IE 11 doesn't work with input file type in form.
+               echo "<meta http-equiv='X-UA-Compatible' content='IE=10'>\n";
        echo "<meta http-equiv='Content-type' content='text/html; charset=$encoding'>";
-       echo "<link href='$path_to_root/themes/$theme/default.css' rel='stylesheet' type='text/css'> \n";
-       echo "<link href='$path_to_root/themes/default/images/favicon.ico' rel='icon' type='image/x-icon'> \n";
-       if ($css)
-               echo '<link href="'.$css.'" rel="stylesheet" type="text/css">';
+       echo "<link href='$path_to_root/themes/default/images/favicon.ico' rel='icon' type='image/x-icon'> \n";
+
+       send_css($css);
 
        send_scripts();