Feature #5397 - A sample of code cleaning.

skala
Ivan Tcholakov 16 years ago
parent d7693cd7df
commit 5b44dc53c8
  1. 39
      main/auth/course_description.php

@ -15,12 +15,13 @@
INIT SECTION
==============================================================================
*/
// name of the language file that needs to be included
$language_file = array ('course_description');
require_once '../inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH).'course.lib.php';
include_once('../inc/reduced_header.inc.php');
// Name of the language file that needs to be included.
$language_file = array ('course_description');
require_once '../inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH).'course.lib.php';
require_once api_get_path(INCLUDE_PATH).'reduced_header.inc.php' ;
/*
==============================================================================
@ -28,24 +29,20 @@
==============================================================================
*/
function show_course_description() {
global $charset;
// get the name of the database course
$database_course = CourseManager::get_name_database_course($_GET['code']);
$tbl_course_description = Database::get_course_table(TABLE_COURSE_DESCRIPTION, $database_course);
function show_course_description() {
$sql = "SELECT * FROM $tbl_course_description ORDER BY id";
$result = Database::query($sql, __FILE__, __LINE__);
while ($description = Database::fetch_object($result)) {
$descriptions[$description->id] = $description;
}
// Get the name of the database course.
$database_course = CourseManager::get_name_database_course($_GET['code']);
$tbl_course_description = Database::get_course_table(TABLE_COURSE_DESCRIPTION, $database_course);
// function that displays the details of the course description in html
$course_description_html = CourseManager::get_details_course_description_html($descriptions, $charset, false);
return $course_description_html;
$sql = "SELECT * FROM $tbl_course_description ORDER BY id";
$result = Database::query($sql, __FILE__, __LINE__);
while ($description = Database::fetch_object($result)) {
$descriptions[$description->id] = $description;
}
echo show_course_description();
// Function that displays the details of the course description in html.
return CourseManager::get_details_course_description_html($descriptions, api_get_system_encoding(), false);
}
?>
echo show_course_description();

Loading…
Cancel
Save