Show index.php syntax highlighted
<?php // $Id: index.php 114 2005-07-26 14:57:31Z roane $
/*
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004 Dokeos S.A.
Copyright (c) 2003 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
Copyright (c) Roan Embrechts, Vrije Universiteit Brussel
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
This program is free software; you can redistribute it and/or
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
==============================================================================
*/
/**
==============================================================================
* This script displays the course description to the user.
*
* If the user has editing rights (course admin), (s)he can edit the description.
*
* Proposals (not implemented yet)
* - edit the colour of the description background (Thierry De Henau)
* - one block is linked with the agenda tool. To propose a big step in the course.
* - one block is linked with the link tool. To propose important resources in the course.
*
* @author Thomas Depraetere
* @author Hugues Peeters
* @author Christophe Gesche
* @author Olivier brouckaert
* @author Wolfgang Schneider
* @author Roan Embrechts
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
* @package dokeos.course_description
==============================================================================
*/
/*
==============================================================================
FUNCTIONS
==============================================================================
*/
function get_course_description_link_html($system_code, $visual_code)
{
//cut first three characters
$vub_start = substr($system_code, 0, 3);
$vub_oocode = substr($visual_code, 3, strlen($visual_code));
if ($vub_start == VUB)
{
$hyperlink_url = "http://aiv.vub.ac.be/opaweb/index?page=variantoo&omaNummer="
.$vub_oocode
."&doelgroep=TS";
$oofiche_naam = "OOfiche ";
//old: both link in current and in new windows
//$oofiche_link = $visual_code . " - <a href=" . $hyperlink_url . " target=\"_top\">Lees de opleidingsonderdeelfiche</a> of lees ze <a href=" . $hyperlink_url . " target=\"_blank\">in een nieuw venster</a>.<br/>";
//NOT INTERNATIONALISED CODE:
//sorry, next string is not translated yet
$oofiche_link = $visual_code . " - <a href=" . $hyperlink_url . " target=\"_top\">Lees de opleidingsonderdeelfiche</a>.<br/>";
//END NOT INTERNATIONALISED CODE
return $oofiche_link;
}
}
function display_vub_specific_official_course_description_link($user_id, $course_info)
{
$real_course_id = $course_info["course_id"];
$real_system_code = $course_info["official_code"];
$real_visual_code = $course_info["visual_code"];
$virtual_course_list = CourseManager::get_list_of_virtual_courses_for_specific_user_and_real_course($user_id, $real_course_id);
$message .= "<li>" . get_course_description_link_html($real_system_code, $real_visual_code) . "</li>";
if ( isset($virtual_course_list) )
{
foreach($virtual_course_list as $virtual_course)
{
$virtual_course_info = Database::generate_abstract_course_field_names($virtual_course);
$message .= "<li>" . get_course_description_link_html($virtual_course_info["official_code"], $virtual_course_info["visual_code"]) . "</li>";
}
}
//NOT INTERNATIONALISED CODE
//Display::display_normal_message("<strong>Officiële opleidingsonderdeelfiches</strong><ul>" . $message . "</ul>");
echo "<strong>Officiële opleidingsonderdeelfiches</strong><ul>" . $message . "</ul>";
//END NOT INTERNATIONALISED CODE
echo "<br/><br/>";
}
/*
==============================================================================
INIT SECTION
==============================================================================
*/
$langFile = "course_description";
include('../inc/claro_init_global.inc.php');
api_protect_course_script();
/*
-----------------------------------------------------------
Libraries
-----------------------------------------------------------
*/
include_once(api_get_library_path()."/course.lib.php");
include_once(api_get_library_path()."/text.lib.php");
include_once(api_get_library_path()."/events.lib.inc.php");
/*
==============================================================================
MAIN CODE
==============================================================================
*/
$nameTools=get_lang('CourseProgram');
if ($origin != 'learnpath')
{
//we are not in learnpath tool
Display::display_header($nameTools,"Description");
}
else
{
//there has to be a better way than this?
?> <link rel="stylesheet" type="text/css" href="<?php echo api_get_path(WEB_CODE_PATH); ?>css/default.css"/>
<?php
}
event_access_tool(TOOL_COURSE_DESCRIPTION);
$course_description_table = Database::get_course_table(COURSE_DESCRIPTION_TABLE);
$is_allowed_to_edit = api_is_allowed_to_edit();
$course_info = Database::get_course_info_from_code($_course['id']);
display_vub_specific_official_course_description_link($_uid, $course_info);
api_display_tool_title($nameTools);
/*
-----------------------------------------------------------
Introduction section
(editable by course admins)
-----------------------------------------------------------
*/
//api_introductionsection(TOOL_COURSE_DESCRIPTION);
if($is_allowed_to_edit and ($origin != 'learnpath'))
{
echo "<p><a href=\"edit.php\">" . get_lang("EditCourseProgram") . "</a></p>";
}
$result = api_sql_query("SELECT `id`,`title`,`content` FROM ".$course_description_table." ORDER BY id",__FILE__,__LINE__);
if(mysql_num_rows($result))
{
echo "<hr noshade=\"noshade\" size=\"1\" />";
while($row=mysql_fetch_array($result))
{
echo "<h4>$row[title]</h4>";
$content=make_clickable(nl2br($row['content']));
$content=api_parse_tex($content);
echo $content;
}
}
else
{
echo "<br/><em>".get_lang("ThisCourseDescriptionIsEmpty")."</em>";
}
/*
==============================================================================
FOOTER
==============================================================================
*/
if ($origin != 'learnpath')
{
//we are not in learnpath tool
Display::display_footer();
}
?>
See more files for this project here