Feature #272 - Revision and cleaning of all the include files.

skala
Ivan Tcholakov 16 years ago
parent 05a14efe4c
commit 8aae1a67e3
  1. 49
      main/inc/banner.inc.php
  2. 222
      main/inc/course_document.inc.php
  3. 19
      main/inc/footer.inc.php
  4. 16
      main/inc/global.inc.php
  5. 11
      main/inc/global_error_message.inc.php
  6. 82
      main/inc/header.inc.php
  7. 57
      main/inc/introductionSection.inc.php
  8. 52
      main/inc/latex.php
  9. 10
      main/inc/local.inc.php
  10. 81
      main/inc/reduced_header.inc.php
  11. 73
      main/inc/tool_navigation_menu.inc.php

@ -1,14 +1,14 @@
<?php <?php
/* For licensing terms, see /chamilo_license.txt */ /* For licensing terms, see /license.txt */
/** /**
* This script contains the actual html code to display the "header" * This script contains the actual html code to display the "header"
* or "banner" on top of every Dokeos page. * or "banner" on top of every Chamilo page.
* *
* @package chamilo.include * @package chamilo.include
*/ */
require_once api_get_path(SYS_CODE_PATH).'/inc/lib/banner.lib.php'; require_once api_get_path(LIBRARY_PATH).'banner.lib.php';
$session_id = api_get_session_id(); $session_id = api_get_session_id();
$session_name = api_get_session_name($my_session_id); $session_name = api_get_session_name($my_session_id);
@ -29,9 +29,9 @@ $session_name = api_get_session_name($my_session_id);
?> ?>
</div> </div>
<?php <?php
/*
Course title section /* Course title section */
*/
if (!empty($_cid) and $_cid != -1 and isset($_course)) { if (!empty($_cid) and $_cid != -1 and isset($_course)) {
//Put the name of the course in the header //Put the name of the course in the header
?> ?>
@ -63,18 +63,16 @@ if (!empty($_cid) and $_cid != -1 and isset($_course)) {
} else { } else {
echo '<div id="my_courses"></div>'; echo '<div id="my_courses"></div>';
} }
//not to let the header disappear if there's nothing on the left //Don't let the header disappear if there's nothing on the left
echo '<div class="clear">&nbsp;</div>'; echo '<div class="clear">&nbsp;</div>';
/* /* Plugins for banner section */
Plugins for banner section
*/
api_plugin('header'); api_plugin('header');
$web_course_path = api_get_path(WEB_COURSE_PATH); $web_course_path = api_get_path(WEB_COURSE_PATH);
/* /* External link section */
External link section
*/
if (isset($_course['extLink']) && $_course['extLink']['name'] != '') { if (isset($_course['extLink']) && $_course['extLink']['name'] != '') {
echo '<span class="extLinkSeparator"> / </span>'; echo '<span class="extLinkSeparator"> / </span>';
if ($_course['extLink']['url'] != '') { if ($_course['extLink']['url'] != '') {
@ -106,7 +104,6 @@ if ((api_get_setting('showonline', 'world') == 'true' AND !$_user['user_id']) OR
echo '<li>'; echo '<li>';
// Display the who's online of the platform // Display the who's online of the platform
if ((api_get_setting('showonline', 'world') == 'true' AND !$_user['user_id']) OR (api_get_setting('showonline', 'users') == 'true' AND $_user['user_id'])) { if ((api_get_setting('showonline', 'world') == 'true' AND !$_user['user_id']) OR (api_get_setting('showonline', 'users') == 'true' AND $_user['user_id'])) {
//echo '<a href="'.api_get_path(WEB_PATH).'whoisonline.php" target="_top">'.$number.'</a>';
echo '<a href="'.api_get_path(WEB_PATH).'whoisonline.php" target="_top">'.get_lang('UsersOnline').': '.$number.'</a>'; echo '<a href="'.api_get_path(WEB_PATH).'whoisonline.php" target="_top">'.get_lang('UsersOnline').': '.$number.'</a>';
} }
@ -129,8 +126,8 @@ if (api_is_allowed_to_edit()) {
// Show help // Show help
?> ?>
<li>| <li>|
<a href="#" onclick="MyWindow=window.open('<?php echo api_get_path(WEB_CODE_PATH).'help/help.php'; ?>?open=<?php echo $help; ?>','MyWindow','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=620,height=600,left=200,top=20'); return false;"> <a href="#" onclick="javascript: MyWindow=window.open('<?php echo api_get_path(WEB_CODE_PATH).'help/help.php'; ?>?open=<?php echo $help; ?>','MyWindow','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=620,height=600,left=200,top=20'); return false;">
<img src="<?php echo api_get_path(WEB_CODE_PATH); ?>img/khelpcenter.gif" style="vertical-align: middle;" alt="<?php echo get_lang('Help'); ?>"/>&nbsp;<?php echo get_lang('Help'); ?></li></a> <img src="<?php echo api_get_path(WEB_IMG_PATH); ?>khelpcenter.gif" style="vertical-align: middle;" alt="<?php echo get_lang('Help'); ?>"/>&nbsp;<?php echo get_lang('Help'); ?></li></a>
<?php <?php
} }
@ -143,9 +140,9 @@ if (api_is_allowed_to_edit()) {
<div id="header3"> <div id="header3">
<?php <?php
/*
User section /* User section */
*/
if ($_user['user_id']) { if ($_user['user_id']) {
$login = ''; $login = '';
if (api_is_anonymous()) { if (api_is_anonymous()) {
@ -331,8 +328,8 @@ if (api_get_self() != '/main/admin/configure_homepage.php') {
$enreg = trim($enreg); $enreg = trim($enreg);
if (!empty($enreg)) { if (!empty($enreg)) {
$edit_link = '<a href="'.api_get_self().'?action=edit_tabs&amp;link_index='.$key.'" ><span>'.Display::return_icon('edit.gif', get_lang('Edit')).'</span></a>'; $edit_link = '<a href="'.api_get_self().'?action=edit_tabs&amp;link_index='.$key.'" ><span>'.Display::return_icon('edit.gif', get_lang('Edit')).'</span></a>';
$delete_link = '<a href="'.api_get_self().'?action=delete_tabs&amp;link_index='.$key.'" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset)).'\')) return false;"><span>'.Display::return_icon('delete.gif', get_lang('Delete')).'</span></a>'; $delete_link = '<a href="'.api_get_self().'?action=delete_tabs&amp;link_index='.$key.'" onclick="javascript: if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES)).'\')) return false;"><span>'.Display::return_icon('delete.gif', get_lang('Delete')).'</span></a>';
$tab_string = str_replace(array('href="'.api_get_path(WEB_PATH).'index.php?include=','</li>'),array('href="'.api_get_path(WEB_CODE_PATH).'admin/'.basename(api_get_self()).'?action=open_link&link=',''.$edit_link.$delete_link.'</li>'),$enreg); $tab_string = str_replace(array('href="'.api_get_path(WEB_PATH).'index.php?include=', '</li>'), array('href="'.api_get_path(WEB_CODE_PATH).'admin/'.basename(api_get_self()).'?action=open_link&link=', $edit_link.$delete_link.'</li>'), $enreg);
echo $tab_string; echo $tab_string;
} }
} }
@ -433,9 +430,8 @@ if (!empty($header_hide_main_div) && $header_hide_main_div === true) {
<?php <?php
} }
/* /* "call for chat" module section */
"call for chat" module section
*/
$chat = strpos(api_get_self(), 'chat_banner.php'); $chat = strpos(api_get_self(), 'chat_banner.php');
if (!$chat) { if (!$chat) {
include_once api_get_path(LIBRARY_PATH).'online.inc.php'; include_once api_get_path(LIBRARY_PATH).'online.inc.php';
@ -446,9 +442,8 @@ if (!$chat) {
} }
} }
/* /* Navigation menu section */
Navigation menu section
*/
if (api_get_setting('show_navigation_menu') != 'false' && api_get_setting('show_navigation_menu') != 'icons') { if (api_get_setting('show_navigation_menu') != 'false' && api_get_setting('show_navigation_menu') != 'icons') {
Display::show_course_navigation_menu($_GET['isHidden']); Display::show_course_navigation_menu($_GET['isHidden']);
$course_id = api_get_course_id(); $course_id = api_get_course_id();

@ -1,17 +1,20 @@
<?php <?php
/* For licensing terms, see /license.txt */
/* INIT SECTION */
$language_file = array('create_course', 'document'); $language_file = array('create_course', 'document');
include_once('global.inc.php'); require 'global.inc.php';
require_once(api_get_path(SYS_CODE_PATH).'inc/lib/course_document.lib.php');
/*
==============================================================================
INIT SECTION
==============================================================================
*/
// name of the language file that needs to be included
require_once api_get_path(INCLUDE_PATH).'lib/fckeditor/repository.php'; /* Libraries */
include(api_get_path(SYS_CODE_PATH).'document/document.inc.php'); require_once api_get_path(LIBRARY_PATH).'course_document.lib.php';
require_once api_get_path(LIBRARY_PATH).'fckeditor/repository.php';
require_once api_get_path(SYS_CODE_PATH).'document/document.inc.php';
require_once api_get_path(LIBRARY_PATH).'fileDisplay.lib.php';
require_once api_get_path(LIBRARY_PATH).'document.lib.php';
require_once api_get_path(LIBRARY_PATH).'tablesort.lib.php';
require_once api_get_path(LIBRARY_PATH).'fileManage.lib.php';
//if(!$is_in_admin){ //if(!$is_in_admin){
if (!api_is_platform_admin()){ if (!api_is_platform_admin()){
@ -19,26 +22,23 @@ if(!api_is_platform_admin()){
} }
//session //session
if(isset($_GET['id_session'])) if(isset($_GET['id_session'])) {
$_SESSION['id_session'] = intval($_GET['id_session']); $_SESSION['id_session'] = intval($_GET['id_session']);
}
$htmlHeadXtra[] = $htmlHeadXtra[] =
"<script type=\"text/javascript\"> "<script type=\"text/javascript\">
function confirmation (name) function confirmation (name)
{ {
if (confirm(\" ". api_convert_encoding(get_lang('AreYouSureToDelete'), 'UTF-8', $charset) ." \"+ name + \" ?\")) if (confirm(\" ". api_utf8_encode(get_lang('AreYouSureToDelete')) ." \"+ name + \" ?\"))
{return true;} {return true;}
else else
{return false;} {return false;}
} }
</script>"; </script>";
/* /* Variables
----------------------------------------------------------- - some need defining before inclusion of libraries */
Variables
- some need defining before inclusion of libraries
-----------------------------------------------------------
*/
$sType = isset($sType) ? $sType : ''; $sType = isset($sType) ? $sType : '';
@ -48,41 +48,29 @@ if($sType=="MP3") $sType="audio";
$sType = strtolower($sType); $sType = strtolower($sType);
// Choosing the repository to be used. // Choosing the repository to be used.
if (api_is_in_course()) if (api_is_in_course()) {
{ if (!api_is_in_group()) {
if (!api_is_in_group())
{
// 1. We are inside a course and not in a group. // 1. We are inside a course and not in a group.
if (api_is_allowed_to_edit()) if (api_is_allowed_to_edit()) {
{
// 1.1. Teacher // 1.1. Teacher
$base_work_dir = api_get_path(SYS_COURSE_PATH).api_get_course_path().'/document/'; $base_work_dir = api_get_path(SYS_COURSE_PATH).api_get_course_path().'/document/';
$http_www = api_get_path(WEB_COURSE_PATH).api_get_course_path().'/document/'; $http_www = api_get_path(WEB_COURSE_PATH).api_get_course_path().'/document/';
} } else {
else
{
// 1.2. Student // 1.2. Student
$base_work_dir = api_get_path(SYS_COURSE_PATH).api_get_course_path().'/document/shared_folder/'.api_get_user_id().'/'; $base_work_dir = api_get_path(SYS_COURSE_PATH).api_get_course_path().'/document/shared_folder/'.api_get_user_id().'/';
$http_www = api_get_path(WEB_COURSE_PATH).api_get_course_path().'/document/shared_folder/'.api_get_user_id().'/'; $http_www = api_get_path(WEB_COURSE_PATH).api_get_course_path().'/document/shared_folder/'.api_get_user_id().'/';
} }
} } else {
else
{
// 2. Inside a course and inside a group. // 2. Inside a course and inside a group.
$base_work_dir = api_get_path(SYS_COURSE_PATH).api_get_course_path().'/document'.$group_properties['directory'].'/'; $base_work_dir = api_get_path(SYS_COURSE_PATH).api_get_course_path().'/document'.$group_properties['directory'].'/';
$http_www = api_get_path(WEB_COURSE_PATH).api_get_course_path().'/document'.$group_properties['directory'].'/'; $http_www = api_get_path(WEB_COURSE_PATH).api_get_course_path().'/document'.$group_properties['directory'].'/';
} }
} } else {
else if (api_is_platform_admin() && $_SESSION['this_section'] == 'platform_admin') {
{
if (api_is_platform_admin() && $_SESSION['this_section'] == 'platform_admin')
{
// 3. Platform administration activities. // 3. Platform administration activities.
$base_work_dir = $_configuration['root_sys'].'home/default_platform_document/'; $base_work_dir = $_configuration['root_sys'].'home/default_platform_document/';
$http_www = $_configuration['root_web'].'home/default_platform_document/'; $http_www = $_configuration['root_web'].'home/default_platform_document/';
} } else {
else
{
// 4. The user is outside courses. // 4. The user is outside courses.
$base_work_dir = $_configuration['root_sys'].'main/upload/users/'.api_get_user_id().'/my_files/'; $base_work_dir = $_configuration['root_sys'].'main/upload/users/'.api_get_user_id().'/my_files/';
$http_www = $_configuration['root_web'].'main/upload/users/'.api_get_user_id().'/my_files/'; $http_www = $_configuration['root_web'].'main/upload/users/'.api_get_user_id().'/my_files/';
@ -90,36 +78,27 @@ else
} }
// Set the upload path according to the resource type. // Set the upload path according to the resource type.
if ($sType == 'audio') if ($sType == 'audio') {
{
check_and_create_resource_directory($base_work_dir, '/audio', get_lang('Audio')); check_and_create_resource_directory($base_work_dir, '/audio', get_lang('Audio'));
$base_work_dir = $base_work_dir.'audio/'; $base_work_dir = $base_work_dir.'audio/';
$http_www = $http_www.'audio/'; $http_www = $http_www.'audio/';
$path = "/audio/"; $path = "/audio/";
} } elseif ($sType == 'flash') {
elseif ($sType == 'flash')
{
check_and_create_resource_directory($base_work_dir, '/flash', get_lang('Flash')); check_and_create_resource_directory($base_work_dir, '/flash', get_lang('Flash'));
$base_work_dir = $base_work_dir.'flash/'; $base_work_dir = $base_work_dir.'flash/';
$http_www = $http_www.'flash/'; $http_www = $http_www.'flash/';
$path = "/flash/"; $path = "/flash/";
} } elseif ($sType == 'images') {
elseif ($sType == 'images')
{
check_and_create_resource_directory($base_work_dir, '/images', get_lang('Images')); check_and_create_resource_directory($base_work_dir, '/images', get_lang('Images'));
$base_work_dir = $base_work_dir.'images/'; $base_work_dir = $base_work_dir.'images/';
$http_www = $http_www.'images/'; $http_www = $http_www.'images/';
$path = "/images/"; $path = "/images/";
} } elseif ($sType == 'video') {
elseif ($sType == 'video')
{
check_and_create_resource_directory($base_work_dir, '/video', get_lang('Video')); check_and_create_resource_directory($base_work_dir, '/video', get_lang('Video'));
$base_work_dir = $base_work_dir.'video/'; $base_work_dir = $base_work_dir.'video/';
$http_www = $http_www.'video/'; $http_www = $http_www.'video/';
$path = "/video/"; $path = "/video/";
} } elseif ($sType == 'video/flv') {
elseif ($sType == 'video/flv')
{
check_and_create_resource_directory($base_work_dir, '/video', get_lang('Video')); check_and_create_resource_directory($base_work_dir, '/video', get_lang('Video'));
check_and_create_resource_directory($base_work_dir, '/video/flv', 'flv'); check_and_create_resource_directory($base_work_dir, '/video/flv', 'flv');
$base_work_dir = $base_work_dir.'video/flv/'; $base_work_dir = $base_work_dir.'video/flv/';
@ -127,7 +106,7 @@ elseif ($sType == 'video/flv')
$path = "/video/flv/"; $path = "/video/flv/";
} }
$course_dir = $_course['path']."/document/".$sType; $course_dir = $_course['path'].'/document/'.$sType;
$sys_course_path = api_get_path(SYS_COURSE_PATH); $sys_course_path = api_get_path(SYS_COURSE_PATH);
$dbl_click_id = 0; // used to avoid double-click $dbl_click_id = 0; // used to avoid double-click
@ -135,44 +114,20 @@ $is_allowed_to_edit = api_is_allowed_to_edit();
$req_gid = ''; $req_gid = '';
/* /* Constants and variables */
-----------------------------------------------------------
Libraries
-----------------------------------------------------------
*/
//libraries are included by default
include_once(api_get_path(LIBRARY_PATH) . 'fileDisplay.lib.php');
include_once(api_get_path(LIBRARY_PATH) . 'document.lib.php');
include_once(api_get_path(LIBRARY_PATH) . 'tablesort.lib.php');
/*
-----------------------------------------------------------
Constants and variables
-----------------------------------------------------------
*/
$course_quota = DocumentManager::get_course_quota(); $course_quota = DocumentManager::get_course_quota();
/* /* MAIN SECTION */
==============================================================================
MAIN SECTION
==============================================================================
*/
/* /* Header */
-----------------------------------------------------------
Header
-----------------------------------------------------------
*/
$tool_name = get_lang("Doc"); // title of the page (should come from the language file) $tool_name = get_lang('Doc'); // Title of the page (should come from the language file)
?> ?>
<style type="text/css" media="screen, projection"> <style type="text/css" media="screen, projection">
/*<![CDATA[*/ /*<![CDATA[*/
@import "<?php echo api_get_path(WEB_CODE_PATH); ?>css/public_admin/default.css"; @import "<?php echo api_get_path(WEB_CSS_PATH); ?>public_admin/default.css";
/*]]>*/ /*]]>*/
</style> </style>
@ -182,7 +137,7 @@ if(api_get_setting('stylesheets')<>'')
?> ?>
<style type="text/css" media="screen, projection"> <style type="text/css" media="screen, projection">
/*<![CDATA[*/ /*<![CDATA[*/
@import "<?php echo api_get_path(WEB_CODE_PATH); ?>css/<?php echo api_get_setting('stylesheets');?>/default.css"; @import "<?php echo api_get_path(WEB_CSS_PATH), api_get_setting('stylesheets'); ?>/default.css";
/*]]>*/ /*]]>*/
</style> </style>
@ -191,68 +146,43 @@ if(api_get_setting('stylesheets')<>'')
$is_allowed_to_edit = api_is_allowed_to_edit(); $is_allowed_to_edit = api_is_allowed_to_edit();
if($is_allowed_to_edit) // TEACHER ONLY if ($is_allowed_to_edit) { // TEACHER ONLY
{
/*====================================== /* DELETE FILE OR DIRECTORY */
DELETE FILE OR DIRECTORY
======================================*/
if ( isset($_GET['delete']) ) if (isset($_GET['delete'])) {
{ if (DocumentManager::delete_document($_course,$_GET['delete'], $base_work_dir)) {
include_once(api_get_path(LIBRARY_PATH) . 'fileManage.lib.php'); Display::display_normal_message(api_utf8_encode(get_lang('DocDeleted')));
if(DocumentManager::delete_document($_course,$_GET['delete'],$base_work_dir)) } else {
{ Display::display_normal_message(api_utf8_encode(get_lang('DocDeleteError')));
Display::display_normal_message(api_convert_encoding(get_lang('DocDeleted'), 'UTF-8', $charset));
}
else
{
Display::display_normal_message(api_convert_encoding(get_lang('DocDeleteError'), 'UTF-8', $charset));
} }
} }
if( isset($_POST['action'])) if (isset($_POST['action'])) {
{ switch ($_POST['action']) {
switch($_POST['action'])
{
case 'delete': case 'delete':
foreach($_POST['path'] as $index => $path) foreach ($_POST['path'] as $index => $path) {
{
DocumentManager::delete_document($_course, $path, $base_work_dir); DocumentManager::delete_document($_course, $path, $base_work_dir);
} }
Display::display_normal_message(api_convert_encoding(get_lang('DocDeleted'), 'UTF-8', $charset)); Display::display_normal_message(api_utf8_encode(get_lang('DocDeleted')));
break; break;
} }
} }
} }
/* /* GET ALL DOCUMENT DATA FOR CURDIRPATH */
-----------------------------------------------------------
GET ALL DOCUMENT DATA FOR CURDIRPATH
-----------------------------------------------------------
*/
$docs_and_folders = getlist ($base_work_dir.'/'); $docs_and_folders = getlist ($base_work_dir.'/');
?> if ($docs_and_folders) {
<?php
if($docs_and_folders)
{
//echo('<pre>');
//print_r($docs_and_folders);
//echo('</pre>');
//*************************************************************************************************
//do we need the title field for the document name or not? //do we need the title field for the document name or not?
//we get the setting here, so we only have to do it once //we get the setting here, so we only have to do it once
$use_document_title = api_get_setting('use_document_title'); $use_document_title = api_get_setting('use_document_title');
//create a sortable table with our data //create a sortable table with our data
$sortable_data = array(); $sortable_data = array();
while (list ($key, $id) = each($docs_and_folders)) while (list ($key, $id) = each($docs_and_folders)) {
{
// Skip directories. // Skip directories.
if ($id['filetype'] != 'file') if ($id['filetype'] != 'file') {
{
continue; continue;
} }
@ -264,19 +194,15 @@ if($docs_and_folders)
//size (or total size of a directory) //size (or total size of a directory)
$size = $id['filetype'] == 'folder' ? get_total_folder_size($id['path'], $is_allowed_to_edit) : $id[size]; $size = $id['filetype'] == 'folder' ? get_total_folder_size($id['path'], $is_allowed_to_edit) : $id[size];
//get the title or the basename depending on what we're using //get the title or the basename depending on what we're using
if ($use_document_title=='true' AND $id['title']<>'') if ($use_document_title == 'true' AND $id['title'] != '') {
{
$document_name=$id['title']; $document_name=$id['title'];
} } else {
else
{
$document_name = basename($id['path']); $document_name = basename($id['path']);
} }
//$row[] = $key; //testing //$row[] = $key; //testing
//data for checkbox //data for checkbox
/* /*
if ($is_allowed_to_edit AND count($docs_and_folders)>1) if ($is_allowed_to_edit AND count($docs_and_folders) > 1) {
{
$row[] = $id['path']; $row[] = $id['path'];
} }
*/ */
@ -294,43 +220,35 @@ if($docs_and_folders)
$sortable_data[] = $row; $sortable_data[] = $row;
} }
//******************************************************************************************* } else {
}
else
{
$sortable_data = array(); $sortable_data = array();
//$table_footer='<div style="text-align:center;"><strong>'.get_lang('NoDocsInFolder').'</strong></div>'; //$table_footer='<div style="text-align:center;"><strong>'.get_lang('NoDocsInFolder').'</strong></div>';
} }
$table = new SortableTableFromArray($sortable_data, 4, 10); $table = new SortableTableFromArray($sortable_data, 4, 10);
$query_vars['curdirpath'] = $curdirpath; $query_vars['curdirpath'] = $curdirpath;
if(isset($_SESSION['_gid'])) if (isset($_SESSION['_gid'])) {
{
$query_vars['gidReq'] = $_SESSION['_gid']; $query_vars['gidReq'] = $_SESSION['_gid'];
} }
$table->set_additional_parameters($query_vars); $table->set_additional_parameters($query_vars);
$column = 0; $column = 0;
/* /*
if ($is_allowed_to_edit AND count($docs_and_folders)>1) if ($is_allowed_to_edit AND count($docs_and_folders) > 1) {
{
$table->set_header($column++, '', false); $table->set_header($column++, '', false);
} }
*/ */
$table->set_header($column++, api_htmlentities(get_lang('Type'), ENT_QUOTES, $charset)); $table->set_header($column++, api_htmlentities(get_lang('Type'), ENT_QUOTES));
$table->set_header($column++, api_htmlentities(get_lang('Title'), ENT_QUOTES, $charset)); $table->set_header($column++, api_htmlentities(get_lang('Title'), ENT_QUOTES));
//$column_header[] = array(get_lang('Comment'),true); => display comment under the document name //$column_header[] = array(get_lang('Comment'),true); => display comment under the document name
$table->set_header($column++, api_htmlentities(get_lang('Size'), ENT_QUOTES, $charset)); $table->set_header($column++, api_htmlentities(get_lang('Size'), ENT_QUOTES));
$table->set_header($column++, api_htmlentities(get_lang('Date'), ENT_QUOTES, $charset)); $table->set_header($column++, api_htmlentities(get_lang('Date'), ENT_QUOTES));
//currently only delete action -> take only DELETE right into account //currently only delete action -> take only DELETE right into account
/* /*
if (count($docs_and_folders)>1) if (count($docs_and_folders) > 1) {
{ if ($is_allowed_to_edit) {
if ($is_allowed_to_edit)
{
$form_actions = array(); $form_actions = array();
$form_action['delete'] = get_lang('Delete'); $form_action['delete'] = get_lang('Delete');
$table->set_form_actions($form_action, 'path'); $table->set_form_actions($form_action, 'path');
@ -338,12 +256,10 @@ if (count($docs_and_folders)>1)
} }
*/ */
echo api_convert_encoding($table->get_table_html(), 'UTF-8', $charset); echo api_utf8_encode($table->get_table_html());
echo api_convert_encoding($table_footer, 'UTF-8', $charset); echo api_utf8_encode($table_footer);
////////// functions ////////////
// Functions
?> ?>
<script type="text/javascript"> <script type="text/javascript">
@ -352,7 +268,7 @@ function OpenFile( fileUrl, type )
{ {
if (type=="audio") if (type=="audio")
{ {
ret = confirm('<?php echo api_convert_encoding(get_lang('AutostartMp3'), 'UTF-8', $charset); ?>'); ret = confirm('<?php echo api_utf8_encode(get_lang('AutostartMp3')); ?>');
if (ret==true) if (ret==true)
{ {
GetE('autostart').checked = true; GetE('autostart').checked = true;

@ -1,12 +1,11 @@
<?php <?php
/* For licensing terms, see /chamilo_license.txt */ /* For licensing terms, see /license.txt */
/** /**
==============================================================================
* This script displays the footer that is below (almost) * This script displays the footer that is below (almost)
* every Chamilo web page. * every Chamilo web page.
* *
* @package chamilo.include * @package chamilo.include
==============================================================================
*/ */
// Display of tool_navigation_menu according to admin setting. // Display of tool_navigation_menu according to admin setting.
@ -35,12 +34,14 @@ if (api_get_setting('show_navigation_menu') != 'false') {
<div class="copyright"> <div class="copyright">
<?php <?php
global $_configuration; global $_configuration;
if (api_get_setting('show_administrator_data') == 'true') { if (api_get_setting('show_administrator_data') == 'true') {
// Platform manager // Platform manager
echo '<div align="right">', get_lang('Manager'), ' : ', Display::encrypted_mailto_link(api_get_setting('emailAdministrator'), api_get_person_name(api_get_setting('administratorName'), api_get_setting('administratorSurname'))).'</div>'; echo '<div align="right">', get_lang('Manager'), ' : ', Display::encrypted_mailto_link(api_get_setting('emailAdministrator'), api_get_person_name(api_get_setting('administratorName'), api_get_setting('administratorSurname'))).'</div>';
} }
echo get_lang("Platform"), ' <a href="', $_configuration['software_url'], '" target="_blank">', $_configuration['software_name'], ' ', $_configuration['system_version'], '</a> &copy; ', date('Y'); echo get_lang('Platform'), ' <a href="', $_configuration['software_url'], '" target="_blank">', $_configuration['software_name'], ' ', $_configuration['system_version'], '</a> &copy; ', date('Y');
// Server mode indicator. // Server mode indicator.
if (api_is_platform_admin()) { if (api_is_platform_admin()) {
if (api_get_setting('server_type') == 'test') { if (api_get_setting('server_type') == 'test') {
@ -52,17 +53,15 @@ if (api_is_platform_admin()) {
</div> </div>
<?php <?php
/*
----------------------------------------------------------------------------- /* Plugins for footer section */
Plugins for footer section
-----------------------------------------------------------------------------
*/
api_plugin('footer'); api_plugin('footer');
echo '<div class="footer_emails">'; echo '<div class="footer_emails">';
if (api_get_setting('show_tutor_data') == 'true') { if (api_get_setting('show_tutor_data') == 'true') {
// course manager // Course manager
$id_course = api_get_course_id(); $id_course = api_get_course_id();
$id_session = api_get_session_id(); $id_session = api_get_session_id();
if (isset($id_course) && $id_course != -1) { if (isset($id_course) && $id_course != -1) {

@ -1,4 +1,6 @@
<?php <?php
/* For licensing terms, see /license.txt */
/** /**
* It is recommended that ALL Chamilo scripts include this important file. * It is recommended that ALL Chamilo scripts include this important file.
* This script manages * This script manages
@ -10,12 +12,12 @@
* - selecting the main database; * - selecting the main database;
* - include of language files. * - include of language files.
* *
* @package dokeos.include * @package chamilo.include
* @todo isn't configuration.php renamed to configuration.inc.php yet? * @todo isn't configuration.php renamed to configuration.inc.php yet?
* @todo use the $_configuration array for all the needed variables * @todo use the $_configuration array for all the needed variables
* @todo remove the code that displays the button that links to the install page * @todo remove the code that displays the button that links to the install page
* but use a redirect immediately. By doing so the $already_installed variable can be removed. * but use a redirect immediately. By doing so the $already_installed variable can be removed.
* @todo make it possible to enable / disable the tracking through the Dokeos config page. * @todo make it possible to enable / disable the tracking through the Chamilo config page.
* *
*/ */
@ -38,7 +40,7 @@ if (!function_exists('version_compare') || version_compare(phpversion(), REQUIRE
} }
// @todo Isn't this file renamed to configuration.inc.php yet? // @todo Isn't this file renamed to configuration.inc.php yet?
// Include the main Dokeos platform configuration file. // Include the main Chamilo platform configuration file.
$main_configuration_file_path = $includePath.'/conf/configuration.php'; $main_configuration_file_path = $includePath.'/conf/configuration.php';
$already_installed = false; $already_installed = false;
@ -74,7 +76,7 @@ if (empty($_configuration['system_version'])) {
$_configuration['dokeos_version'] = $_configuration['system_version']; $_configuration['dokeos_version'] = $_configuration['system_version'];
$_configuration['dokeos_stable'] = $_configuration['system_stable']; $_configuration['dokeos_stable'] = $_configuration['system_stable'];
// Include the main Dokeos platform library file. // Include the main Chamilo platform library file.
require_once $includePath.'/lib/main_api.lib.php'; require_once $includePath.'/lib/main_api.lib.php';
// Do not over-use this variable. It is only for this script's local use. // Do not over-use this variable. It is only for this script's local use.
@ -104,7 +106,7 @@ if (empty($_configuration['statistics_database']) && $already_installed) {
$_configuration['statistics_database'] = $_configuration['main_database']; $_configuration['statistics_database'] = $_configuration['main_database'];
} }
// Connect to the server database and select the main dokeos database. // Connect to the server database and select the main chamilo database.
if (!($dokeos_database_connection = @Database::connect( if (!($dokeos_database_connection = @Database::connect(
array( array(
'server' => $_configuration['db_host'], 'server' => $_configuration['db_host'],
@ -151,7 +153,7 @@ Database::query("set session sql_mode='';");
if (!Database::select_db($_configuration['main_database'], $dokeos_database_connection)) { if (!Database::select_db($_configuration['main_database'], $dokeos_database_connection)) {
$global_error_code = 5; $global_error_code = 5;
// Connection to the main Dokeos database is impossible, it might be missing or restricted or its configuration option might be incorrect. // Connection to the main Chamilo database is impossible, it might be missing or restricted or its configuration option might be incorrect.
require $includePath.'/global_error_message.inc.php'; require $includePath.'/global_error_message.inc.php';
die(); die();
} }
@ -179,7 +181,7 @@ Database::query("SET SESSION character_set_server='utf8';");
Database::query("SET SESSION collation_server='utf8_general_ci';"); Database::query("SET SESSION collation_server='utf8_general_ci';");
Database::query("SET CHARACTER SET '" . Database::to_db_encoding($charset) . "';"); Database::query("SET CHARACTER SET '" . Database::to_db_encoding($charset) . "';");
// access_url == 1 is the default dokeos location // access_url == 1 is the default chamilo location
if ($_configuration['access_url'] != 1) { if ($_configuration['access_url'] != 1) {
$url_info = api_get_access_url($_configuration['access_url']); $url_info = api_get_access_url($_configuration['access_url']);
if ($url_info['active'] == 1) { if ($url_info['active'] == 1) {

@ -1,14 +1,11 @@
<?php <?php
/* For licensing terms, see /chamilo_license.txt */ /* For licensing terms, see /license.txt */
/** /**
*============================================================================== * This script displays error messages on fatal errors during initialization.
* This script displays error messages on fatal errors
* during initialization.
* *
* @package dokeos.include * @package chamilo.include
* @author Ivan Tcholakov, 2009 * @author Ivan Tcholakov, 2009-2010
*==============================================================================
*/ */
$Organisation = '<a href="http://www.chamilo.org" target="_blank">Chamilo Homepage</a>'; $Organisation = '<a href="http://www.chamilo.org" target="_blank">Chamilo Homepage</a>';

@ -1,17 +1,13 @@
<?php <?php
/* For licensing terms, see /dokeos_license.txt */ /* For licensing terms, see /license.txt */
/** /**
============================================================================== * This script displays the Chamilo header.
* This script displays the Dokeos header.
* *
* @package dokeos.include * @package chamilo.include
==============================================================================
*/ */
/*---------------------------------------- /* HEADERS SECTION */
HEADERS SECTION
--------------------------------------*/
/* /*
* HTTP HEADER * HTTP HEADER
@ -22,13 +18,11 @@ header('Content-Type: text/html; charset='.api_get_system_encoding());
$navigator_info = api_get_navigator(); $navigator_info = api_get_navigator();
//ie6 fix //ie6 fix
if ($navigator_info['name'] == 'Internet Explorer' && $navigator_info['version'] == '6') { if ($navigator_info['name'] == 'Internet Explorer' && $navigator_info['version'] == '6') {
$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/iepngfix/iepngfix_tilebg.js" type="text/javascript" language="javascript"></script>'; //jQuery $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/iepngfix/iepngfix_tilebg.js" type="text/javascript" language="javascript"></script>';
} }
if ( isset($httpHeadXtra) && $httpHeadXtra ) if (isset($httpHeadXtra) && $httpHeadXtra) {
{ foreach ($httpHeadXtra as & $thisHttpHead) {
foreach($httpHeadXtra as $thisHttpHead)
{
header($thisHttpHead); header($thisHttpHead);
} }
} }
@ -67,43 +61,34 @@ echo api_get_setting('siteName');
$platform_theme = api_get_setting('stylesheets'); // plataform's css $platform_theme = api_get_setting('stylesheets'); // plataform's css
$my_style = $platform_theme; $my_style = $platform_theme;
if(api_get_setting('user_selected_theme') == 'true') if (api_get_setting('user_selected_theme') == 'true') {
{
$useri = api_get_user_info(); $useri = api_get_user_info();
$user_theme = $useri['theme']; $user_theme = $useri['theme'];
if(!empty($user_theme) && $user_theme != $my_style) if (!empty($user_theme) && $user_theme != $my_style) {
{
$my_style = $user_theme; // user's css $my_style = $user_theme; // user's css
} }
} }
$mycourseid = api_get_course_id(); $mycourseid = api_get_course_id();
if (!empty($mycourseid) && $mycourseid != -1) { if (!empty($mycourseid) && $mycourseid != -1) {
if (api_get_setting('allow_course_theme') == 'true') if (api_get_setting('allow_course_theme') == 'true') {
{
$mycoursetheme=api_get_course_setting('course_theme'); $mycoursetheme=api_get_course_setting('course_theme');
if (!empty($mycoursetheme) && $mycoursetheme!=-1) if (!empty($mycoursetheme) && $mycoursetheme != -1) {
{ if (!empty($mycoursetheme) && $mycoursetheme != $my_style) {
if(!empty($mycoursetheme) && $mycoursetheme != $my_style)
{
$my_style = $mycoursetheme; // course's css $my_style = $mycoursetheme; // course's css
} }
} }
$mycourselptheme = api_get_course_setting('allow_learning_path_theme'); $mycourselptheme = api_get_course_setting('allow_learning_path_theme');
if (!empty($mycourselptheme) && $mycourselptheme!=-1 && $mycourselptheme== 1) if (!empty($mycourselptheme) && $mycourselptheme != -1 && $mycourselptheme == 1) {
{
global $lp_theme_css; // it comes from the lp_controller.php global $lp_theme_css; // it comes from the lp_controller.php
global $lp_theme_config; // it comes from the lp_controller.php global $lp_theme_config; // it comes from the lp_controller.php
if (!$lp_theme_config) if (!$lp_theme_config) {
{ if ($lp_theme_css != '') {
if ($lp_theme_css!='')
{
$theme = $lp_theme_css; $theme = $lp_theme_css;
if(!empty($theme) && $theme != $my_style) if (!empty($theme) && $theme != $my_style) {
{
$my_style = $theme; // LP's css $my_style = $theme; // LP's css
} }
} }
@ -115,17 +100,16 @@ if (!empty($mycourseid) && $mycourseid != -1) {
global $show_learn_path; global $show_learn_path;
if ($show_learn_path) { if ($show_learn_path) {
$htmlHeadXtra[] = '<link rel="stylesheet" type="text/css" href="'.api_get_path(WEB_CODE_PATH).'css/'.$my_style.'/learnpath.css"/>'; $htmlHeadXtra[] = '<link rel="stylesheet" type="text/css" href="'.api_get_path(WEB_CSS_PATH).$my_style.'/learnpath.css"/>';
$htmlHeadXtra[] = '<link rel="stylesheet" type="text/css" href="dtree.css" />'; //will be moved $htmlHeadXtra[] = '<link rel="stylesheet" type="text/css" href="dtree.css" />'; //will be moved
$htmlHeadXtra[] = '<script src="dtree.js" type="text/javascript"></script>'; //will be moved $htmlHeadXtra[] = '<script src="dtree.js" type="text/javascript"></script>'; //will be moved
} }
$my_code_path = api_get_path(WEB_CODE_PATH);
if (empty($my_style)) { if (empty($my_style)) {
$my_style = 'dokeos_classic'; $my_style = 'dokeos_classic';
} }
echo '@import "'.$my_code_path.'css/'.$my_style.'/default.css";'."\n"; echo '@import "'.api_get_path(WEB_CSS_PATH).$my_style.'/default.css";'."\n";
echo '@import "'.$my_code_path.'css/'.$my_style.'/course.css";'."\n"; echo '@import "'.api_get_path(WEB_CSS_PATH).$my_style.'/course.css";'."\n";
if ($navigator_info['name']=='Internet Explorer' && $navigator_info['version']=='6') { if ($navigator_info['name']=='Internet Explorer' && $navigator_info['version']=='6') {
echo 'img, div { behavior: url('.api_get_path(WEB_LIBRARY_PATH).'javascript/iepngfix/iepngfix.htc) } '; echo 'img, div { behavior: url('.api_get_path(WEB_LIBRARY_PATH).'javascript/iepngfix/iepngfix.htc) } ';
@ -137,15 +121,15 @@ if ($navigator_info['name']=='Internet Explorer' && $navigator_info['version']=
<style type="text/css" media="print"> <style type="text/css" media="print">
/*<![CDATA[*/ /*<![CDATA[*/
<?php <?php
echo '@import "'.$my_code_path.'css/'.$my_style.'/print.css";'."\n"; echo '@import "'.api_get_path(WEB_CSS_PATH).$my_style.'/print.css";'."\n";
?> ?>
/*]]>*/ /*]]>*/
</style> </style>
<link rel="top" href="<?php echo api_get_path(WEB_PATH); ?>index.php" title="" /> <link rel="top" href="<?php echo api_get_path(WEB_PATH); ?>index.php" title="" />
<link rel="courses" href="<?php echo api_get_path(WEB_CODE_PATH) ?>auth/courses.php" title="<?php echo api_htmlentities(get_lang('OtherCourses'),ENT_QUOTES,$charset); ?>" /> <link rel="courses" href="<?php echo api_get_path(WEB_CODE_PATH); ?>auth/courses.php" title="<?php echo api_htmlentities(get_lang('OtherCourses'), ENT_QUOTES); ?>" />
<link rel="profil" href="<?php echo api_get_path(WEB_CODE_PATH) ?>auth/profile.php" title="<?php echo api_htmlentities(get_lang('ModifyProfile'),ENT_QUOTES,$charset); ?>" /> <link rel="profil" href="<?php echo api_get_path(WEB_CODE_PATH); ?>auth/profile.php" title="<?php echo api_htmlentities(get_lang('ModifyProfile'), ENT_QUOTES); ?>" />
<link href="http://www.chamilo.org/documentation.php" rel="Help" /> <link href="http://www.chamilo.org/documentation.php" rel="Help" />
<link href="http://www.chamilo.org/team.php" rel="Author" /> <link href="http://www.chamilo.org/team.php" rel="Author" />
<link href="http://www.chamilo.org" rel="Copyright" /> <link href="http://www.chamilo.org" rel="Copyright" />
@ -180,22 +164,18 @@ if ( ( navigator.userAgent.toLowerCase().indexOf('msie') != -1 ) && ( navigator.
</script> </script>
<?php <?php
if ( isset($htmlHeadXtra) && $htmlHeadXtra ) if (isset($htmlHeadXtra) && $htmlHeadXtra) {
{ foreach ($htmlHeadXtra as & $this_html_head) {
foreach($htmlHeadXtra as $this_html_head) echo $this_html_head;
{
echo($this_html_head);
} }
} }
if ( isset($htmlIncHeadXtra) && $htmlIncHeadXtra ) if (isset($htmlIncHeadXtra) && $htmlIncHeadXtra) {
{ foreach ($htmlIncHeadXtra as & $this_html_head) {
foreach($htmlIncHeadXtra as $this_html_head)
{
include($this_html_head); include($this_html_head);
} }
} }
//the following include might be subject to a setting proper to the course or platform // The following include might be subject to a setting proper to the course or platform.
include(api_get_path(LIBRARY_PATH).'/javascript/email_links.lib.js.php'); include api_get_path(LIBRARY_PATH).'javascript/email_links.lib.js.php';
?> ?>
</head> </head>
@ -204,8 +184,8 @@ include(api_get_path(LIBRARY_PATH).'/javascript/email_links.lib.js.php');
echo 'onload="javascript: if(document.formLogin) { document.formLogin.login.focus(); }"'; ?>> echo 'onload="javascript: if(document.formLogin) { document.formLogin.login.focus(); }"'; ?>>
<div class="skip"> <div class="skip">
<ul> <ul>
<li><a href="#menu"><?php echo ( get_lang('WCAGGoMenu') )?></a></li> <li><a href="#menu"><?php echo get_lang('WCAGGoMenu'); ?></a></li>
<li><a href="#content" accesskey="2"><?php echo ( get_lang('WCAGGoContent') )?></a></li> <li><a href="#content" accesskey="2"><?php echo get_lang('WCAGGoContent'); ?></a></li>
</ul> </ul>
</div> </div>

@ -1,10 +1,10 @@
<?php <?php
/* For licensing terms, see /dokeos_license.txt */ /* For licensing terms, see /license.txt */
/** /**
==============================================================================
* The INTRODUCTION MICRO MODULE is used to insert and edit * The INTRODUCTION MICRO MODULE is used to insert and edit
* an introduction section on a Dokeos Module. It can be inserted on any * an introduction section on a Chamilo Module. It can be inserted on any
* Dokeos Module, provided a connection to a course Database is already active. * Chamilo Module, provided a connection to a course Database is already active.
* *
* The introduction content are stored on a table called "introduction" * The introduction content are stored on a table called "introduction"
* in the course Database. Each module introduction has an Id stored on * in the course Database. Each module introduction has an Id stored on
@ -20,29 +20,25 @@
* $moduleId = XX // specifying the module Id * $moduleId = XX // specifying the module Id
* include(moduleIntro.inc.php); * include(moduleIntro.inc.php);
* *
* @package dokeos.include * @package chamilo.include
==============================================================================
*/ */
require_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php'; require_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php';
require_once api_get_path(LIBRARY_PATH).'course_description.lib.php'; require_once api_get_path(LIBRARY_PATH).'course_description.lib.php';
/* /* Constants and variables */
-----------------------------------------------------------
Constants and variables
-----------------------------------------------------------
*/
$TBL_INTRODUCTION = Database::get_course_table(TABLE_TOOL_INTRO); $TBL_INTRODUCTION = Database::get_course_table(TABLE_TOOL_INTRO);
$intro_editAllowed = $is_allowed_to_edit; $intro_editAllowed = $is_allowed_to_edit;
global $charset; global $charset;
$intro_cmdEdit = (empty($_GET['intro_cmdEdit'])?'':$_GET['intro_cmdEdit']); $intro_cmdEdit = empty($_GET['intro_cmdEdit']) ? '' : $_GET['intro_cmdEdit'];
$intro_cmdUpdate = isset($_POST['intro_cmdUpdate'])?true:false; $intro_cmdUpdate = isset($_POST['intro_cmdUpdate']);
$intro_cmdDel= (empty($_GET['intro_cmdDel'])?'':$_GET['intro_cmdDel']); $intro_cmdDel = empty($_GET['intro_cmdDel']) ? '' : $_GET['intro_cmdDel'];
$intro_cmdAdd= (empty($_GET['intro_cmdAdd'])?'':$_GET['intro_cmdAdd']); $intro_cmdAdd = empty($_GET['intro_cmdAdd']) ? '' : $_GET['intro_cmdAdd'];
if (!empty ($GLOBALS["_cid"])) { if (!empty ($GLOBALS['_cid'])) {
$form = new FormValidator('introduction_text', 'post', api_get_self()."?".api_get_cidreq()); $form = new FormValidator('introduction_text', 'post', api_get_self().'?'.api_get_cidreq());
} else { } else {
$form = new FormValidator('introduction_text'); $form = new FormValidator('introduction_text');
} }
@ -84,12 +80,10 @@ if (is_array($editor_config)) {
$form->add_html_editor('intro_content', null, null, false, $editor_config); $form->add_html_editor('intro_content', null, null, false, $editor_config);
$form->addElement('style_submit_button', 'intro_cmdUpdate', get_lang('SaveIntroText'), 'class="save"'); $form->addElement('style_submit_button', 'intro_cmdUpdate', get_lang('SaveIntroText'), 'class="save"');
/* INTRODUCTION MICRO MODULE - COMMANDS SECTION (IF ALLOWED) */
/*=========================================================
INTRODUCTION MICRO MODULE - COMMANDS SECTION (IF ALLOWED)
========================================================*/
if ($intro_editAllowed) { if ($intro_editAllowed) {
/* Replace command */ /* Replace command */
if ($intro_cmdUpdate) { if ($intro_cmdUpdate) {
@ -105,7 +99,6 @@ if ($intro_editAllowed) {
} else { } else {
$intro_cmdDel = true; // got to the delete command $intro_cmdDel = true; // got to the delete command
} }
} else { } else {
$intro_cmdEdit = true; $intro_cmdEdit = true;
} }
@ -117,13 +110,10 @@ if ($intro_editAllowed) {
Database::query("DELETE FROM $TBL_INTRODUCTION WHERE id='".$moduleId."'"); Database::query("DELETE FROM $TBL_INTRODUCTION WHERE id='".$moduleId."'");
Display::display_confirmation_message(get_lang('IntroductionTextDeleted')); Display::display_confirmation_message(get_lang('IntroductionTextDeleted'));
} }
} }
/*=========================================== /* INTRODUCTION MICRO MODULE - DISPLAY SECTION */
INTRODUCTION MICRO MODULE - DISPLAY SECTION
===========================================*/
/* Retrieves the module introduction text, if exist */ /* Retrieves the module introduction text, if exist */
@ -135,9 +125,11 @@ $intro_content = $intro_dbResult['intro_text'];
/* Determines the correct display */ /* Determines the correct display */
if ($intro_cmdEdit || $intro_cmdAdd) { if ($intro_cmdEdit || $intro_cmdAdd) {
$intro_dispDefault = false; $intro_dispDefault = false;
$intro_dispForm = true; $intro_dispForm = true;
$intro_dispCommand = false; $intro_dispCommand = false;
} else { } else {
$intro_dispDefault = true; $intro_dispDefault = true;
@ -148,7 +140,6 @@ if ($intro_cmdEdit || $intro_cmdAdd) {
} else { } else {
$intro_dispCommand = false; $intro_dispCommand = false;
} }
} }
/* Executes the display */ /* Executes the display */
@ -156,7 +147,6 @@ if ($intro_cmdEdit || $intro_cmdAdd) {
if ($intro_dispForm) { if ($intro_dispForm) {
$default['intro_content'] = $intro_content; $default['intro_content'] = $intro_content;
$form->setDefaults($default); $form->setDefaults($default);
//echo '<div id="courseintro">';
echo '<div id="courseintro" style="width: 100%">'; echo '<div id="courseintro" style="width: 100%">';
$form->display(); $form->display();
echo '</div>'; echo '</div>';
@ -188,7 +178,6 @@ if ($tool==TOOL_COURSE_HOMEPAGE && !isset($_GET['intro_cmdEdit'])) {
</div> </div>
<div class="thematic-postit-bottom">'.Display::return_icon('postit_bottom.png').'</div> <div class="thematic-postit-bottom">'.Display::return_icon('postit_bottom.png').'</div>
</div></div>'; </div></div>';
} }
} }
@ -205,9 +194,9 @@ if ($intro_dispCommand) {
if (empty($intro_content)) { if (empty($intro_content)) {
//displays "Add intro" Commands // Displays "Add intro" commands
echo "<div id=\"courseintro\"><p>\n"; echo "<div id=\"courseintro\"><p>\n";
if (!empty ($GLOBALS["_cid"])) { if (!empty ($GLOBALS['_cid'])) {
echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&amp;intro_cmdAdd=1\">\n".get_lang('AddIntro')."</a>\n"; echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&amp;intro_cmdAdd=1\">\n".get_lang('AddIntro')."</a>\n";
} else { } else {
echo "<a href=\"".api_get_self()."?intro_cmdAdd=1\">\n".get_lang('AddIntro')."</a>\n"; echo "<a href=\"".api_get_self()."?intro_cmdAdd=1\">\n".get_lang('AddIntro')."</a>\n";
@ -216,9 +205,9 @@ if ($intro_dispCommand) {
} else { } else {
// displays "edit intro && delete intro" Commands // Displays "edit intro && delete intro" commands
echo "<div id=\"courseintro_icons\"><p>\n"; echo "<div id=\"courseintro_icons\"><p>\n";
if (!empty ($GLOBALS["_cid"])) { if (!empty ($GLOBALS['_cid'])) {
echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&amp;intro_cmdEdit=1\"><img src=\"".api_get_path(WEB_CODE_PATH)."img/edit.gif\" alt=\"".get_lang('Modify')."\" border=\"0\" /></a>\n"; echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&amp;intro_cmdEdit=1\"><img src=\"".api_get_path(WEB_CODE_PATH)."img/edit.gif\" alt=\"".get_lang('Modify')."\" border=\"0\" /></a>\n";
echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&amp;intro_cmdDel=1\" onclick=\"javascript:if(!confirm('".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset))."')) return false;\"><img src=\"".api_get_path(WEB_CODE_PATH)."img/delete.gif\" alt=\"".get_lang('Delete')."\" border=\"0\" /></a>\n"; echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&amp;intro_cmdDel=1\" onclick=\"javascript:if(!confirm('".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset))."')) return false;\"><img src=\"".api_get_path(WEB_CODE_PATH)."img/delete.gif\" alt=\"".get_lang('Delete')."\" border=\"0\" /></a>\n";
} else { } else {
@ -235,5 +224,3 @@ echo '</div>';
echo $thematic_description_html; echo $thematic_description_html;
echo '<div class="clear"></div>'; echo '<div class="clear"></div>';
?>

@ -6,53 +6,20 @@
<body> <body>
<?php // $Id: latex.php,v 1.1 2006/04/05 07:18:46 pcool Exp $ <?php // $Id: latex.php,v 1.1 2006/04/05 07:18:46 pcool Exp $
/* /* For licensing terms, see /license.txt */
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004-2006 Dokeos S.A. /* INIT SECTION */
Copyright (c) 2003 Ghent University (UGent)
Copyright (c) Patrick Cool <patrick.cool@UGent.be>, Ghent University
For a full list of contributors, see "credits.txt". include '../inc/global.inc.php';
The full license can be read in "license.txt".
This program is free software; you can redistribute it and/or /* FUNCTIONS */
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
See the GNU General Public License for more details.
Contact address: Dokeos, 44 rue des palais, B-1030 Brussels, Belgium
Mail: info@dokeos.com
==============================================================================
*/
/*
==============================================================================
INIT SECTION
==============================================================================
*/
include("../inc/global.inc.php");
/*
==============================================================================
FUNCTIONS
==============================================================================
*/
// put your functions here // put your functions here
// if the list gets large, divide them into different sections: // if the list gets large, divide them into different sections:
// display functions, tool logic functions, database functions // display functions, tool logic functions, database functions
// try to place your functions into an API library or separate functions file - it helps reuse // try to place your functions into an API library or separate functions file - it helps reuse
/* /* MAIN CODE */
==============================================================================
MAIN CODE
==============================================================================
*/
$code = Security::remove_XSS($_GET['code']); $code = Security::remove_XSS($_GET['code']);
@ -61,16 +28,13 @@ echo '<h3>'.get_lang('LatexCode').'</h3>';
echo stripslashes($code); echo stripslashes($code);
echo '</div>'; echo '</div>';
echo '<div id="latex_image">'; echo '<div id="latex_image">';
echo '<h3>'.get_lang('LatexFormula').'</h3>'; echo '<h3>'.get_lang('LatexFormula').'</h3>';
echo '<img src="'.api_get_path(WEB_COURSE_PATH).$_course['path'].'/temp/'.$code.'" alt="'.get_lang('LatexCode').'"/>'; echo '<img src="'.api_get_path(WEB_COURSE_PATH).$_course['path'].'/temp/'.$code.'" alt="'.get_lang('LatexCode').'"/>';
echo '</div>'; echo '</div>';
/*
============================================================================== /* FOOTER */
FOOTER
==============================================================================
*/
?> ?>
</body> </body>
</html> </html>

@ -4,7 +4,7 @@
* *
* SCRIPT PURPOSE * SCRIPT PURPOSE
* *
* This script initializes and manages Dokeos session information. It * This script initializes and manages Chamilo session information. It
* keeps available session information up to date. * keeps available session information up to date.
* *
* You can request a course id. It will check if the course Id requested is the * You can request a course id. It will check if the course Id requested is the
@ -232,7 +232,7 @@ if (api_get_setting('allow_terms_conditions')=='true') {
$uData = Database::fetch_array($result); $uData = Database::fetch_array($result);
if ($uData['auth_source'] == PLATFORM_AUTH_SOURCE) { if ($uData['auth_source'] == PLATFORM_AUTH_SOURCE) {
//the authentification of this user is managed by Dokeos itself //the authentification of this user is managed by Chamilo itself
$password = trim(stripslashes($password)); $password = trim(stripslashes($password));
// determine if the password needs to be encrypted before checking // determine if the password needs to be encrypted before checking
// $userPasswordCrypted is set in an external configuration file // $userPasswordCrypted is set in an external configuration file
@ -343,10 +343,10 @@ if (api_get_setting('allow_terms_conditions')=='true') {
// see configuration.php to define these // see configuration.php to define these
include_once($extAuthSource[$key]['login']); include_once($extAuthSource[$key]['login']);
/* >>>>>>>> External authentication modules <<<<<<<<< */ /* >>>>>>>> External authentication modules <<<<<<<<< */
} else // no standard Dokeos login - try external authentification } else // no standard Chamilo login - try external authentification
{ {
//huh... nothing to do... we shouldn't get here //huh... nothing to do... we shouldn't get here
error_log('Dokeos Authentication file '. $extAuthSource[$uData['auth_source']]['login']. ' could not be found - this might prevent your system from doing the corresponding authentication process',0); error_log('Chamilo Authentication file '. $extAuthSource[$uData['auth_source']]['login']. ' could not be found - this might prevent your system from doing the corresponding authentication process',0);
} }
if (!empty($_SESSION['request_uri'])) { if (!empty($_SESSION['request_uri'])) {
@ -403,7 +403,7 @@ if (api_get_setting('allow_terms_conditions')=='true') {
* - Implement user interface for api_get_setting('sso_authentication') * - Implement user interface for api_get_setting('sso_authentication')
* } elseif (api_get_setting('sso_authentication')=='true') { * } elseif (api_get_setting('sso_authentication')=='true') {
* - Work on a better validation for webservices paths. Current is very poor and exit * - Work on a better validation for webservices paths. Current is very poor and exit
* - $master variable should be recovered from dokeos settings. * - $master variable should be recovered from chamilo settings.
*/ */
$master = array( $master = array(
'domain' => api_get_setting('sso_authentication_domain'), // 'localhost/project/drupal5', 'domain' => api_get_setting('sso_authentication_domain'), // 'localhost/project/drupal5',

@ -1,17 +1,15 @@
<?php <?php
/* For licensing terms, see /license.txt */
/** /**
==============================================================================
* This script displays the Dokeos header up to the </head> tag * This script displays the Dokeos header up to the </head> tag
* IT IS A COPY OF header.inc.php EXCEPT that it doesn't start the body * IT IS A COPY OF header.inc.php EXCEPT that it doesn't start the body
* output. * output.
* *
* @package dokeos.include * @package chamilo.include
==============================================================================
*/ */
/*---------------------------------------- /* HEADERS SECTION */
HEADERS SECTION
--------------------------------------*/
/* /*
* HTTP HEADER * HTTP HEADER
@ -19,10 +17,8 @@
header('Content-Type: text/html; charset='.api_get_system_encoding()); header('Content-Type: text/html; charset='.api_get_system_encoding());
if ( isset($httpHeadXtra) && $httpHeadXtra ) if (isset($httpHeadXtra) && $httpHeadXtra) {
{ foreach ($httpHeadXtra as & $thisHttpHead) {
foreach($httpHeadXtra as $thisHttpHead)
{
header($thisHttpHead); header($thisHttpHead);
} }
} }
@ -33,18 +29,17 @@ $document_language = api_get_language_isocode();
/* /*
* HTML HEADER * HTML HEADER
*/ */
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $document_language; ?>" lang="<?php echo $document_language; ?>"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $document_language; ?>" lang="<?php echo $document_language; ?>">
<head> <head>
<title> <title>
<?php <?php
if(!empty($nameTools)) if (!empty($nameTools)) {
{
echo $nameTools.' - '; echo $nameTools.' - ';
} }
if(!empty($_course['official_code'])) if (!empty($_course['official_code'])) {
{
echo $_course['official_code'].' - '; echo $_course['official_code'].' - ';
} }
@ -60,40 +55,32 @@ echo api_get_setting('siteName');
$platform_theme = api_get_setting('stylesheets'); // plataform's css $platform_theme = api_get_setting('stylesheets'); // plataform's css
$my_style = $platform_theme; $my_style = $platform_theme;
if (api_get_setting('user_selected_theme') == 'true') if (api_get_setting('user_selected_theme') == 'true') {
{
$useri = api_get_user_info(); $useri = api_get_user_info();
$user_theme = $useri['theme']; $user_theme = $useri['theme'];
if(!empty($user_theme) && $user_theme != $my_style) if (!empty($user_theme) && $user_theme != $my_style) {
{
$my_style = $user_theme; // user's css $my_style = $user_theme; // user's css
} }
} }
$mycourseid = api_get_course_id(); $mycourseid = api_get_course_id();
if (!empty($mycourseid) && $mycourseid != -1) if (!empty($mycourseid) && $mycourseid != -1) {
{ if (api_get_setting('allow_course_theme') == 'true') {
if (api_get_setting('allow_course_theme') == 'true')
{
$mycoursetheme=api_get_course_setting('course_theme'); $mycoursetheme=api_get_course_setting('course_theme');
if (!empty($mycoursetheme) && $mycoursetheme!=-1) if (!empty($mycoursetheme) && $mycoursetheme != -1) {
{ if (!empty($mycoursetheme) && $mycoursetheme != $my_style) {
if(!empty($mycoursetheme) && $mycoursetheme != $my_style)
{
$my_style = $mycoursetheme; // course's css $my_style = $mycoursetheme; // course's css
} }
} }
$mycourselptheme=api_get_course_setting('allow_learning_path_theme'); $mycourselptheme=api_get_course_setting('allow_learning_path_theme');
if (!empty($mycourselptheme) && $mycourselptheme!=-1 && $mycourselptheme== 1) if (!empty($mycourselptheme) && $mycourselptheme != -1 && $mycourselptheme == 1) {
{
global $lp_theme_css; // it comes from the lp_controller.php global $lp_theme_css; // it comes from the lp_controller.php
global $lp_theme_config; // it comes from the lp_controller.php global $lp_theme_config; // it comes from the lp_controller.php
if (!empty($lp_theme_css)) if (!empty($lp_theme_css))
{ {
$theme=$lp_theme_css; $theme=$lp_theme_css;
if(!empty($theme) && $theme != $my_style) if (!empty($theme) && $theme != $my_style) {
{
$my_style = $theme; // LP's css $my_style = $theme; // LP's css
} }
} }
@ -107,29 +94,22 @@ if (!empty($lp_theme_log)){
} }
// Sets the css reference it is call from lp_nav.php, lp_toc.php, lp_message, lp_log.php // Sets the css reference it is call from lp_nav.php, lp_toc.php, lp_message, lp_log.php
if (!empty($scorm_css_header)) if (!empty($scorm_css_header)) {
{ if (!empty($my_style)) {
if (!empty($my_style)) $scorm_css = api_get_path(WEB_CSS_PATH).$my_style.'/scorm.css';
{ $scormfs_css = api_get_path(WEB_CSS_PATH).$my_style.'/scormfs.css';
$scorm_css=api_get_path(WEB_CODE_PATH).'css/'.$my_style.'/scorm.css'; } else {
$scormfs_css=api_get_path(WEB_CODE_PATH).'css/'.$my_style.'/scormfs.css';
}
else
{
$scorm_css = 'scorm.css'; $scorm_css = 'scorm.css';
$scormfs_css = 'scormfs.css'; $scormfs_css = 'scormfs.css';
} }
if(!empty($display_mode) && $display_mode == 'fullscreen') if (!empty($display_mode) && $display_mode == 'fullscreen') {
{
$htmlHeadXtra[] = '<style type="text/css" media="screen, projection"> $htmlHeadXtra[] = '<style type="text/css" media="screen, projection">
/*<![CDATA[*/ /*<![CDATA[*/
@import "'.$scormfs_css.'"; @import "'.$scormfs_css.'";
/*]]>*/ /*]]>*/
</style>'; </style>';
} } else {
else
{
$htmlHeadXtra[] = '<style type="text/css" media="screen, projection"> $htmlHeadXtra[] = '<style type="text/css" media="screen, projection">
/*<![CDATA[*/ /*<![CDATA[*/
@import "'.$scorm_css.'"; @import "'.$scorm_css.'";
@ -139,12 +119,11 @@ if (!empty($scorm_css_header))
} }
if($my_style!='') if ($my_style != '') {
{
?> ?>
<style type="text/css" media="screen, projection"> <style type="text/css" media="screen, projection">
/*<![CDATA[*/ /*<![CDATA[*/
@import "<?php echo api_get_path(WEB_CODE_PATH); ?>css/<?php echo $my_style;?>/default.css"; @import "<?php echo api_get_path(WEB_CSS_PATH), $my_style; ?>/default.css";
/*]]>*/ /*]]>*/
</style> </style>
<?php <?php
@ -188,11 +167,9 @@ if ( ( navigator.userAgent.toLowerCase().indexOf('msie') != -1 ) && ( navigator.
</script> </script>
<?php <?php
if ( isset($htmlHeadXtra) && $htmlHeadXtra ) if (isset($htmlHeadXtra) && $htmlHeadXtra) {
{ foreach ($htmlHeadXtra as & $this_html_head) {
foreach($htmlHeadXtra as $this_html_head) echo $this_html_head;
{
echo($this_html_head);
} }
} }
?> ?>

@ -1,82 +1,66 @@
<?php <?php
// $Id: tool_navigation_menu.inc.php 22072 2009-07-14 15:14:42Z jhp1411 $ /* For licensing terms, see /license.txt */
/* For licensing terms, see /chamilo_license.txt */
/** /**
==============================================================================
* Navigation menu display code * Navigation menu display code
* *
* @package dokeos.include * @package dokeos.include
==============================================================================
*/ */
define('SHORTCUTS_HORIZONTAL', 0); define('SHORTCUTS_HORIZONTAL', 0);
define('SHORTCUTS_VERTICAL', 1); define('SHORTCUTS_VERTICAL', 1);
/** /**
* Build the navigation items to show in a course menu * Build the navigation items to show in a course menu
* @param boolean $include_admin_tools * @param boolean $include_admin_tools
*/ */
function get_navigation_items($include_admin_tools = false) function get_navigation_items($include_admin_tools = false) {
{
global $is_courseMember; global $is_courseMember;
global $_user; global $_user;
global $_course; global $_course;
if (!empty($_course['db_name'])) if (!empty($_course['db_name'])) {
{
$database = $_course['db_name']; $database = $_course['db_name'];
} }
$navigation_items = array (); $navigation_items = array ();
$course_id = api_get_course_id(); $course_id = api_get_course_id();
if (!empty ($course_id) && ($course_id != -1)) if (!empty($course_id) && $course_id != -1) {
{
$user_id = api_get_user_id(); $user_id = api_get_user_id();
$course_tools_table = Database :: get_course_table(TABLE_TOOL_LIST,$database); $course_tools_table = Database :: get_course_table(TABLE_TOOL_LIST,$database);
/* /* Link to the Course homepage */
--------------------------------------------------------------
Link to the Course homepage
--------------------------------------------------------------
*/
$navigation_items['home']['image'] = 'home.gif'; $navigation_items['home']['image'] = 'home.gif';
$navigation_items['home']['link'] = api_get_path(REL_COURSE_PATH).Security::remove_XSS($_SESSION['_course']['path']).'/index.php'; $navigation_items['home']['link'] = api_get_path(REL_COURSE_PATH).Security::remove_XSS($_SESSION['_course']['path']).'/index.php';
$navigation_items['home']['name'] = get_lang('CourseHomepageLink'); $navigation_items['home']['name'] = get_lang('CourseHomepageLink');
/* /* Link to the different tools */
--------------------------------------------------------------
Link to the different tools
--------------------------------------------------------------
*/
$sql_menu_query = "SELECT * FROM $course_tools_table WHERE visibility='1' and admin='0' ORDER BY id ASC"; $sql_menu_query = "SELECT * FROM $course_tools_table WHERE visibility='1' and admin='0' ORDER BY id ASC";
$sql_result = Database::query($sql_menu_query); $sql_result = Database::query($sql_menu_query);
while ($row = Database::fetch_array($sql_result)) while ($row = Database::fetch_array($sql_result)) {
{
$navigation_items[$row['id']] = $row; $navigation_items[$row['id']] = $row;
/* /*
if (!stristr($row['link'], 'http://')) if (!stristr($row['link'], 'http://'))
*/ */
if (stripos($row['link'], 'http://') === false && stripos($row['link'], 'https://') === false) if (stripos($row['link'], 'http://') === false && stripos($row['link'], 'https://') === false) {
{
$navigation_items[$row['id']]['link'] = api_get_path(REL_CODE_PATH).$row['link']; $navigation_items[$row['id']]['link'] = api_get_path(REL_CODE_PATH).$row['link'];
/* /*
$navigation_items[$row['id']]['name'] = $row['image'] == 'scormbuilder.gif' ? $navigation_items[$row['id']]['name'] : get_lang(ucfirst($navigation_items[$row['id']]['name'])); $navigation_items[$row['id']]['name'] = $row['image'] == 'scormbuilder.gif' ? $navigation_items[$row['id']]['name'] : get_lang(ucfirst($navigation_items[$row['id']]['name']));
*/ */
if ($row['image'] != 'scormbuilder.gif' && $row['image'] != 'blog.gif') if ($row['image'] != 'scormbuilder.gif' && $row['image'] != 'blog.gif') {
{
$navigation_items[$row['id']]['name'] = get_lang(ucfirst($navigation_items[$row['id']]['name'])); $navigation_items[$row['id']]['name'] = get_lang(ucfirst($navigation_items[$row['id']]['name']));
} }
} }
} }
/*
-------------------------------------------------------------- /* Admin (edit rights) only links
Admin (edit rights) only links
- Course settings (course admin only) - Course settings (course admin only)
- Course rights (roles & rights overview) - Course rights (roles & rights overview) */
--------------------------------------------------------------
*/
if ($include_admin_tools) { if ($include_admin_tools) {
$course_settings_sql = "SELECT name,image FROM $course_tools_table $course_settings_sql = "SELECT name,image FROM $course_tools_table
@ -108,8 +92,7 @@ function get_navigation_items($include_admin_tools = false)
/** /**
* Show a navigation menu * Show a navigation menu
*/ */
function show_navigation_menu() function show_navigation_menu() {
{
$navigation_items = get_navigation_items(true); $navigation_items = get_navigation_items(true);
$course_id = api_get_course_id(); $course_id = api_get_course_id();
if (api_get_setting('show_navigation_menu') == 'icons') { if (api_get_setting('show_navigation_menu') == 'icons') {
@ -186,26 +169,22 @@ function show_navigation_menu()
$url_item = parse_url($navigation_item['link']); $url_item = parse_url($navigation_item['link']);
$url_current = parse_url($_SERVER['REQUEST_URI']); $url_current = parse_url($_SERVER['REQUEST_URI']);
if (strpos($navigation_item['link'],'chat')!==false && api_get_course_setting('allow_open_chat_window',$course_id)==true) { if (strpos($navigation_item['link'], 'chat') !== false && api_get_course_setting('allow_open_chat_window', $course_id)) {
echo '<a href="javascript: void(0);" onclick="window.open(\''.$navigation_item['link'].'\',\'window_chat'.$_SESSION['_cid'].'\',config=\'height=\'+380+\', width=\'+625+\', left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no\')" target="' . $navigation_item['target'] . '"'; echo '<a href="javascript: void(0);" onclick="javascript: window.open(\''.$navigation_item['link'].'\',\'window_chat'.$_SESSION['_cid'].'\',config=\'height=\'+380+\', width=\'+625+\', left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no\')" target="' . $navigation_item['target'] . '"';
} else { } else {
echo '<a href="'.$navigation_item['link'].'" target="_top" '; echo '<a href="'.$navigation_item['link'].'" target="_top" ';
} }
if (stristr($url_item['path'],$url_current['path'])) if (stristr($url_item['path'], $url_current['path'])) {
{ if (!isset($_GET['learnpath_id']) || strpos($url_item['query'],'learnpath_id='.$_GET['learnpath_id']) === 0) {
if(! isset($_GET['learnpath_id']) || strpos($url_item['query'],'learnpath_id='.$_GET['learnpath_id']) === 0)
{
echo ' id="here"'; echo ' id="here"';
} }
} }
echo ' title="'.$navigation_item['name'].'">'; echo ' title="'.$navigation_item['name'].'">';
if (api_get_setting('show_navigation_menu') != 'text') if (api_get_setting('show_navigation_menu') != 'text') {
{
echo '<div align="left"><img src="'.api_get_path(WEB_IMG_PATH).$navigation_item['image'].'" alt="'.$navigation_item['name'].'"/></div>'; echo '<div align="left"><img src="'.api_get_path(WEB_IMG_PATH).$navigation_item['image'].'" alt="'.$navigation_item['name'].'"/></div>';
} }
if (api_get_setting('show_navigation_menu') != 'icons') if (api_get_setting('show_navigation_menu') != 'icons') {
{
echo $navigation_item['name']; echo $navigation_item['name'];
} }
echo '</a>'; echo '</a>';
@ -229,11 +208,10 @@ function show_navigation_menu()
/** /**
* Show a toolbar with shortcuts to the course tool * Show a toolbar with shortcuts to the course tool
*/ */
function show_navigation_tool_shortcuts($orientation = SHORTCUTS_HORIZONTAL) function show_navigation_tool_shortcuts($orientation = SHORTCUTS_HORIZONTAL) {
{
$navigation_items = get_navigation_items(false); $navigation_items = get_navigation_items(false);
foreach ($navigation_items as $key => $navigation_item) { foreach ($navigation_items as $key => $navigation_item) {
if (strpos($navigation_item['link'],'chat')!==false && api_get_course_setting('allow_open_chat_window')==true) { if (strpos($navigation_item['link'],'chat') !== false && api_get_course_setting('allow_open_chat_window')) {
/* /*
echo '<a href="#" onclick="window.open(\''.$navigation_item['link'].'\',\'window_chat'.$_SESSION['_cid'].'\',config=\'height=\'+380+\', width=\'+625+\', left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no\')" target="' . $navigation_item['target'] . '"'; echo '<a href="#" onclick="window.open(\''.$navigation_item['link'].'\',\'window_chat'.$_SESSION['_cid'].'\',config=\'height=\'+380+\', width=\'+625+\', left=2, top=2, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no\')" target="' . $navigation_item['target'] . '"';
*/ */
@ -253,4 +231,3 @@ function show_navigation_tool_shortcuts($orientation = SHORTCUTS_HORIZONTAL)
} }
} }
} }
?>
Loading…
Cancel
Save