Exemple #1
0
 /**
  * Add one or more components to the page. Output the <script> and/or <style> immediately
  * @param string $names comma separated list of components
  *
  */
 static function GetComponents($names = '')
 {
     includeFile('combine.php');
     $scripts = gp_combine::ScriptInfo($names);
     gpOutput::CombineFiles($scripts['css'], 'css', false);
     gpOutput::CombineFiles($scripts['js'], 'js', false);
 }
Exemple #2
0
 /**
  * Prepare and output the css for the current page
  * @static
  */
 function GetHead_CSS()
 {
     global $page, $config;
     $css_files = array();
     if (isset($_COOKIE[gp_session_cookie])) {
         $css_files[] = '/include/css/additional.css';
     }
     if (isset($page->css_user) && is_array($page->css_user)) {
         $css_files = array_merge($css_files, $page->css_user);
     }
     //after other styles, so themes can overwrite defaults
     $theme_stylesheet = false;
     if (!empty($page->theme_name) && $page->get_theme_css === true) {
         $css_files[] = $theme_stylesheet = rawurldecode($page->theme_path) . '/style.css';
     }
     //layout css
     if (isset($page->layout_css) && $page->layout_css) {
         $css_files[] = '/data/_layouts/' . $page->gpLayout . '/custom.css';
     }
     //important admin css that shouldn't be overwritten by themes
     if (common::LoggedIn()) {
         $css_files[] = '/include/css/admin.css';
     }
     //styles that need to override admin.css should be added to $page->css_admin;
     if (isset($page->css_admin) && is_array($page->css_admin)) {
         $css_files = array_merge($css_files, $page->css_admin);
     }
     gpOutput::CombineFiles($css_files, 'css', $config['combinecss'], $theme_stylesheet);
 }