@ -71,9 +71,8 @@ function get_course_data($from, $number_of_items, $column, $direction)
$course_table = Database :: get_main_table(TABLE_MAIN_COURSE);
$users_table = Database :: get_main_table(TABLE_MAIN_USER);
$course_users_table = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
$sql = "SELECT code AS col0, visual_code AS col1, title AS col2, course_language AS col3, category_code AS col4, subscribe AS col5, unsubscribe AS col6, code AS col7, tutor_name as col8, code AS col9, visibility AS col10,directory as col11 FROM $course_table";
$sql = "SELECT code AS col0, visual_code AS col1, title AS col2, course_language AS col3, category_code AS col4, subscribe AS col5, unsubscribe AS col6, tutor_name as col7, code AS col8, visibility AS col9,directory as col10 FROM $course_table";
//$sql = "SELECT code AS col0, visual_code AS col1, title AS col2, course_language AS col3, category_code AS col4, subscribe AS col5, unsubscribe AS col6, code AS col7, tutor_name as col8, code AS col9, visibility AS col10,directory as col11 FROM $course_table";
global $_configuration;
if ((api_is_platform_admin() || api_is_session_admin()) & & $_configuration['multiple_access_urls']==true & & api_get_current_access_url_id()!=-1) {
$access_url_rel_course_table = Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
@ -109,12 +108,12 @@ function get_course_data($from, $number_of_items, $column, $direction)
while ($course = Database::fetch_row($res))
{
//place colour icons in front of courses
$course[1] = get_course_visibility_icon($course[10]).'< a href = "'.api_get_path(WEB_COURSE_PATH).$course[11].'/index.php" > '.$course[1].'< / a > ';
$course[1] = get_course_visibility_icon($course[9]).'< a href = "'.api_get_path(WEB_COURSE_PATH).$course[9].'/index.php" > '.$course[1].'< / a > ';
$course[5] = $course[5] == SUBSCRIBE_ALLOWED ? get_lang('Yes') : get_lang('No');
$course[6] = $course[6] == UNSUBSCRIBE_ALLOWED ? get_lang('Yes') : get_lang('No');
$course[7] = CourseManager :: is_virtual_course_from_system_code($course[7]) ? get_lang('Yes') : get_lang('No');
$course_rem = array($course[0],$course[1],$course[2],$course[3],$course[4],$course[5],$course[6],$course[7],$course[8],$course[9]);
//$course[7] = CourseManager :: is_virtual_course_from_system_code($course[7]) ? get_lang('Yes') : get_lang('No');
//$course_rem = array($course[0],$course[1],$course[2],$course[3],$course[4],$course[5],$course[6],$course[7],$course[8],$course[9]);
$course_rem = array($course[0],$course[1],$course[2],$course[3],$course[4],$course[5],$course[6],$course[7],$course[8]);
$courses[] = $course_rem;
}
return $courses;
@ -125,15 +124,15 @@ function get_course_data($from, $number_of_items, $column, $direction)
function modify_filter($code)
{
global $charset;
return
return
'< a href = "course_information.php?code='.$code.'" > '.Display::return_icon('synthese_view.gif', get_lang('Info')).'< / a > '.
//'< a href = "../course_home/course_home.php?cidReq='.$code.'" > '.Display::return_icon('course_home.gif', get_lang('CourseHomepage')).'< / a > '. // This is not the preferable way to go to the homepage.
'< a href = "'.api_get_path(WEB_COURSE_PATH).$code.'/index.php" > '.Display::return_icon('course_home.gif', get_lang('CourseHomepage')).'< / a > '.
'< a href = "../coursecopy/backup.php?cidReq='.$code.'" > '.Display::return_icon('backup.gif', get_lang('CreateBackup')).'< / a > '.
'< a href = "../tracking/courseLog.php?cidReq='.$code.'" > '.Display::return_icon('statistics.gif', get_lang('Tracking')).'< / a > '.
'< a href = "course_edit.php?course_code='.$code.'" > '.Display::return_icon('edit.gif', get_lang('Edit')).'< / a > '.
'< a href = "course_list.php?delete_course='.$code.'" onclick = "javascript:if(!confirm('." ' " . addslashes ( api_htmlentities ( get_lang ( " ConfirmYourChoice " ) , ENT_QUOTES , $ charset ) ) . " ' " . ' ) ) return false ; " > '.Display::return_icon('delete.gif', get_lang('Delete')).'< / a > ';
}
/**
* Return an icon representing the visibility of the course
@ -283,11 +282,11 @@ else
$table->set_header(3, get_lang('Language'));
$table->set_header(4, get_lang('Category'));
$table->set_header(5, get_lang('SubscriptionAllowed'));
$table->set_header(6, get_lang('UnsubscriptionAllowed'));
$table->set_header(7, get_lang('IsVirtualCourse'));
$table->set_header(8 , get_lang('Teacher'));
$table->set_header(9, get_lang('Action'), false,'width="120 px"');
$table->set_column_filter(9 ,'modify_filter');
$table->set_header(6, get_lang('UnsubscriptionAllowed'),false,'width="50px"' );
// $table->set_header(7, get_lang('IsVirtualCourse'));
$table->set_header(7 , get_lang('Teacher'));
$table->set_header(8, get_lang('Action'), false,'width="125 px"');
$table->set_column_filter(8 ,'modify_filter');
$table->set_form_actions(array ('delete_courses' => get_lang('DeleteCourse')),'course');
$table->display();
}