Ejemplo n.º 1
0
 /**
  * Export the given HTML to PDF, using a global template
  *
  * @uses export/table_pdf.tpl
  * @param $content
  * @param bool|false $saveToFile
  * @param bool|false $returnHtml
  *
  * @return string
  */
 public function html_to_pdf_with_template($content, $saveToFile = false, $returnHtml = false)
 {
     global $_configuration;
     Display::display_no_header();
     // Assignments
     Display::$global_template->assign('pdf_content', $content);
     $organization = api_get_setting('Institution');
     $img = api_get_path(SYS_CSS_PATH) . 'themes/' . api_get_visual_theme() . '/images/header-logo.png';
     // Search for classic logo
     if (file_exists($img)) {
         $img = api_get_path(WEB_CSS_PATH) . 'themes/' . api_get_visual_theme() . '/images/header-logo.png';
         $organization = "<img src='{$img}'>";
     } else {
         // Just use the platform title.
         if (!empty($organization)) {
             $organization = '<h2 align="left">' . $organization . '</h2>';
         }
     }
     // Use custom logo image.
     $pdfLogo = api_get_setting('pdf_logo_header');
     if ($pdfLogo === 'true') {
         $visualTheme = api_get_visual_theme();
         $img = api_get_path(SYS_CSS_PATH) . 'themes/' . $visualTheme . '/images/pdf_logo_header.png';
         if (file_exists($img)) {
             $img = api_get_path(WEB_CSS_PATH) . 'themes/' . $visualTheme . '/images/pdf_logo_header.png';
             $organization = "<img src='{$img}'>";
         }
     }
     Display::$global_template->assign('organization', $organization);
     //Showing only the current teacher/admin instead the all teacher list name see BT#4080
     if (isset($this->params['show_real_course_teachers']) && $this->params['show_real_course_teachers']) {
         if (isset($this->params['session_info']) && !empty($this->params['session_info'])) {
             $teacher_list = SessionManager::getCoachesByCourseSessionToString($this->params['session_info']['id'], $this->params['course_info']['real_id']);
         } else {
             $teacher_list = CourseManager::get_teacher_list_from_course_code_to_string($this->params['course_code']);
         }
     } else {
         $user_info = api_get_user_info();
         $teacher_list = $user_info['complete_name'];
     }
     Display::$global_template->assign('pdf_course', $this->params['course_code']);
     Display::$global_template->assign('pdf_course_info', $this->params['course_info']);
     Display::$global_template->assign('pdf_session_info', $this->params['session_info']);
     Display::$global_template->assign('pdf_date', api_format_date(api_get_local_time(), DATE_TIME_FORMAT_LONG));
     Display::$global_template->assign('pdf_teachers', $teacher_list);
     Display::$global_template->assign('pdf_title', $this->params['pdf_title']);
     Display::$global_template->assign('pdf_student_info', $this->params['student_info']);
     Display::$global_template->assign('show_grade_generated_date', $this->params['show_grade_generated_date']);
     Display::$global_template->assign('add_signatures', $this->params['add_signatures']);
     // Getting template
     $tpl = Display::$global_template->get_template('export/table_pdf.tpl');
     $html = Display::$global_template->fetch($tpl);
     $html = api_utf8_encode($html);
     $css_file = api_get_path(TO_SYS, WEB_CSS_PATH) . '/print.css';
     $css = file_exists($css_file) ? @file_get_contents($css_file) : '';
     $html = self::content_to_pdf($html, $css, $this->params['filename'], $this->params['course_code'], 'D', $saveToFile, null, $returnHtml);
     if ($returnHtml) {
         return $html;
     }
 }
Ejemplo n.º 2
0
 /**
  * Return the HTML code required to run editor.
  *
  * @return string
  */
 public function createHtmlStyle()
 {
     $style = '';
     if (trim($this->value) == '<html><head><title></title></head><body></body></html>') {
         $cssFile = api_get_path(SYS_CSS_PATH) . 'themes/' . api_get_visual_theme() . '/frames.css';
         if (!is_file($cssFile)) {
             $cssFile = api_get_path(WEB_CSS_PATH) . 'frames.css';
         } else {
             $cssFile = api_get_path(WEB_CSS_PATH) . 'themes/' . api_get_visual_theme() . '/frames.css';
         }
         $style = '<link href="' . $cssFile . '" rel="stylesheet" media="screen" type="text/css" />';
     }
     $html = '<textarea id="' . $this->getName() . '" name="' . $this->getName() . '" class="ckeditor">
              ' . $style . $this->value . '
              </textarea>';
     $html .= $this->editorReplace();
     return $html;
 }
Ejemplo n.º 3
0
 /**
  * Export the given HTML to PDF, using a global template
  * @param string the HTML content
  * @uses export/table_pdf.tpl
  */
 function html_to_pdf_with_template($content)
 {
     Display::display_no_header();
     //Assignments
     Display::$global_template->assign('pdf_content', $content);
     $organization = api_get_setting('Institution');
     $img = api_get_path(SYS_CODE_PATH) . 'css/' . api_get_visual_theme() . '/images/header-logo.png';
     if (file_exists($img)) {
         $img = api_get_path(WEB_CODE_PATH) . 'css/' . api_get_visual_theme() . '/images/header-logo.png';
         $organization = "<img src='{$img}'>";
     } else {
         if (!empty($organization)) {
             $organization = '<h2 align="left">' . $organization . '</h2>';
         }
     }
     Display::$global_template->assign('organization', $organization);
     //Showing only the current teacher/admin instead the all teacherlist name see BT#4080
     $user_info = api_get_user_info();
     $teacher_list = $user_info['complete_name'];
     $session_name = api_get_session_name(api_get_session_id());
     if (!empty($session_name)) {
         Display::$global_template->assign('pdf_session', $session_name);
     }
     Display::$global_template->assign('pdf_course', $this->params['course_code']);
     Display::$global_template->assign('pdf_date', api_format_date(api_get_utc_datetime(), DATE_TIME_FORMAT_LONG));
     Display::$global_template->assign('pdf_teachers', $teacher_list);
     Display::$global_template->assign('pdf_title', $this->params['pdf_title']);
     Display::$global_template->assign('add_signatures', $this->params['add_signatures']);
     //Getting template
     $tpl = Display::$global_template->get_template('export/table_pdf.tpl');
     $html = Display::$global_template->fetch($tpl);
     $html = api_utf8_encode($html);
     $css_file = api_get_path(TO_SYS, WEB_CSS_PATH) . '/print.css';
     $css = file_exists($css_file) ? @file_get_contents($css_file) : '';
     self::content_to_pdf($html, $css, $this->params['filename'], $this->params['course_code']);
 }
Ejemplo n.º 4
0
    /**
     * 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);
    }
Ejemplo n.º 5
0
 /**
  *  Here we count 1 Kilobyte = 1024 Bytes, 1 Megabyte = 1048576 Bytes
  */
 static function display_quota($course_quota, $already_consumed_space)
 {
     $course_quota_m = round($course_quota / 1048576);
     $already_consumed_space_m = round($already_consumed_space / 1048576);
     $message = get_lang('MaximumAllowedQuota') . ' <strong>' . $course_quota_m . ' megabyte</strong>.<br />';
     $message .= get_lang('CourseCurrentlyUses') . ' <strong>' . $already_consumed_space_m . ' megabyte</strong>.<br />';
     $percentage = round($already_consumed_space / $course_quota * 100, 1);
     $other_percentage = $percentage < 100 ? 100 - $percentage : 0;
     // Decide where to place percentage in graph
     if ($percentage >= 50) {
         $text_in_filled = '&nbsp;' . $other_percentage . '%';
         $text_in_unfilled = '';
     } else {
         $text_in_unfilled = '&nbsp;' . $other_percentage . '%';
         $text_in_filled = '';
     }
     // Decide the background colour of the graph
     if ($percentage < 65) {
         $colour = '#00BB00';
         // Safe - green
     } elseif ($percentage < 90) {
         $colour = '#ffd400';
         // Filling up - yelloworange
     } else {
         $colour = '#DD0000';
         // Full - red
     }
     // This is used for the table width: a table of only 100 pixels looks too small
     $visual_percentage = 4 * $percentage;
     $visual_other_percentage = 4 * $other_percentage;
     $message .= get_lang('PercentageQuotaInUse') . ': <strong>' . $percentage . '%</strong>.<br />' . get_lang('PercentageQuotaFree') . ': <strong>' . $other_percentage . '%</strong>.<br />';
     $show_percentage = '&nbsp;' . $percentage . '%';
     $message .= '<div style="width: 80%; text-align: center; -moz-border-radius: 5px 5px 5px 5px; border: 1px solid #aaa; background-image: url(\'' . api_get_path(WEB_CODE_PATH) . 'css/' . api_get_visual_theme() . '/images/bg-header4.png\');" class="document-quota-bar">' . '<div style="width:' . $percentage . '%; background-color: #bbb; border-right:3px groove #bbb; -moz-border-radius:5px;">&nbsp;</div>' . '<span style="margin-top: -15px; margin-left:-15px; position: absolute;font-weight:bold;">' . $show_percentage . '</span></div>';
     echo $message;
 }
Ejemplo n.º 6
0
 /**
  * Set theme, include mainstream CSS files
  * @return void
  * @see setCssCustomFiles() for additional CSS sheets
  */
 public function setCssFiles()
 {
     global $disable_js_and_css_files;
     $css = array();
     $this->theme = api_get_visual_theme();
     if (!empty($this->preview_theme)) {
         $this->theme = $this->preview_theme;
     }
     // Default CSS Bootstrap
     $bowerCSSFiles = ['bootstrap-daterangepicker/daterangepicker-bs3.css', 'fontawesome/css/font-awesome.min.css', 'jquery-ui/themes/smoothness/theme.css', 'jquery-ui/themes/smoothness/jquery-ui.min.css', 'mediaelement/build/mediaelementplayer.min.css', 'jqueryui-timepicker-addon/dist/jquery-ui-timepicker-addon.min.css', 'bootstrap/dist/css/bootstrap.min.css', 'jquery.scrollbar/jquery.scrollbar.css'];
     foreach ($bowerCSSFiles as $file) {
         $css[] = api_get_path(WEB_PATH) . 'web/assets/' . $file;
     }
     $css[] = api_get_path(WEB_LIBRARY_PATH) . 'javascript/bootstrap-select/css/bootstrap-select.min.css';
     $css[] = api_get_path(WEB_LIBRARY_PATH) . 'javascript/chosen/chosen.css';
     $css[] = api_get_path(WEB_LIBRARY_PATH) . 'javascript/tag/style.css';
     if (api_is_global_chat_enabled()) {
         $css[] = api_get_path(WEB_LIBRARY_PATH) . 'javascript/chat/css/chat.css';
     }
     //THEME CSS STYLE
     // $css[] = api_get_cdn_path(api_get_path(WEB_CSS_PATH).'responsive.css');
     $css_file_to_string = null;
     foreach ($css as $file) {
         $css_file_to_string .= api_get_css($file);
     }
     if (!$disable_js_and_css_files) {
         $this->assign('css_static_file_to_string', $css_file_to_string);
     }
 }
Ejemplo n.º 7
0
$navigation_bar = '';
$display_mode = '';
$autostart = 'true';
if (isset($_SESSION['lpobject'])) {
    //if($debug>0) //error_log('New LP - in lp_nav.php - SESSION[lpobject] is defined',0);
    $oLP = unserialize($_SESSION['lpobject']);
    if (is_object($oLP)) {
        $_SESSION['oLP'] = $oLP;
    } else {
        //error_log('New LP - in lp_nav.php - SESSION[lpobject] is not object - dying',0);
        die('Could not instanciate lp object');
    }
    $display_mode = $_SESSION['oLP']->mode;
    $scorm_css_header = true;
    $lp_theme_css = $_SESSION['oLP']->get_theme();
    $my_style = api_get_visual_theme();
    //Setting up the CSS theme if exists
    $mycourselptheme = null;
    if (api_get_setting('allow_course_theme') == 'true') {
        $mycourselptheme = api_get_course_setting('allow_learning_path_theme');
    }
    if (!empty($lp_theme_css) && !empty($mycourselptheme) && $mycourselptheme != -1 && $mycourselptheme == 1) {
        global $lp_theme_css;
    } else {
        $lp_theme_css = $my_style;
    }
    $progress_bar = $_SESSION['oLP']->get_progress_bar('', -1, '', true);
    $navigation_bar = $_SESSION['oLP']->get_navigation_bar();
    $mediaplayer = $_SESSION['oLP']->get_mediaplayer($autostart);
}
session_write_close();
Ejemplo n.º 8
0
//get all svg and png files
$accepted_extensions = array('.svg', '.png');
if (is_array($all_files) && count($all_files) > 0) {
    foreach ($all_files as &$file) {
        $slideshow_extension = strrchr($file, '.');
        $slideshow_extension = strtolower($slideshow_extension);
        if (in_array($slideshow_extension, $accepted_extensions)) {
            $png_svg_files[] = $file;
        }
    }
}
$disk_path = api_get_path(SYS_COURSE_PATH) . $course_info['path'] . '/document/images/gallery/';
$web_path = api_get_path(WEB_COURSE_PATH) . $course_info['path'] . '/document/images/gallery/';
$style = '<style>';
$style .= '@import "' . api_get_path(WEB_CSS_PATH) . 'base.css";';
$style .= '@import "' . api_get_path(WEB_CSS_PATH) . api_get_visual_theme() . '/default.css";';
$style .= '</style>';
?>
<!doctype html>
<?php 
echo api_get_js('jquery.js');
echo $style;
?>
<body>
<?php 
echo '<h2>' . get_lang('Course') . ': ' . $course_info['name'] . '</h2>';
if (!empty($png_svg_files)) {
    echo '<h3>' . get_lang('SelectSVGEditImage') . '</h3>';
    echo '<ul>';
    foreach ($png_svg_files as $filename) {
        $image = $disk_path . $filename;
Ejemplo n.º 9
0
 /**
  * This public function returns the htmlcode for an icon
  *
  * @param string   The filename of the file (in the main/img/ folder
  * @param string   The alt text (probably a language variable)
  * @param array    Additional attributes (for instance height, width, onclick, ...)
  * @param integer  The wanted width of the icon (to be looked for in the corresponding img/icons/ folder)
  * @return string  An HTML string of the right <img> tag
  *
  * @author Patrick Cool <*****@*****.**>, Ghent University 2006
  * @author Julio Montoya 2010 Function improved, adding image constants
  * @author Yannick Warnier 2011 Added size handler
  * @version Feb 2011
  */
 public static function return_icon($image, $alt_text = '', $additional_attributes = array(), $size = ICON_SIZE_SMALL, $show_text = true, $return_only_path = false)
 {
     $code_path = api_get_path(SYS_CODE_PATH);
     $w_code_path = api_get_path(WEB_CODE_PATH);
     $image = trim($image);
     $theme = 'css/' . api_get_visual_theme() . '/icons/';
     $icon = '';
     $size_extra = '';
     if (isset($size)) {
         $size = intval($size);
         $size_extra = $size . '/';
     } else {
         $size = ICON_SIZE_SMALL;
     }
     //Checking the theme icons folder example: main/css/chamilo/icons/XXX
     if (is_file($code_path . $theme . $size_extra . $image)) {
         $icon = $w_code_path . $theme . $size_extra . $image;
     } elseif (is_file($code_path . 'img/icons/' . $size_extra . $image)) {
         //Checking the main/img/icons/XXX/ folder
         $icon = $w_code_path . 'img/icons/' . $size_extra . $image;
     } else {
         //Checking the img/ folder
         $icon = $w_code_path . 'img/' . $image;
     }
     $icon = api_get_cdn_path($icon);
     if ($return_only_path) {
         return $icon;
     }
     $img = self::img($icon, $alt_text, $additional_attributes);
     if (SHOW_TEXT_NEAR_ICONS == true and !empty($alt_text)) {
         if ($show_text) {
             $img = "{$img} {$alt_text}";
         }
     }
     return $img;
 }
Ejemplo n.º 10
0
 /**
  * This public function returns the htmlcode for an icon
  *
  * @param string   The filename of the file (in the main/img/ folder
  * @param string   The alt text (probably a language variable)
  * @param array    Additional attributes (for instance height, width, onclick, ...)
  * @param integer  The wanted width of the icon (to be looked for in the corresponding img/icons/ folder)
  * @return string  An HTML string of the right <img> tag
  *
  * @author Patrick Cool <*****@*****.**>, Ghent University 2006
  * @author Julio Montoya 2010 Function improved, adding image constants
  * @author Yannick Warnier 2011 Added size handler
  * @version Feb 2011
  */
 public static function return_icon($image, $alt_text = '', $additional_attributes = array(), $size = ICON_SIZE_SMALL, $show_text = true, $return_only_path = false)
 {
     $code_path = api_get_path(SYS_IMG_PATH);
     $w_code_path = api_get_path(WEB_CODE_PATH);
     $alternateCssPath = api_get_path(SYS_CSS_PATH);
     $alternateWebCssPath = api_get_path(WEB_CSS_PATH);
     $image = trim($image);
     $theme = 'themes/' . api_get_visual_theme() . '/icons/';
     $size_extra = '';
     if (isset($size)) {
         $size = intval($size);
         $size_extra = $size . '/';
     } else {
         $size = ICON_SIZE_SMALL;
     }
     //Checking the theme icons folder example: app/Resources/public/css/themes/chamilo/icons/XXX
     if (is_file($alternateCssPath . $theme . $size_extra . $image)) {
         $icon = $theme . $size_extra . $image;
     } elseif (is_file($code_path . 'icons/' . $size_extra . $image)) {
         //Checking the main/img/icons/XXX/ folder
         $icon = 'icons/' . $size_extra . $image;
     } else {
         //Checking the img/ folder
         $icon = $image;
     }
     // Special code to enable SVG - refs #7359 - Needs more work
     // The code below does something else to "test out" SVG: for each icon,
     // it checks if there is an SVG version. If so, it uses it.
     // When moving this to production, the return_icon() calls should
     // ask for the SVG version directly
     $testServer = api_get_setting('server_type');
     /*if ($testServer == 'test' && $return_only_path == false) {
                 $svgImage = substr($image, 0, -3) . 'svg';
                 if (is_file($code_path . $theme . 'svg/' . $svgImage)) {
                     $icon = $w_code_path . $theme . 'svg/' . $svgImage;
                 } elseif (is_file($code_path . 'img/icons/svg/' . $svgImage)) {
                     $icon = $w_code_path . 'img/icons/svg/' . $svgImage;
                 }
     
                 if (empty($additional_attributes['height'])) {
                     $additional_attributes['height'] = $size;
                 }
                 if (empty($additional_attributes['width'])) {
                     $additional_attributes['width'] = $size;
                 }
             }*/
     $icon = 'bundles/chamilocore/img/' . $icon;
     $icon = Container::getAsset()->getUrl($icon);
     //$icon = api_get_cdn_path($icon);
     if ($return_only_path) {
         return $icon;
     }
     $img = self::img($icon, $alt_text, $additional_attributes);
     if (SHOW_TEXT_NEAR_ICONS == true and !empty($alt_text)) {
         if ($show_text) {
             $img = "{$img} {$alt_text}";
         }
     }
     return $img;
 }
Ejemplo n.º 11
0
}

// Managing the $encryptPassForm
if ($encryptPassForm == '1') {
	$encryptPassForm = 'sha1';
} elseif ($encryptPassForm == '0') {
	$encryptPassForm = 'none';
}
?>
<!DOCTYPE html>
<head>
	<title>&mdash; <?php echo get_lang('ChamiloInstallation').' &mdash; '.get_lang('Version_').' '.$new_version; ?></title>
	<style type="text/css" media="screen, projection">
		/*<![CDATA[*/
		@import "../css/base.css";
		@import "../css/<?php echo api_get_visual_theme(); ?>/default.css";
		/*]]>*/
	</style>
	<script type="text/javascript" src="../inc/lib/javascript/jquery.min.js"></script>
	<script type="text/javascript" >
		$(document).ready( function() {

            $("#button_please_wait").hide();

			 //checked
			if ($('#singleDb1').attr('checked')==false) {
					//$('#dbStatsForm').removeAttr('disabled');
					//$('#dbUserForm').removeAttr('disabled');
					$('#dbStatsForm').attr('value','chamilo_main');
				    $('#dbUserForm').attr('value','chamilo_main');
			} else if($('#singleDb1').attr('checked')==true){
Ejemplo n.º 12
0
 /**
  * Set theme, include CSS files
  */
 private function setCssFiles()
 {
     $css = array();
     $this->theme = api_get_visual_theme();
     if (isset($_POST['style']) && api_is_platform_admin()) {
         $this->preview_theme = $_POST['style'];
     }
     if (!empty($this->preview_theme)) {
         $this->theme = $this->preview_theme;
     }
     $this->app['theme'] = $this->theme;
     $cssPath = api_get_path(WEB_CSS_PATH);
     $webLibraryPath = api_get_path(WEB_LIBRARY_JS_PATH);
     // Loads only 1 css file
     if ($this->app['assetic.enabled']) {
         $css[] = $cssPath . 'themes/' . $this->theme . '/style.css';
     } else {
         // Bootstrap
         //api_get_path(WEB_LIBRARY_JS_PATH).
         $css[] = $webLibraryPath . 'bootstrap/css/bootstrap.css';
         // Base CSS.
         $css[] = $cssPath . 'base.css';
         // Extra CSS files.
         if ($this->show_learnpath) {
             //$css[] = $cssPath.$this->theme.'/learnpath.css';
             //$css[] = $cssPath.$this->theme.'/scorm.css';
         }
         if (api_is_global_chat_enabled()) {
             $css[] = $webLibraryPath . 'chat/css/chat.css';
         }
         $css[] = $webLibraryPath . 'jquery-ui/css/' . $this->jquery_ui_theme . '/jquery-ui-custom.css';
     }
     $css[] = $webLibraryPath . 'font-awesome/css/font-awesome.css';
     $css[] = $webLibraryPath . 'thickbox.css';
     $css[] = $webLibraryPath . 'pace/pace.css';
     $css[] = $webLibraryPath . 'chosen/chosen.css';
     $css[] = $webLibraryPath . 'tag/style.css';
     // Default theme CSS.
     $css[] = api_get_cdn_path($cssPath . 'themes/' . $this->theme . '/default.css');
     $this->addResource($css, 'css');
     if (!$this->disableJsAndCss) {
         $style = api_get_css(api_get_cdn_path($cssPath . 'themes/' . $this->theme . '/print.css'), 'print');
         $this->addResource($style, 'no_js_css');
     }
 }
Ejemplo n.º 13
0
 /**
  * Set theme, include CSS files
  */
 private function setCssFiles()
 {
     global $disable_js_and_css_files;
     $css = array();
     $this->theme = api_get_visual_theme();
     if (isset($_POST['style']) && api_is_platform_admin()) {
         $this->preview_theme = $_POST['style'];
     }
     if (!empty($this->preview_theme)) {
         $this->theme = $this->preview_theme;
     }
     $this->app['theme'] = $this->theme;
     $cssPath = api_get_path(WEB_CSS_PATH);
     // Loads only 1 css file
     if ($this->app['assetic.enabled']) {
         $css[] = api_get_path(WEB_PUBLIC_PATH) . 'css/' . $this->theme . '/style.css';
     } else {
         // Bootstrap
         $css[] = api_get_cdn_path(api_get_path(WEB_LIBRARY_PATH) . 'javascript/bootstrap/css/bootstrap.css');
         //$css[] = api_get_cdn_path(api_get_path(WEB_LIBRARY_PATH).'javascript/bootstrap/css/bootstrap-theme.css');
         // Base CSS.
         $css[] = api_get_cdn_path($cssPath . 'base.css');
         // Default theme CSS.
         $css[] = api_get_cdn_path($cssPath . $this->theme . '/default.css');
         // Extra CSS files.
         if ($this->show_learnpath) {
             //$css[] = $cssPath.$this->theme.'/learnpath.css';
             //$css[] = $cssPath.$this->theme.'/scorm.css';
         }
         if (api_is_global_chat_enabled()) {
             $css[] = api_get_path(WEB_LIBRARY_PATH) . 'javascript/chat/css/chat.css';
         }
         $css[] = api_get_path(WEB_LIBRARY_PATH) . 'javascript/jquery-ui/css/' . $this->jquery_ui_theme . '/jquery-ui-custom.css';
         //$css[] = api_get_path(WEB_LIBRARY_PATH).'javascript/jquery-ui/default.css';
     }
     $css[] = api_get_path(WEB_LIBRARY_PATH) . 'javascript/font-awesome/css/font-awesome.css';
     $css[] = api_get_path(WEB_LIBRARY_PATH) . 'javascript/thickbox.css';
     $css[] = api_get_path(WEB_LIBRARY_PATH) . 'javascript/chosen/chosen.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($cssPath . $this->theme . '/print.css'), 'print');
         $this->assign('css_style_print', $style_print);
     }
 }