Removing old table code see #3675

skala
Julio Montoya 14 years ago
parent 079b398179
commit 57ea6f13cd
  1. 11
      main/inc/lib/display.lib.php
  2. 24
      main/user/user.php
  3. 3
      tests/main/inc/lib/display.lib.test.php

@ -69,7 +69,7 @@ class Display {
/** /**
* Display simple html header of table. * Display simple html header of table.
* @deprecated * @deprecated use the HTML_table class
*/ */
/*public static function display_table_header() { /*public static function display_table_header() {
$bgcolor = 'bgcolor="white"'; $bgcolor = 'bgcolor="white"';
@ -89,8 +89,9 @@ class Display {
* @author Roan Embrechts * @author Roan Embrechts
* @version 1.01 * @version 1.01
* @todo remove this function, is only use in user.php * @todo remove this function, is only use in user.php
* @deprecated use the HTML_table class
* @return return type string, bgcolor * @return return type string, bgcolor
*/ *//*
public static function display_complex_table_header($properties, $column_header) { public static function display_complex_table_header($properties, $column_header) {
$width = $properties['width']; $width = $properties['width'];
if (!isset($width)) { if (!isset($width)) {
@ -120,7 +121,7 @@ class Display {
echo "<tbody>\n"; echo "<tbody>\n";
$bgcolor = 'bgcolor="'.HTML_WHITE.'"'; $bgcolor = 'bgcolor="'.HTML_WHITE.'"';
return $bgcolor; return $bgcolor;
} }*/
/** /**
* Displays a table row. * Displays a table row.
@ -130,7 +131,7 @@ class Display {
* @param $is_alternating true: the row colours alternate, false otherwise * @param $is_alternating true: the row colours alternate, false otherwise
* @todo remove this function, is only use in user.php * @todo remove this function, is only use in user.php
*/ */
public static function display_table_row($bgcolor, $table_row, $is_alternating = true) { /*public static function display_table_row($bgcolor, $table_row, $is_alternating = true) {
echo '<tr '.$bgcolor.'>'; echo '<tr '.$bgcolor.'>';
foreach ($table_row as & $table_element) { foreach ($table_row as & $table_element) {
echo '<td>'.$table_element.'</td>'; echo '<td>'.$table_element.'</td>';
@ -144,7 +145,7 @@ class Display {
} }
} }
return $bgcolor; return $bgcolor;
} }*/
/** /**
* Displays a table * Displays a table

@ -22,8 +22,6 @@
/** /**
* Code * Code
*/ */
/* INIT SECTION */
// name of the language file that needs to be included // name of the language file that needs to be included
$language_file = array('registration', 'admin', 'userInfo'); $language_file = array('registration', 'admin', 'userInfo');
$use_anonymous = true; $use_anonymous = true;
@ -216,11 +214,7 @@ if (api_is_allowed_to_edit(null, true)) {
} // end if allowed to edit } // end if allowed to edit
/* /* FUNCTIONS */
==============================================================================
FUNCTIONS
==============================================================================
*/
function display_user_search_form() { function display_user_search_form() {
echo '<form method="get" action="user.php">'; echo '<form method="get" action="user.php">';
@ -239,11 +233,13 @@ function display_user_search_form() {
* @author Roan Embrechts * @author Roan Embrechts
* @todo users from virtual courses always show "-" for the group related output. Edit and statistics columns are disabled * for these users, for now. * @todo users from virtual courses always show "-" for the group related output. Edit and statistics columns are disabled * for these users, for now.
*/ */
/*
function show_users_in_virtual_courses() { function show_users_in_virtual_courses() {
global $_course, $_user, $origin; global $_course, $_user, $origin;
$real_course_code = $_course['sysCode']; $real_course_code = $_course['sysCode'];
$real_course_info = Database::get_course_info($real_course_code); $real_course_info = Database::get_course_info($real_course_code);
$user_subscribed_virtual_course_list = CourseManager::get_list_of_virtual_courses_for_specific_user_and_real_course($_user['user_id'], $real_course_code); $user_subscribed_virtual_course_list = CourseManager::get_list_of_virtual_courses_for_specific_user_and_real_course($_user['user_id'], $real_course_code);
$number_of_virtual_courses = count($user_subscribed_virtual_course_list); $number_of_virtual_courses = count($user_subscribed_virtual_course_list);
$row = 0; $row = 0;
$column_header[$row++] = "ID"; $column_header[$row++] = "ID";
@ -302,17 +298,13 @@ function show_users_in_virtual_courses() {
} }
echo '</tbody></table>'; echo '</tbody></table>';
} }
} }*/
if (!$is_allowed_in_course) { if (!$is_allowed_in_course) {
api_not_allowed(true); api_not_allowed(true);
} }
/* /* Header */
-----------------------------------------------------------
Header
-----------------------------------------------------------
*/
if ($origin != 'learnpath') { if ($origin != 'learnpath') {
if (isset($_GET['keyword']) && !empty($_GET['keyword'])) { if (isset($_GET['keyword']) && !empty($_GET['keyword'])) {
$interbreadcrumb[] = array ("url" => "user.php", "name" => get_lang("Users")); $interbreadcrumb[] = array ("url" => "user.php", "name" => get_lang("Users"));
@ -668,10 +660,10 @@ if (api_get_setting('allow_user_headings') == 'true' && $is_courseAdmin && api_i
} }
//User list of the virtual courses linked to this course. //User list of the virtual courses linked to this course.
//@todo
show_users_in_virtual_courses($is_allowed_to_track); //show_users_in_virtual_courses($is_allowed_to_track);
/* FOOTER */ /* FOOTER */
if ($origin != 'learnpath') { if ($origin != 'learnpath') {
Display::display_footer(); Display::display_footer();
} }

@ -51,6 +51,7 @@ class TestDisplay extends UnitTestCase {
* @param $is_alternating true: the row colours alternate, false otherwise * @param $is_alternating true: the row colours alternate, false otherwise
* @return string color * @return string color
*/ */
/*
public function testdisplay_table_row() { public function testdisplay_table_row() {
$bgcolor = 'red'; $bgcolor = 'red';
$table_row = array(); $table_row = array();
@ -60,7 +61,7 @@ class TestDisplay extends UnitTestCase {
ob_end_clean(); ob_end_clean();
$this->assertTrue(is_string($res)); $this->assertTrue(is_string($res));
//var_dump($res); //var_dump($res);
} }*/
public function testdisplay_sortable_table() { public function testdisplay_sortable_table() {
$header=''; $header='';

Loading…
Cancel
Save