title = $title; /* * * Rain TPL raintpl::configure("base_url", null ); raintpl::configure("tpl_dir", api_get_path(SYS_CODE_PATH).'template/' ); raintpl::configure("cache_dir", api_get_path(SYS_ARCHIVE_PATH)); $this->tpl = new RainTPL(); */ // Dwoo //$this->dwoo = new Dwoo(api_get_path(SYS_ARCHIVE_PATH), api_get_path(SYS_ARCHIVE_PATH)); // Load a template file, this is reusable if you want to render multiple times the same template with different data //$tpl = new Dwoo_Template_File('path/to/index.tpl'); // Create a data set, this data set can be reused to render multiple templates if it contains enough data to fill them all //$this->tpl = new Dwoo_Data(); // Class Constructor. // These automatically get set with each new instance. $this->template_dir = api_get_path(SYS_CODE_PATH).'template/'; // '/web/www.example.com/guestbook/templates/'; $this->compile_dir = api_get_path(SYS_ARCHIVE_PATH); // '/web/www.example.com/guestbook/templates_c/'; $this->config_dir = api_get_path(SYS_ARCHIVE_PATH); // '/web/www.example.com/guestbook/configs/'; main/inc/conf/config? $this->cache_dir = api_get_path(SYS_ARCHIVE_PATH); // '/web/www.example.com/guestbook/cache/'; $this->caching = true; $this->cache_lifetime = Smarty::CACHING_OFF; // no caching //$this->cache_lifetime = 120; $this->set_header_parameters(); $this->set_footer_parameters(); //$this->caching = Smarty::CACHING_LIFETIME_CURRENT; $this->assign('style', $this->style); } function get_template($name) { return $this->style.'/'.$name; } public function set_header_parameters($help = null) { $nameTools = $this->title; global $_plugins, $lp_theme_css, $mycoursetheme, $user_theme, $platform_theme; global $httpHeadXtra, $htmlHeadXtra, $_course, $_user, $clarolineRepositoryWeb, $text_dir, $plugins, $_user, $rootAdminWeb, $_cid, $interbreadcrumb, $charset, $language_file, $noPHP_SELF; global $menu_navigation; global $_configuration, $show_learn_path; $this->assign('system_charset', api_get_system_encoding()); if (isset($httpHeadXtra) && $httpHeadXtra) { foreach ($httpHeadXtra as & $thisHttpHead) { header($thisHttpHead); } } // Get language iso-code for this page - ignore errors $this->assign('document_language', api_get_language_isocode()); $course_title = $_course['name']; $title_list[] = api_get_setting('Institution'); $title_list[] = api_get_setting('siteName'); if (!empty($course_title)) { $title_list[] = $course_title; } if ($nameTools != '') { $title_list[] = $nameTools; } $title_string = ''; for($i=0; $iassign('title_string', $title_string); $platform_theme = api_get_setting('stylesheets'); $my_style = api_get_visual_theme(); $style = ''; //Base CSS $style = '@import "'.api_get_path(WEB_CSS_PATH).'base.css";'; //Default CSS $style .= '@import "'.api_get_path(WEB_CSS_PATH).$my_style.'/default.css";'; //Course CSS $style .= '@import "'.api_get_path(WEB_CSS_PATH).$my_style.'/course.css";'; if ($navigator_info['name']=='Internet Explorer' && $navigator_info['version']=='6') { $style .= 'img, div { behavior: url('.api_get_path(WEB_LIBRARY_PATH).'javascript/iepngfix/iepngfix.htc) } '; } $this->assign('css_style', $style); $style_print = '@import "'.api_get_path(WEB_CSS_PATH).$my_style.'/print.css";'; $this->assign('css_style_print', $style_print); $js_files = array( 'jquery.min.js', 'chosen/chosen.jquery.min.js', 'thickbox.js', 'jquery.menu.js', 'dtree/dtree.js', 'email_links.lib.js.php', ); if (api_get_setting('accessibility_font_resize') == 'true') { $js_files[] = 'fontresize.js'; } if (api_get_setting('include_asciimathml_script') == 'true') { $js_files[] = 'asciimath/ASCIIMathML.js'; } $js_file_to_string = ''; foreach($js_files as $js_file) { $js_file_to_string .= api_get_js($js_file); } $css_files = array ( api_get_path(WEB_LIBRARY_PATH).'javascript/thickbox.css', api_get_path(WEB_LIBRARY_PATH).'javascript/chosen/chosen.css', api_get_path(WEB_LIBRARY_PATH).'javascript/dtree/dtree.css', ); if ($show_learn_path) { $css_files[] = api_get_path(WEB_CSS_PATH).$my_style.'/learnpath.css'; } $css_file_to_string = ''; foreach($css_files as $css_file) { $css_file_to_string .= api_get_css($css_file); } $this->assign('css_file_to_string', $css_file_to_string); $this->assign('js_file_to_string', $js_file_to_string); $this->assign('text_direction', api_get_text_direction()); //@todo add this /* */ $this->assign('style_print', $style_print); $extra_headers = ''; if (isset($htmlHeadXtra) && $htmlHeadXtra) { foreach ($htmlHeadXtra as & $this_html_head) { $extra_headers .= $this_html_head; } } $this->assign('extra_headers', $extra_headers); $favico = ''; if (isset($_configuration['multiple_access_urls']) && $_configuration['multiple_access_urls']) { $access_url_id = api_get_current_access_url_id(); if ($access_url_id != -1) { $url_info = api_get_access_url($access_url_id); $url = api_remove_trailing_slash(preg_replace('/https?:\/\//i', '', $url_info['url'])); $clean_url = replace_dangerous_char($url); $clean_url = str_replace('/', '-', $clean_url); $clean_url .= '/'; $homep = api_get_path(REL_PATH).'home/'.$clean_url; //homep for Home Path //we create the new dir for the new sites if (is_file($homep.'favicon.ico')) { $favico = ''; } } } $this->assign('favico', $favico); //old banner.inc.php require_once api_get_path(LIBRARY_PATH).'banner.lib.php'; global $my_session_id; $session_id = api_get_session_id(); $session_name = api_get_session_name($my_session_id); $help_content = ''; if (!empty($help)) { $help = Security::remove_XSS($help); $help_content = '
  • '; $help_content .= ''; $help_content .= ''.get_lang('Help').''; $help_content .= '
  • '; } $this->assign('help_content', $help_content); $bug_notification_link = ''; if (api_get_setting('show_link_bug_notification') == 'true') { $bug_notification_link = '
  • '.get_lang('ReportABug').'
  • '; } $this->assign('bug_notification_link', $bug_notification_link); if (isset($database_connection)) { // connect to the main database. // if single database, don't pefix table names with the main database name in SQL queries // (ex. SELECT * FROM table) // if multiple database, prefix table names with the course database name in SQL queries (or no prefix if the table is in // the main database) // (ex. SELECT * FROM table_from_main_db - SELECT * FROM courseDB.table_from_course_db) Database::select_db($_configuration['main_database'], $database_connection); } ob_start(); show_header_1($language_file, $nameTools); $header1 = ob_get_contents(); ob_clean(); ob_start(); show_header_2(); $header2 = ob_get_contents(); ob_clean(); ob_start(); $menu_navigation = show_header_3(); $header3 = ob_get_contents(); ob_clean(); $header4 = show_header_4($interbreadcrumb, $language_file, $nameTools); $this->assign('header1', $header1); $this->assign('header2', $header2); $this->assign('header3', $header3); $this->assign('header4', $header4); header('Content-Type: text/html; charset='.api_get_system_encoding()); header('X-Powered-By: '.$_configuration['software_name'].' '.substr($_configuration['system_version'],0,1)); } function set_footer_parameters() { //Footer plugin global $_plugins, $_configuration; ob_start(); api_plugin('footer'); $plugin_footer = ob_get_contents(); ob_clean(); $this->assign('plugin_footer', $plugin_footer); $this->assign('show_administrator_data', api_get_setting('show_administrator_data')); $platform = get_lang('Platform').' '.$_configuration['software_name'].' '.$_configuration['system_version'].' © '.date('Y'); $this->assign('platform', $platform); $administrator_data = get_lang('Manager'). ' : '. Display::encrypted_mailto_link(api_get_setting('emailAdministrator'), api_get_person_name(api_get_setting('administratorName'), api_get_setting('administratorSurname'))); $this->assign('administrator_data', $administrator_data); $stats = ''; $this->assign('execution_stats', $stats); } }