From e936a7d363debc4638dec315bb10b900e4697e77 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Thu, 20 Mar 2014 19:07:23 +0100 Subject: [PATCH] Minor - format code. --- main/gradebook/index.php | 40 +++++++++++++------ .../gradebook/lib/fe/gradebooktable.class.php | 4 +- 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/main/gradebook/index.php b/main/gradebook/index.php index ca1c4c9c57..359b5ef08b 100644 --- a/main/gradebook/index.php +++ b/main/gradebook/index.php @@ -763,20 +763,23 @@ if (api_is_allowed_to_edit(null, true)) { if (isset($first_time) && $first_time==1 && api_is_allowed_to_edit(null,true)) { echo ''; } else { - $cats = Category :: load(null, null, $course_code, null, null, $session_id, false); //already init + $cats = Category::load(null, null, $course_code, null, null, $session_id, false); if (!empty($cats)) { + if ((api_get_setting('gradebook_enable_grade_model') == 'true') && + (api_is_platform_admin() || (api_is_allowed_to_edit(null, true) && + api_get_setting('teachers_can_change_grade_model_settings') == 'true')) + ) { - if ( (api_get_setting('gradebook_enable_grade_model') == 'true') && - (api_is_platform_admin() || (api_is_allowed_to_edit(null, true) && api_get_setting('teachers_can_change_grade_model_settings') == 'true'))) { - - //Getting grade models + // Getting grade models. $obj = new GradeModel(); $grade_models = $obj->get_all(); $grade_model_id = $cats[0]->get_grade_model_id(); - //No children - if ( (count($cats) == 1 && empty($grade_model_id)) || (count($cats) == 1 && $grade_model_id != -1) ) { + // No children. + if ((count($cats) == 1 && empty($grade_model_id)) || + (count($cats) == 1 && $grade_model_id != -1) + ) { if (!empty($grade_models)) { $form_grade = new FormValidator('grade_model_settings'); $obj->fill_grade_model_select_in_form($form_grade, 'grade_model_id', $grade_model_id); @@ -823,14 +826,27 @@ if (isset($first_time) && $first_time==1 && api_is_allowed_to_edit(null,true)) { $alleval = $cat->get_evaluations($stud_id); $alllink = $cat->get_links($stud_id,true); - if ($cat->get_parent_id() != 0 ) { + if ($cat->get_parent_id() != 0) { $i++; } else { - //This is the father - //Create gradebook/add gradebook links - DisplayGradebook::display_header_gradebook($cat, 0, $cat->get_id(), $is_course_admin, $is_platform_admin, $simple_search_form, false, true); - if (api_is_allowed_to_edit(null,true) && api_get_setting('gradebook_enable_grade_model') == 'true') { + // This is the father + // Create gradebook/add gradebook links. + + DisplayGradebook::display_header_gradebook( + $cat, + 0, + $cat->get_id(), + $is_course_admin, + $is_platform_admin, + $simple_search_form, + false, + true + ); + + if (api_is_allowed_to_edit(null,true) && + api_get_setting('gradebook_enable_grade_model') == 'true' + ) { //Showing the grading system if (!empty($grade_models[$grade_model_id])) { Display::display_normal_message(get_lang('GradeModel').': '.$grade_models[$grade_model_id]['name']); diff --git a/main/gradebook/lib/fe/gradebooktable.class.php b/main/gradebook/lib/fe/gradebooktable.class.php index 94618f8650..22a434a8bc 100644 --- a/main/gradebook/lib/fe/gradebooktable.class.php +++ b/main/gradebook/lib/fe/gradebooktable.class.php @@ -297,10 +297,10 @@ class GradebookTable extends SortableTable { $row[] = $this->build_type_column($item, array('style' => 'padding-left:5px')); - //Name + // Name. $row[] = $invisibility_span_open."    ".$this->build_name_link($item) . $invisibility_span_close; - //Description + // Description. $row[] = $invisibility_span_open.$data[2].$invisibility_span_close; //Weight