/** * Set theme, include CSS files */ public function set_css_files() { global $disable_js_and_css_files; $css = array(); $this->theme = api_get_visual_theme(); if (!empty($this->preview_theme)) { $this->theme = $this->preview_theme; } //Base CSS $css[] = api_get_cdn_path(api_get_path(WEB_CSS_PATH).'base.css'); //Default CSS responsive design $css[] = api_get_cdn_path(api_get_path(WEB_CSS_PATH).'bootstrap-responsive.css'); //Extra CSS files $css[] = api_get_path(WEB_LIBRARY_PATH).'javascript/thickbox.css'; $css[] = api_get_path(WEB_LIBRARY_PATH).'javascript/chosen/chosen.css'; if (api_is_global_chat_enabled()) { $css[] = api_get_path(WEB_LIBRARY_PATH).'javascript/chat/css/chat.css'; } $css[] = api_get_path(WEB_CSS_PATH).'font_awesome/css/font-awesome.css'; $css[] = api_get_path(WEB_LIBRARY_PATH).'javascript/mediaelement/mediaelementplayer.css'; //THEME CSS STYLE $css[] = api_get_cdn_path(api_get_path(WEB_CSS_PATH).'responsive.css'); $css[] = api_get_cdn_path(api_get_path(WEB_CSS_PATH).$this->theme.'/default.css'); if ($this->show_learnpath) { $css[] = api_get_path(WEB_CSS_PATH).$this->theme.'/learnpath.css'; // if we have a SCORM file in theme, don't use default_scorm.css file if (is_file(api_get_path(SYS_CSS_PATH).$this->theme.'/scorm.css')) { $css[] = api_get_path(WEB_CSS_PATH).$this->theme.'/scorm.css'; } else { $css[] = api_get_cdn_path(api_get_path(WEB_CSS_PATH).'default_scorm.css'); } } $css_file_to_string = null; foreach ($css as $file) { $css_file_to_string .= api_get_css($file); } // @todo move this somewhere else. Special fix when using tablets in order to see the text near icons if (SHOW_TEXT_NEAR_ICONS == true) { //hack in order to fix the actions buttons $css_file_to_string .= '<style> .td_actions a { float:left; width:100%; } .forum_message_left a { float:left; width:100%; } </style>'; } $navigator_info = api_get_navigator(); if ($navigator_info['name'] == 'Internet Explorer' && $navigator_info['version'] == '6') { $css_file_to_string .= 'img, div { behavior: url('.api_get_path(WEB_LIBRARY_PATH).'javascript/iepngfix/iepngfix.htc) } '."\n"; } if (!$disable_js_and_css_files) { $this->assign('css_file_to_string', $css_file_to_string); $style_print = api_get_css(api_get_cdn_path(api_get_path(WEB_CSS_PATH).$this->theme.'/print.css'), 'print'); $this->assign('css_style_print', $style_print); } // Logo $logo = return_logo($this->theme); $this->assign('logo', $logo); }
/** * Prepare custom CSS to be added at the very end of the <head> section * @return void * @see setCssFiles() for the mainstream CSS files */ public function setCssCustomFiles() { global $disable_js_and_css_files; // Base CSS $css[] = api_get_cdn_path(api_get_path(WEB_CSS_PATH) . 'base.css'); if ($this->show_learnpath) { $css[] = api_get_cdn_path(api_get_path(WEB_CSS_PATH) . 'scorm.css'); if (is_file(api_get_path(SYS_CSS_PATH) . 'themes/' . $this->theme . '/learnpath.css')) { $css[] = api_get_path(WEB_CSS_PATH) . 'themes/' . $this->theme . '/learnpath.css'; } } $css[] = api_get_cdn_path(api_get_path(WEB_CSS_PATH) . 'themes/' . $this->theme . '/default.css'); $css_file_to_string = null; foreach ($css as $file) { $css_file_to_string .= api_get_css($file); } // @todo move this somewhere else. Special fix when using tablets in order to see the text near icons if (SHOW_TEXT_NEAR_ICONS == true) { //hack in order to fix the actions buttons $css_file_to_string .= '<style> .td_actions a { float:left; width:100%; } .forum_message_left a { float:left; width:100%; } </style>'; } $navigator_info = api_get_navigator(); if ($navigator_info['name'] == 'Internet Explorer' && $navigator_info['version'] == '6') { $css_file_to_string .= 'img, div { behavior: url(' . api_get_path(WEB_LIBRARY_PATH) . 'javascript/iepngfix/iepngfix.htc) } ' . "\n"; } if (!$disable_js_and_css_files) { $this->assign('css_custom_file_to_string', $css_file_to_string); $style_print = ''; if (is_readable(api_get_path(SYS_CSS_PATH) . $this->theme . '/print.css')) { $style_print = api_get_css(api_get_cdn_path(api_get_path(WEB_CSS_PATH) . $this->theme . '/print.css'), 'print'); } $this->assign('css_style_print', $style_print); } // Logo $logo = return_logo($this->theme); $this->assign('logo', $logo); $this->assign('show_media_element', 1); }