@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | */ |
10 | 10 | class UserForm extends FormValidator |
11 | 11 | { |
12 | - const TYPE_USER_INFO= 1; |
|
12 | + const TYPE_USER_INFO = 1; |
|
13 | 13 | const TYPE_SIMPLE_SEARCH = 3; |
14 | 14 | /** |
15 | 15 | * Builds a form containing form items based on a given parameter |
@@ -19,15 +19,15 @@ discard block |
||
19 | 19 | * @param method |
20 | 20 | * @param action |
21 | 21 | */ |
22 | - public function UserForm($form_type, $user, $form_name, $method= 'post', $action= null) |
|
22 | + public function UserForm($form_type, $user, $form_name, $method = 'post', $action = null) |
|
23 | 23 | { |
24 | 24 | parent :: __construct($form_name, $method, $action); |
25 | - $this->form_type= $form_type; |
|
25 | + $this->form_type = $form_type; |
|
26 | 26 | if (isset ($user)) { |
27 | - $this->user_info= $user; |
|
27 | + $this->user_info = $user; |
|
28 | 28 | } |
29 | 29 | if (isset ($result_object)) { |
30 | - $this->result_object= $result_object; |
|
30 | + $this->result_object = $result_object; |
|
31 | 31 | } |
32 | 32 | if ($this->form_type == self :: TYPE_USER_INFO) { |
33 | 33 | $this->build_user_info_form(); |
@@ -45,9 +45,9 @@ discard block |
||
45 | 45 | 'keyword' => Security::remove_XSS($_GET['search']) |
46 | 46 | )); |
47 | 47 | } |
48 | - $renderer =& $this->defaultRenderer(); |
|
48 | + $renderer = & $this->defaultRenderer(); |
|
49 | 49 | $renderer->setCustomElementTemplate('<span>{element}</span> '); |
50 | - $this->addElement('text','keyword',''); |
|
50 | + $this->addElement('text', 'keyword', ''); |
|
51 | 51 | $this->addButtonSearch(get_lang('Search'), 'submit'); |
52 | 52 | } |
53 | 53 | |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | $this->addElement('static', 'fname', get_lang('FirstName'), $this->user_info['firstname']); |
62 | 62 | } |
63 | 63 | $this->addElement('static', 'uname', get_lang('UserName'), $this->user_info['username']); |
64 | - $this->addElement('static', 'email', get_lang('Email'), '<a href="mailto:' . $this->user_info['email'] . '">' . $this->user_info['email'] . '</a>'); |
|
64 | + $this->addElement('static', 'email', get_lang('Email'), '<a href="mailto:'.$this->user_info['email'].'">'.$this->user_info['email'].'</a>'); |
|
65 | 65 | $this->addElement('static', 'ofcode', get_lang('OfficialCode'), $this->user_info['official_code']); |
66 | 66 | $this->addElement('static', 'phone', get_lang('Phone'), $this->user_info['phone']); |
67 | 67 | $this->addButtonSave(get_lang('Back'), 'submit'); |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | parent :: display(); |
73 | 73 | } |
74 | 74 | |
75 | - function setDefaults($defaults= array(), $filter = null) |
|
75 | + function setDefaults($defaults = array(), $filter = null) |
|
76 | 76 | { |
77 | 77 | parent :: setDefaults($defaults, $filter); |
78 | 78 | } |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $this->set_additional_parameters($addparams); |
72 | 72 | } |
73 | 73 | |
74 | - $column= 0; |
|
74 | + $column = 0; |
|
75 | 75 | if ($this->teacherView) { |
76 | 76 | if ($this->exportToPdf == false) { |
77 | 77 | $this->set_header($column++, '', '', 'width="25px"'); |
@@ -283,13 +283,13 @@ discard block |
||
283 | 283 | $main_categories[$item->get_id()]['name'] = $item->get_name(); |
284 | 284 | } else { |
285 | 285 | $name = $this->build_name_link($item, $type); |
286 | - $row[] = $invisibility_span_open.$name. $invisibility_span_close; |
|
286 | + $row[] = $invisibility_span_open.$name.$invisibility_span_close; |
|
287 | 287 | $main_categories[$item->get_id()]['name'] = $name; |
288 | 288 | } |
289 | 289 | |
290 | 290 | $this->dataForGraph['categories'][] = $item->get_name(); |
291 | 291 | |
292 | - $main_categories[$item->get_id()]['weight']= $item->get_weight(); |
|
292 | + $main_categories[$item->get_id()]['weight'] = $item->get_weight(); |
|
293 | 293 | $total_categories_weight += $item->get_weight(); |
294 | 294 | |
295 | 295 | // Description. |
@@ -309,9 +309,9 @@ discard block |
||
309 | 309 | ); |
310 | 310 | |
311 | 311 | if ($this->teacherView) { |
312 | - $row[] = $invisibility_span_open .Display::tag('p', $weight, array('class' => 'score')).$invisibility_span_close; |
|
312 | + $row[] = $invisibility_span_open.Display::tag('p', $weight, array('class' => 'score')).$invisibility_span_close; |
|
313 | 313 | } else { |
314 | - $row[] = $invisibility_span_open .$weight.$invisibility_span_close; |
|
314 | + $row[] = $invisibility_span_open.$weight.$invisibility_span_close; |
|
315 | 315 | } |
316 | 316 | |
317 | 317 | $category_weight = $item->get_weight(); |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | |
338 | 338 | if (!empty($score[1])) { |
339 | 339 | $completeScore = $scoredisplay->display_score($score, SCORE_DIV_PERCENT); |
340 | - $score = $score[0]/$score[1]*$item->get_weight(); |
|
340 | + $score = $score[0] / $score[1] * $item->get_weight(); |
|
341 | 341 | $score = $scoredisplay->display_score(array($score, null), SCORE_SIMPLE); |
342 | 342 | $scoreToDisplay = Display::tip($score, $completeScore); |
343 | 343 | } else { |
@@ -373,7 +373,7 @@ discard block |
||
373 | 373 | $totalResultAverageValue = strip_tags($scoredisplay->display_score($totalResult, SCORE_AVERAGE)); |
374 | 374 | $this->dataForGraph['my_result'][] = (float) str_replace('%', '', $totalResultAverageValue); |
375 | 375 | $totalAverageValue = strip_tags($scoredisplay->display_score($totalAverage, SCORE_AVERAGE)); |
376 | - $this->dataForGraph['average'][] = (float) str_replace('%', '', $totalAverageValue); |
|
376 | + $this->dataForGraph['average'][] = (float) str_replace('%', '', $totalAverageValue); |
|
377 | 377 | // Ranking |
378 | 378 | $row[] = $ranking; |
379 | 379 | // Best |
@@ -456,7 +456,7 @@ discard block |
||
456 | 456 | $row[] = $this->build_type_column($item, array('style' => 'padding-left:5px')); |
457 | 457 | |
458 | 458 | // Name. |
459 | - $row[] = $invisibility_span_open." ".$this->build_name_link($item, $type) . $invisibility_span_close; |
|
459 | + $row[] = $invisibility_span_open." ".$this->build_name_link($item, $type).$invisibility_span_close; |
|
460 | 460 | |
461 | 461 | // Description. |
462 | 462 | if ($this->exportToPdf == false) { |
@@ -494,7 +494,7 @@ discard block |
||
494 | 494 | // Students get the results and certificates columns |
495 | 495 | $eval_n_links = array_merge($alleval, $alllink); |
496 | 496 | |
497 | - if (count($eval_n_links)> 0) { |
|
497 | + if (count($eval_n_links) > 0) { |
|
498 | 498 | $value_data = isset($data[4]) ? $data[4] : null; |
499 | 499 | |
500 | 500 | if (!is_null($value_data)) { |
@@ -593,7 +593,7 @@ discard block |
||
593 | 593 | $row = array( |
594 | 594 | null, |
595 | 595 | null, |
596 | - '<strong>' . get_lang('Total') . '</strong>', |
|
596 | + '<strong>'.get_lang('Total').'</strong>', |
|
597 | 597 | null, |
598 | 598 | $total |
599 | 599 | ); |
@@ -663,7 +663,7 @@ discard block |
||
663 | 663 | if ($this->exportToPdf) { |
664 | 664 | $row = array( |
665 | 665 | null, |
666 | - '<h3>' . get_lang('Total') . '</h3>', |
|
666 | + '<h3>'.get_lang('Total').'</h3>', |
|
667 | 667 | $main_weight, |
668 | 668 | $totalResult, |
669 | 669 | $totalRanking, |
@@ -673,7 +673,7 @@ discard block |
||
673 | 673 | } else { |
674 | 674 | $row = array( |
675 | 675 | null, |
676 | - '<h3>' . get_lang('Total') . '</h3>', |
|
676 | + '<h3>'.get_lang('Total').'</h3>', |
|
677 | 677 | null, |
678 | 678 | $main_weight, |
679 | 679 | $totalResult, |
@@ -688,7 +688,7 @@ discard block |
||
688 | 688 | } |
689 | 689 | |
690 | 690 | // Warning messages |
691 | - $view = isset($_GET['view']) ? $_GET['view']: null; |
|
691 | + $view = isset($_GET['view']) ? $_GET['view'] : null; |
|
692 | 692 | |
693 | 693 | if ($this->teacherView) { |
694 | 694 | if (isset($_GET['selectcat']) && |
@@ -701,14 +701,14 @@ discard block |
||
701 | 701 | $weight_category = intval($this->build_weight($category[0])); |
702 | 702 | |
703 | 703 | $course_code = $this->build_course_code($category[0]); |
704 | - $weight_total_links = round($weight_total_links); |
|
704 | + $weight_total_links = round($weight_total_links); |
|
705 | 705 | |
706 | 706 | if ($weight_total_links > $weight_category || |
707 | 707 | $weight_total_links < $weight_category || |
708 | 708 | $weight_total_links > $weight_category |
709 | 709 | ) { |
710 | 710 | $warning_message = sprintf(get_lang('TotalWeightMustBeX'), $weight_category); |
711 | - $modify_icons = '<a href="gradebook_edit_cat.php?editcat='.$id_cat.'&cidReq='.$course_code.'&id_session='.api_get_session_id().'">'. |
|
711 | + $modify_icons = '<a href="gradebook_edit_cat.php?editcat='.$id_cat.'&cidReq='.$course_code.'&id_session='.api_get_session_id().'">'. |
|
712 | 712 | Display::return_icon('edit.png', $warning_message, array(), ICON_SIZE_SMALL).'</a>'; |
713 | 713 | $warning_message .= $modify_icons; |
714 | 714 | Display::display_warning_message($warning_message, false); |
@@ -721,7 +721,7 @@ discard block |
||
721 | 721 | ); |
722 | 722 | |
723 | 723 | if (!empty($content_html)) { |
724 | - $new_content = explode('</head>',$content_html['content']); |
|
724 | + $new_content = explode('</head>', $content_html['content']); |
|
725 | 725 | } |
726 | 726 | |
727 | 727 | if (empty($new_content[0])) { |
@@ -755,7 +755,7 @@ discard block |
||
755 | 755 | is_array($course_codes) |
756 | 756 | ) { |
757 | 757 | $warning_message = ''; |
758 | - for ($x = 0; $x<count($weight_categories);$x++) { |
|
758 | + for ($x = 0; $x < count($weight_categories); $x++) { |
|
759 | 759 | $weight_category = intval($weight_categories[$x]); |
760 | 760 | $certificate_min_score = intval($certificate_min_scores[$x]); |
761 | 761 | $course_code = $course_codes[$x]; |
@@ -763,12 +763,12 @@ discard block |
||
763 | 763 | if (empty($certificate_min_score) || |
764 | 764 | ($certificate_min_score > $weight_category) |
765 | 765 | ) { |
766 | - $warning_message .= $course_code .' - '.get_lang('CertificateMinimunScoreIsRequiredAndMustNotBeMoreThan').' '.$weight_category.'<br />'; |
|
766 | + $warning_message .= $course_code.' - '.get_lang('CertificateMinimunScoreIsRequiredAndMustNotBeMoreThan').' '.$weight_category.'<br />'; |
|
767 | 767 | } |
768 | 768 | } |
769 | 769 | |
770 | 770 | if (!empty($warning_message)) { |
771 | - Display::display_warning_message($warning_message,false); |
|
771 | + Display::display_warning_message($warning_message, false); |
|
772 | 772 | } |
773 | 773 | } |
774 | 774 | } |
@@ -812,15 +812,15 @@ discard block |
||
812 | 812 | $pChart->Antialias = FALSE; |
813 | 813 | |
814 | 814 | /* Add a border to the picture */ |
815 | - $pChart->drawRectangle(0,0,$xSize-10,$ySize-10,array("R"=>0,"G"=>0,"B"=>0)); |
|
815 | + $pChart->drawRectangle(0, 0, $xSize - 10, $ySize - 10, array("R"=>0, "G"=>0, "B"=>0)); |
|
816 | 816 | |
817 | - $pChart->drawText(10,16,get_lang('Results'),array("FontSize"=>11,"Align"=>TEXT_ALIGN_BOTTOMLEFT)); |
|
817 | + $pChart->drawText(10, 16, get_lang('Results'), array("FontSize"=>11, "Align"=>TEXT_ALIGN_BOTTOMLEFT)); |
|
818 | 818 | |
819 | - $pChart->setGraphArea(50, 30, $xSize-50, $ySize-50); |
|
819 | + $pChart->setGraphArea(50, 30, $xSize - 50, $ySize - 50); |
|
820 | 820 | |
821 | 821 | $pChart->setFontProperties( |
822 | 822 | array( |
823 | - 'FontName' => api_get_path(SYS_FONTS_PATH) . 'opensans/OpenSans-Regular.ttf', |
|
823 | + 'FontName' => api_get_path(SYS_FONTS_PATH).'opensans/OpenSans-Regular.ttf', |
|
824 | 824 | 'FontSize' => 10, |
825 | 825 | ) |
826 | 826 | ); |
@@ -840,7 +840,7 @@ discard block |
||
840 | 840 | |
841 | 841 | /* Draw the line chart */ |
842 | 842 | $pChart->drawLineChart(); |
843 | - $pChart->drawPlotChart(array("DisplayValues"=>TRUE,"PlotBorder"=>TRUE,"BorderSize"=>2,"Surrounding"=>-60,"BorderAlpha"=>80)); |
|
843 | + $pChart->drawPlotChart(array("DisplayValues"=>TRUE, "PlotBorder"=>TRUE, "BorderSize"=>2, "Surrounding"=>-60, "BorderAlpha"=>80)); |
|
844 | 844 | |
845 | 845 | /* Write the chart legend */ |
846 | 846 | $pChart->drawLegend( |
@@ -860,13 +860,13 @@ discard block |
||
860 | 860 | $chartHash = $myCache->getHash($dataSet); |
861 | 861 | |
862 | 862 | $myCache->writeToCache($chartHash, $pChart); |
863 | - $imgSysPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash; |
|
863 | + $imgSysPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash; |
|
864 | 864 | $myCache->saveFromCache($chartHash, $imgSysPath); |
865 | - $imgWebPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash; |
|
865 | + $imgWebPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash; |
|
866 | 866 | |
867 | 867 | if (file_exists($imgSysPath)) { |
868 | 868 | $result = '<div id="contentArea" style="text-align: center;" >'; |
869 | - $result .= '<img src="' . $imgWebPath.'" >'; |
|
869 | + $result .= '<img src="'.$imgWebPath.'" >'; |
|
870 | 870 | $result .= '</div>'; |
871 | 871 | return $result; |
872 | 872 | } |
@@ -911,13 +911,13 @@ discard block |
||
911 | 911 | switch ($item->get_item_type()) { |
912 | 912 | // category |
913 | 913 | case 'C' : |
914 | - return 'CATE' . $item->get_id(); |
|
914 | + return 'CATE'.$item->get_id(); |
|
915 | 915 | // evaluation |
916 | 916 | case 'E' : |
917 | - return 'EVAL' . $item->get_id(); |
|
917 | + return 'EVAL'.$item->get_id(); |
|
918 | 918 | // link |
919 | 919 | case 'L' : |
920 | - return 'LINK' . $item->get_id(); |
|
920 | + return 'LINK'.$item->get_id(); |
|
921 | 921 | } |
922 | 922 | } |
923 | 923 | |
@@ -945,20 +945,20 @@ discard block |
||
945 | 945 | switch ($item->get_item_type()) { |
946 | 946 | // category |
947 | 947 | case 'C' : |
948 | - $prms_uri='?selectcat=' . $item->get_id() . '&view='.$view; |
|
948 | + $prms_uri = '?selectcat='.$item->get_id().'&view='.$view; |
|
949 | 949 | |
950 | 950 | if (isset($_GET['isStudentView'])) { |
951 | - if ( isset($is_student) || ( isset($_SESSION['studentview']) && $_SESSION['studentview']=='studentview') ) { |
|
952 | - $prms_uri=$prms_uri.'&isStudentView='.Security::remove_XSS($_GET['isStudentView']); |
|
951 | + if (isset($is_student) || (isset($_SESSION['studentview']) && $_SESSION['studentview'] == 'studentview')) { |
|
952 | + $prms_uri = $prms_uri.'&isStudentView='.Security::remove_XSS($_GET['isStudentView']); |
|
953 | 953 | } |
954 | 954 | } |
955 | 955 | |
956 | 956 | $cat = new Category(); |
957 | - $show_message=$cat->show_message_resource_delete($item->get_course_code()); |
|
957 | + $show_message = $cat->show_message_resource_delete($item->get_course_code()); |
|
958 | 958 | return ' <a href="'.Security::remove_XSS($_SESSION['gradebook_dest']).$prms_uri.'">' |
959 | 959 | . $item->get_name() |
960 | 960 | . '</a>' |
961 | - . ($item->is_course() ? ' [' . $item->get_course_code() . ']'.$show_message : ''); |
|
961 | + . ($item->is_course() ? ' ['.$item->get_course_code().']'.$show_message : ''); |
|
962 | 962 | // evaluation |
963 | 963 | case 'E' : |
964 | 964 | $cat = new Category(); |
@@ -966,10 +966,10 @@ discard block |
||
966 | 966 | $show_message = $cat->show_message_resource_delete($course_id); |
967 | 967 | |
968 | 968 | // course/platform admin can go to the view_results page |
969 | - if (api_is_allowed_to_edit() && $show_message===false) { |
|
969 | + if (api_is_allowed_to_edit() && $show_message === false) { |
|
970 | 970 | if ($item->get_type() == 'presence') { |
971 | 971 | return ' ' |
972 | - . '<a href="gradebook_view_result.php?cidReq='.$course_id.'&selecteval=' . $item->get_id() . '">' |
|
972 | + . '<a href="gradebook_view_result.php?cidReq='.$course_id.'&selecteval='.$item->get_id().'">' |
|
973 | 973 | . $item->get_name() |
974 | 974 | . '</a>'; |
975 | 975 | } else { |
@@ -978,20 +978,20 @@ discard block |
||
978 | 978 | $extra = ''; |
979 | 979 | } |
980 | 980 | return ' ' |
981 | - . '<a href="gradebook_view_result.php?' . api_get_cidreq() . '&selecteval=' . $item->get_id() . '">' |
|
981 | + . '<a href="gradebook_view_result.php?'.api_get_cidreq().'&selecteval='.$item->get_id().'">' |
|
982 | 982 | . $item->get_name() |
983 | 983 | . '</a> '.$extra; |
984 | 984 | } |
985 | - } elseif (ScoreDisplay :: instance()->is_custom() && $show_message===false) { |
|
985 | + } elseif (ScoreDisplay :: instance()->is_custom() && $show_message === false) { |
|
986 | 986 | // students can go to the statistics page (if custom display enabled) |
987 | 987 | return ' ' |
988 | - . '<a href="gradebook_statistics.php?' . api_get_cidreq() . '&selecteval=' . $item->get_id() . '">' |
|
988 | + . '<a href="gradebook_statistics.php?'.api_get_cidreq().'&selecteval='.$item->get_id().'">' |
|
989 | 989 | . $item->get_name() |
990 | 990 | . '</a>'; |
991 | 991 | |
992 | 992 | } elseif ($show_message === false && !api_is_allowed_to_edit() && !ScoreDisplay :: instance()->is_custom()) { |
993 | 993 | return ' ' |
994 | - . '<a href="gradebook_statistics.php?' . api_get_cidreq() . '&selecteval=' . $item->get_id() . '">' |
|
994 | + . '<a href="gradebook_statistics.php?'.api_get_cidreq().'&selecteval='.$item->get_id().'">' |
|
995 | 995 | . $item->get_name() |
996 | 996 | . '</a>'; |
997 | 997 | } else { |
@@ -1006,7 +1006,7 @@ discard block |
||
1006 | 1006 | $url = $item->get_link(); |
1007 | 1007 | |
1008 | 1008 | if (isset($url) && $show_message === false) { |
1009 | - $text = ' <a href="' . $item->get_link() . '">' |
|
1009 | + $text = ' <a href="'.$item->get_link().'">' |
|
1010 | 1010 | . $item->get_name() |
1011 | 1011 | . '</a>'; |
1012 | 1012 | } else { |
@@ -56,17 +56,17 @@ discard block |
||
56 | 56 | |
57 | 57 | protected function build_move() |
58 | 58 | { |
59 | - $renderer =& $this->defaultRenderer(); |
|
59 | + $renderer = & $this->defaultRenderer(); |
|
60 | 60 | $renderer->setCustomElementTemplate('<span>{element}</span> '); |
61 | - $this->addElement('static',null,null,'"'.$this->link_object->get_name().'" '); |
|
62 | - $this->addElement('static',null,null,get_lang('MoveTo').' : '); |
|
63 | - $select = $this->addElement('select','move_cat',null,null); |
|
61 | + $this->addElement('static', null, null, '"'.$this->link_object->get_name().'" '); |
|
62 | + $this->addElement('static', null, null, get_lang('MoveTo').' : '); |
|
63 | + $select = $this->addElement('select', 'move_cat', null, null); |
|
64 | 64 | $line = ''; |
65 | 65 | foreach ($this->link_object->get_target_categories() as $cat) { |
66 | - for ($i=0;$i<$cat[2];$i++) { |
|
66 | + for ($i = 0; $i < $cat[2]; $i++) { |
|
67 | 67 | $line .= '—'; |
68 | 68 | } |
69 | - $select->addoption($line.' '.$cat[1],$cat[0]); |
|
69 | + $select->addoption($line.' '.$cat[1], $cat[0]); |
|
70 | 70 | $line = ''; |
71 | 71 | } |
72 | 72 | $this->addElement('submit', null, get_lang('Ok')); |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | $link = LinkFactory::create($link); |
134 | 134 | if (!empty($courseCode)) { |
135 | 135 | $link->set_course_code($courseCode); |
136 | - } elseif(!empty($_GET['course_code'])) { |
|
136 | + } elseif (!empty($_GET['course_code'])) { |
|
137 | 137 | $link->set_course_code(Database::escape_string($_GET['course_code'], null, false)); |
138 | 138 | } |
139 | 139 |
@@ -52,15 +52,15 @@ discard block |
||
52 | 52 | */ |
53 | 53 | protected function build_move_form() |
54 | 54 | { |
55 | - $renderer =& $this->defaultRenderer(); |
|
55 | + $renderer = & $this->defaultRenderer(); |
|
56 | 56 | $renderer->setCustomElementTemplate('<span>{element}</span> '); |
57 | 57 | $this->addElement( |
58 | 58 | 'static', |
59 | 59 | null, |
60 | 60 | null, |
61 | - '"' . $this->category_object->get_name() . '" ' |
|
61 | + '"'.$this->category_object->get_name().'" ' |
|
62 | 62 | ); |
63 | - $this->addElement('static', null, null, get_lang('MoveTo') . ' : '); |
|
63 | + $this->addElement('static', null, null, get_lang('MoveTo').' : '); |
|
64 | 64 | $select = $this->addElement('select', 'move_cat', null, null); |
65 | 65 | $line = null; |
66 | 66 | foreach ($this->category_object->get_target_categories() as $cat) { |
@@ -68,9 +68,9 @@ discard block |
||
68 | 68 | $line .= '--'; |
69 | 69 | } |
70 | 70 | if ($cat[0] != $this->category_object->get_parent_id()) { |
71 | - $select->addoption($line . ' ' . $cat[1], $cat[0]); |
|
71 | + $select->addoption($line.' '.$cat[1], $cat[0]); |
|
72 | 72 | } else { |
73 | - $select->addoption($line . ' ' . $cat[1], $cat[0], 'disabled'); |
|
73 | + $select->addoption($line.' '.$cat[1], $cat[0], 'disabled'); |
|
74 | 74 | } |
75 | 75 | $line = ''; |
76 | 76 | } |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | $grade_model_id = $this->category_object->get_grade_model_id(); |
154 | 154 | |
155 | 155 | if (empty($links)) { |
156 | - $grade_model_id = 0; |
|
156 | + $grade_model_id = 0; |
|
157 | 157 | } |
158 | 158 | |
159 | 159 | $category_name = $this->category_object->get_name(); |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | [ |
243 | 243 | 'id' => 'skills', |
244 | 244 | 'multiple' => 'multiple', |
245 | - 'url' => api_get_path(WEB_AJAX_PATH) . 'skill.ajax.php?a=search_skills' |
|
245 | + 'url' => api_get_path(WEB_AJAX_PATH).'skill.ajax.php?a=search_skills' |
|
246 | 246 | ] |
247 | 247 | ); |
248 | 248 | |
@@ -400,14 +400,14 @@ discard block |
||
400 | 400 | //only return courses that are not yet created by the teacher |
401 | 401 | |
402 | 402 | foreach ($coursecat as $row) { |
403 | - $select->addoption($row[1],$row[0]); |
|
403 | + $select->addoption($row[1], $row[0]); |
|
404 | 404 | } |
405 | 405 | $this->setDefaults(array( |
406 | 406 | 'hid_user_id' => $this->category_object->get_user_id(), |
407 | 407 | 'hid_parent_id' => $this->category_object->get_parent_id() |
408 | 408 | )); |
409 | - $this->addElement('hidden','hid_user_id'); |
|
410 | - $this->addElement('hidden','hid_parent_id'); |
|
409 | + $this->addElement('hidden', 'hid_user_id'); |
|
410 | + $this->addElement('hidden', 'hid_parent_id'); |
|
411 | 411 | $this->addElement('submit', null, get_lang('Ok')); |
412 | 412 | } |
413 | 413 |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | if (isset($link_object)) { |
32 | 32 | $link = $link_object; |
33 | 33 | } elseif (isset($link_type) && isset($category_object)) { |
34 | - $link = LinkFactory :: create ($link_type); |
|
34 | + $link = LinkFactory :: create($link_type); |
|
35 | 35 | $link->set_course_code(api_get_course_id()); |
36 | 36 | $link->set_category_id($category_object[0]->get_id()); |
37 | 37 | } else { |
@@ -52,12 +52,12 @@ discard block |
||
52 | 52 | } else { |
53 | 53 | $select = $this->addElement('select', 'select_link', get_lang('ChooseItem')); |
54 | 54 | foreach ($link->get_all_links() as $newlink) { |
55 | - $select->addoption($newlink[1],$newlink[0]); |
|
55 | + $select->addoption($newlink[1], $newlink[0]); |
|
56 | 56 | } |
57 | 57 | } |
58 | 58 | } else { |
59 | - $this->addElement('label',get_lang('Name'), '<span class="freeze">'.$link->get_name().' ['.$link->get_type_name().']</span>'); |
|
60 | - $this->addElement('hidden','name_link',$link->get_name(),array('id'=>'name_link')); |
|
59 | + $this->addElement('label', get_lang('Name'), '<span class="freeze">'.$link->get_name().' ['.$link->get_type_name().']</span>'); |
|
60 | + $this->addElement('hidden', 'name_link', $link->get_name(), array('id'=>'name_link')); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | if (count($category_object) == 1) { |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | $grade_model_id = $my_cat->get_grade_model_id(); |
81 | 81 | if (empty($grade_model_id)) { |
82 | 82 | |
83 | - if ($my_cat->get_parent_id() == 0 ) { |
|
83 | + if ($my_cat->get_parent_id() == 0) { |
|
84 | 84 | $default_weight = $my_cat->get_weight(); |
85 | 85 | $select_gradebook->addoption(get_lang('Default'), $my_cat->get_id()); |
86 | 86 | } else { |
@@ -119,8 +119,8 @@ discard block |
||
119 | 119 | 'class' => 'span1' |
120 | 120 | ));*/ |
121 | 121 | |
122 | - $this->addRule('weight_mask',get_lang('OnlyNumbers'),'numeric'); |
|
123 | - $this->addRule(array ('weight_mask', 'zero'), get_lang('NegativeValue'), 'compare', '>='); |
|
122 | + $this->addRule('weight_mask', get_lang('OnlyNumbers'), 'numeric'); |
|
123 | + $this->addRule(array('weight_mask', 'zero'), get_lang('NegativeValue'), 'compare', '>='); |
|
124 | 124 | if ($form_type == self :: TYPE_EDIT) { |
125 | 125 | $parent_cat = Category :: load($link->get_category_id()); |
126 | 126 | |
@@ -133,20 +133,20 @@ discard block |
||
133 | 133 | //var_dump($global_weight, $link->get_weight(), $parent_cat[0]->get_weight()); |
134 | 134 | //$weight = $parent_cat[0]->get_weight()* $link->get_weight() / $global_weight; |
135 | 135 | //$values['weight'] = $weight; |
136 | - $values['weight'] = $link->get_weight() ; |
|
136 | + $values['weight'] = $link->get_weight(); |
|
137 | 137 | } |
138 | - $defaults['weight_mask'] = $values['weight'] ; |
|
138 | + $defaults['weight_mask'] = $values['weight']; |
|
139 | 139 | $defaults['select_gradebook'] = $link->get_category_id(); |
140 | 140 | |
141 | 141 | } |
142 | 142 | // ELEMENT: max |
143 | 143 | if ($link->needs_max()) { |
144 | 144 | if ($form_type == self :: TYPE_EDIT && $link->has_results()) { |
145 | - $this->addText('max', get_lang('QualificationNumeric'), false, array ('size' => '4','maxlength' => '5', 'disabled' => 'disabled')); |
|
145 | + $this->addText('max', get_lang('QualificationNumeric'), false, array('size' => '4', 'maxlength' => '5', 'disabled' => 'disabled')); |
|
146 | 146 | } else { |
147 | - $this->addText('max', get_lang('QualificationNumeric'), true, array ('size' => '4','maxlength' => '5')); |
|
147 | + $this->addText('max', get_lang('QualificationNumeric'), true, array('size' => '4', 'maxlength' => '5')); |
|
148 | 148 | $this->addRule('max', get_lang('OnlyNumbers'), 'numeric'); |
149 | - $this->addRule(array ('max', 'zero'), get_lang('NegativeValue'), 'compare', '>='); |
|
149 | + $this->addRule(array('max', 'zero'), get_lang('NegativeValue'), 'compare', '>='); |
|
150 | 150 | } |
151 | 151 | if ($form_type == self :: TYPE_EDIT) { |
152 | 152 | $defaults['max'] = $link->get_max(); |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | |
156 | 156 | // ELEMENT: description |
157 | 157 | if ($link->needs_name_and_description()) { |
158 | - $this->addElement('textarea', 'description', get_lang('Description'), array ('rows' => '3','cols' => '34')); |
|
158 | + $this->addElement('textarea', 'description', get_lang('Description'), array('rows' => '3', 'cols' => '34')); |
|
159 | 159 | if ($form_type == self :: TYPE_EDIT) { |
160 | 160 | $defaults['description'] = $link->get_description(); |
161 | 161 | } |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | if (isset($setting['gradebook']) && $setting['gradebook'] == 'false') { |
186 | 186 | $visibility_default = 0; |
187 | 187 | } |
188 | - $defaults['visible'] = $visibility_default; |
|
188 | + $defaults['visible'] = $visibility_default; |
|
189 | 189 | } |
190 | 190 | |
191 | 191 | // set default values |
@@ -201,9 +201,9 @@ discard block |
||
201 | 201 | $myCache = new pCache(array('CacheFolder' => substr($cachePath, 0, strlen($cachePath) - 1))); |
202 | 202 | $chartHash = $myCache->getHash($dataSet); |
203 | 203 | if ($myCache->isInCache($chartHash)) { |
204 | - $imgPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash; |
|
204 | + $imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash; |
|
205 | 205 | $myCache->saveFromCache($chartHash, $imgPath); |
206 | - $imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash; |
|
206 | + $imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash; |
|
207 | 207 | } else { |
208 | 208 | /* Create the pChart object */ |
209 | 209 | $widthSize = 480; |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | /* Set the default font */ |
231 | 231 | $myPicture->setFontProperties( |
232 | 232 | array( |
233 | - 'FontName' => api_get_path(SYS_FONTS_PATH) . 'opensans/OpenSans-Regular.ttf', |
|
233 | + 'FontName' => api_get_path(SYS_FONTS_PATH).'opensans/OpenSans-Regular.ttf', |
|
234 | 234 | 'FontSize' => 10 |
235 | 235 | ) |
236 | 236 | ); |
@@ -302,11 +302,11 @@ discard block |
||
302 | 302 | /* Render the picture (choose the best way) */ |
303 | 303 | |
304 | 304 | $myCache->writeToCache($chartHash, $myPicture); |
305 | - $imgPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash; |
|
305 | + $imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash; |
|
306 | 306 | $myCache->saveFromCache($chartHash, $imgPath); |
307 | - $imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash; |
|
307 | + $imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash; |
|
308 | 308 | } |
309 | - echo '<img src="' . $imgPath . '" >'; |
|
309 | + echo '<img src="'.$imgPath.'" >'; |
|
310 | 310 | if ($i % 2 == 0 && $i != 0) { |
311 | 311 | echo '<br /><br />'; |
312 | 312 | } else { |
@@ -349,10 +349,10 @@ discard block |
||
349 | 349 | // previous X |
350 | 350 | $header .= '<td style="width:100%;">'; |
351 | 351 | if ($this->offset >= GRADEBOOK_ITEM_LIMIT) { |
352 | - $header .= '<a href="' . api_get_self() |
|
353 | - . '?selectcat=' . Security::remove_XSS($_GET['selectcat']) |
|
354 | - . '&offset=' . (($this->offset) - GRADEBOOK_ITEM_LIMIT) |
|
355 | - . (isset($_GET['search']) ? '&search=' . Security::remove_XSS($_GET['search']) : '') . '">' |
|
352 | + $header .= '<a href="'.api_get_self() |
|
353 | + . '?selectcat='.Security::remove_XSS($_GET['selectcat']) |
|
354 | + . '&offset='.(($this->offset) - GRADEBOOK_ITEM_LIMIT) |
|
355 | + . (isset($_GET['search']) ? '&search='.Security::remove_XSS($_GET['search']) : '').'">' |
|
356 | 356 | . Display::return_icon('action_prev.png', get_lang('PreviousPage'), array(), 32) |
357 | 357 | . '</a>'; |
358 | 358 | } else { |
@@ -364,10 +364,10 @@ discard block |
||
364 | 364 | ($totalitems - (GRADEBOOK_ITEM_LIMIT + $this->offset)) : GRADEBOOK_ITEM_LIMIT; |
365 | 365 | |
366 | 366 | if ($calcnext > 0) { |
367 | - $header .= '<a href="' . api_get_self() |
|
368 | - . '?selectcat=' . Security::remove_XSS($_GET['selectcat']) |
|
369 | - . '&offset=' . ($this->offset + GRADEBOOK_ITEM_LIMIT) |
|
370 | - . (isset($_GET['search']) ? '&search=' . Security::remove_XSS($_GET['search']) : '') . '">' |
|
367 | + $header .= '<a href="'.api_get_self() |
|
368 | + . '?selectcat='.Security::remove_XSS($_GET['selectcat']) |
|
369 | + . '&offset='.($this->offset + GRADEBOOK_ITEM_LIMIT) |
|
370 | + . (isset($_GET['search']) ? '&search='.Security::remove_XSS($_GET['search']) : '').'">' |
|
371 | 371 | . Display::return_icon('action_next.png', get_lang('NextPage'), array(), 32) |
372 | 372 | . '</a>'; |
373 | 373 | } else { |
@@ -475,6 +475,6 @@ discard block |
||
475 | 475 | */ |
476 | 476 | private function build_name_link($user_id, $name) |
477 | 477 | { |
478 | - return '<a href="user_stats.php?userid=' . $user_id . '&selectcat=' . $this->selectcat->get_id() . '&'.api_get_cidreq().'">' . $name . '</a>'; |
|
478 | + return '<a href="user_stats.php?userid='.$user_id.'&selectcat='.$this->selectcat->get_id().'&'.api_get_cidreq().'">'.$name.'</a>'; |
|
479 | 479 | } |
480 | 480 | } |
@@ -21,9 +21,9 @@ discard block |
||
21 | 21 | * @param method |
22 | 22 | * @param action |
23 | 23 | */ |
24 | - public function DataForm($form_type, $form_name, $method = 'post', $action = null, $target='', $locked_status) |
|
24 | + public function DataForm($form_type, $form_name, $method = 'post', $action = null, $target = '', $locked_status) |
|
25 | 25 | { |
26 | - parent :: __construct($form_name, $method, $action,$target); |
|
26 | + parent :: __construct($form_name, $method, $action, $target); |
|
27 | 27 | $this->form_type = $form_type; |
28 | 28 | if ($this->form_type == self :: TYPE_IMPORT) { |
29 | 29 | $this->build_import_form(); |
@@ -41,13 +41,13 @@ discard block |
||
41 | 41 | |
42 | 42 | protected function build_pdf_export_form() |
43 | 43 | { |
44 | - $renderer =& $this->defaultRenderer(); |
|
44 | + $renderer = & $this->defaultRenderer(); |
|
45 | 45 | $renderer->setCustomElementTemplate('<span>{element}</span>'); |
46 | 46 | $this->addElement('header', get_lang('ChooseOrientation')); |
47 | 47 | $this->addElement('radio', 'orientation', null, get_lang('Portrait'), 'portrait'); |
48 | 48 | $this->addElement('radio', 'orientation', null, get_lang('Landscape'), 'landscape'); |
49 | 49 | $this->addButtonExport(get_lang('Export')); |
50 | - $this->setDefaults(array ( |
|
50 | + $this->setDefaults(array( |
|
51 | 51 | 'orientation' => 'portrait' |
52 | 52 | )); |
53 | 53 | } |
@@ -59,19 +59,19 @@ discard block |
||
59 | 59 | $this->addElement('radio', 'file_type', null, 'XML (Extensible Markup Language)', 'xml'); |
60 | 60 | $this->addElement('radio', 'file_type', null, 'PDF (Portable Document Format)', 'pdf'); |
61 | 61 | $this->addButtonExport(get_lang('Export')); |
62 | - $this->setDefaults(array ( |
|
62 | + $this->setDefaults(array( |
|
63 | 63 | 'file_type' => 'csv' |
64 | 64 | )); |
65 | 65 | } |
66 | 66 | |
67 | - protected function build_export_form_option($show_pdf=true) |
|
67 | + protected function build_export_form_option($show_pdf = true) |
|
68 | 68 | { |
69 | 69 | $this->addElement('header', get_lang('ChooseFormat')); |
70 | 70 | $this->addElement('radio', 'file_type', get_lang('OutputFileType'), 'CSV (Comma-Separated Values)', 'csv'); |
71 | 71 | $this->addElement('radio', 'file_type', null, 'XML (Extensible Markup Language)', 'xml'); |
72 | - $this->addElement('radio', 'file_type', Display::return_icon('info3.gif',get_lang('ToExportMustLockEvaluation')), 'PDF (Portable Document Format)', 'pdf', array('disabled')); |
|
72 | + $this->addElement('radio', 'file_type', Display::return_icon('info3.gif', get_lang('ToExportMustLockEvaluation')), 'PDF (Portable Document Format)', 'pdf', array('disabled')); |
|
73 | 73 | $this->addButtonExport(get_lang('Export')); |
74 | - $this->setDefaults(array ( |
|
74 | + $this->setDefaults(array( |
|
75 | 75 | 'file_type' => 'csv' |
76 | 76 | )); |
77 | 77 | } |
@@ -80,16 +80,16 @@ discard block |
||
80 | 80 | { |
81 | 81 | $this->addElement('hidden', 'formSent'); |
82 | 82 | $this->addElement('header', get_lang('ImportFileLocation')); |
83 | - $this->addElement('file', 'import_file',get_lang('Location')); |
|
84 | - $allowed_file_types = array ( |
|
83 | + $this->addElement('file', 'import_file', get_lang('Location')); |
|
84 | + $allowed_file_types = array( |
|
85 | 85 | 'xml', |
86 | 86 | 'csv' |
87 | 87 | ); |
88 | 88 | //$this->addRule('file', get_lang('InvalidExtension') . ' (' . implode(',', $allowed_file_types) . ')', 'filetype', $allowed_file_types); |
89 | - $this->addElement('radio', 'file_type', get_lang('FileType'), 'CSV (<a href="docs/example_csv.html" target="_blank">' . get_lang('ExampleCSVFile') . '</a>)', 'csv'); |
|
90 | - $this->addElement('radio', 'file_type', null, 'XML (<a href="docs/example_xml.html" target="_blank">' . get_lang('ExampleXMLFile') . '</a>)', 'xml'); |
|
91 | - $this->addElement('checkbox','overwrite', null,get_lang('OverwriteScores')); |
|
92 | - $this->addElement('checkbox','ignoreerrors',null,get_lang('IgnoreErrors')); |
|
89 | + $this->addElement('radio', 'file_type', get_lang('FileType'), 'CSV (<a href="docs/example_csv.html" target="_blank">'.get_lang('ExampleCSVFile').'</a>)', 'csv'); |
|
90 | + $this->addElement('radio', 'file_type', null, 'XML (<a href="docs/example_xml.html" target="_blank">'.get_lang('ExampleXMLFile').'</a>)', 'xml'); |
|
91 | + $this->addElement('checkbox', 'overwrite', null, get_lang('OverwriteScores')); |
|
92 | + $this->addElement('checkbox', 'ignoreerrors', null, get_lang('IgnoreErrors')); |
|
93 | 93 | $this->addButtonImport(get_lang('Ok')); |
94 | 94 | $this->setDefaults(array( |
95 | 95 | 'formSent' => '1', |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | */ |
19 | 19 | public function UserTable($userid, $evals = array(), $links = array(), $addparams = null) |
20 | 20 | { |
21 | - parent :: __construct ('userlist', null, null, 0); |
|
21 | + parent :: __construct('userlist', null, null, 0); |
|
22 | 22 | $this->userid = $userid; |
23 | 23 | $this->datagen = new UserDataGenerator($userid, $evals, $links); |
24 | 24 | if (isset($addparams)) { |
@@ -87,8 +87,8 @@ discard block |
||
87 | 87 | // generate the data to display |
88 | 88 | $sortable_data = array(); |
89 | 89 | foreach ($data_array as $data) { |
90 | - if ($data[2]!="") {//filter by course removed |
|
91 | - $row = array (); |
|
90 | + if ($data[2] != "") {//filter by course removed |
|
91 | + $row = array(); |
|
92 | 92 | $row[] = $this->build_type_column($data[0]); |
93 | 93 | $row[] = $this->build_name_link($data[0]); |
94 | 94 | $row[] = $data[2]; |
@@ -123,15 +123,15 @@ discard block |
||
123 | 123 | // evaluation |
124 | 124 | case 'E' : |
125 | 125 | return ' ' |
126 | - . '<a href="gradebook_view_result.php?selecteval=' . $item->get_id() . '">' |
|
126 | + . '<a href="gradebook_view_result.php?selecteval='.$item->get_id().'">' |
|
127 | 127 | . $item->get_name() |
128 | 128 | . '</a>'; |
129 | 129 | // link |
130 | 130 | case 'L' : |
131 | - return ' <a href="' . $item->get_link() . '">' |
|
131 | + return ' <a href="'.$item->get_link().'">' |
|
132 | 132 | . $item->get_name() |
133 | 133 | . '</a>' |
134 | - . ' [' . $item->get_type_name() . ']'; |
|
134 | + . ' ['.$item->get_type_name().']'; |
|
135 | 135 | } |
136 | 136 | } |
137 | 137 | } |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | 'onchange' => 'document.add_users_to_evaluation.submit()' |
92 | 92 | )); |
93 | 93 | $select->addOption('', ''); |
94 | - for ($i = 65; $i <= 90; $i ++) { |
|
94 | + for ($i = 65; $i <= 90; $i++) { |
|
95 | 95 | $letter = chr($i); |
96 | 96 | if (isset($this->extra) && $this->extra == $letter) { |
97 | 97 | $select->addOption($letter, $letter, 'selected'); |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | )); |
107 | 107 | foreach ($this->evaluation_object->get_not_subscribed_students() as $user) { |
108 | 108 | if ((!isset($this->extra)) || empty($this->extra) || api_strtoupper(api_substr($user[1], 0, 1)) == $this->extra) { |
109 | - $select->addoption($user[1] . ' ' . $user[2] . ' (' . $user[3] . ')', $user[0]); |
|
109 | + $select->addoption($user[1].' '.$user[2].' ('.$user[3].')', $user[0]); |
|
110 | 110 | } |
111 | 111 | } |
112 | 112 | $this->addButtonCreate(get_lang('AddUserToEval'), 'submit_button'); |
@@ -134,21 +134,21 @@ discard block |
||
134 | 134 | if (api_is_western_name_order()) { |
135 | 135 | $renderer->setHeaderTemplate( |
136 | 136 | '<tr> |
137 | - <th>' . get_lang('OfficialCode') . '</th> |
|
138 | - <th>' . get_lang('UserName') . '</th> |
|
139 | - <th>' . get_lang('FirstName') . '</th> |
|
140 | - <th>' . get_lang('LastName') . '</th> |
|
141 | - <th>' . get_lang('Qualify') . '</th> |
|
137 | + <th>' . get_lang('OfficialCode').'</th> |
|
138 | + <th>' . get_lang('UserName').'</th> |
|
139 | + <th>' . get_lang('FirstName').'</th> |
|
140 | + <th>' . get_lang('LastName').'</th> |
|
141 | + <th>' . get_lang('Qualify').'</th> |
|
142 | 142 | </tr>' |
143 | 143 | ); |
144 | 144 | } else { |
145 | 145 | $renderer->setHeaderTemplate( |
146 | 146 | '<tr> |
147 | - <th>' . get_lang('OfficialCode') . '</th> |
|
148 | - <th>' . get_lang('UserName') . '</th> |
|
149 | - <th>' . get_lang('LastName') . '</th> |
|
150 | - <th>' . get_lang('FirstName') . '</th> |
|
151 | - <th>' . get_lang('Qualify') . '</th> |
|
147 | + <th>' . get_lang('OfficialCode').'</th> |
|
148 | + <th>' . get_lang('UserName').'</th> |
|
149 | + <th>' . get_lang('LastName').'</th> |
|
150 | + <th>' . get_lang('FirstName').'</th> |
|
151 | + <th>' . get_lang('Qualify').'</th> |
|
152 | 152 | </tr>' |
153 | 153 | ); |
154 | 154 | } |
@@ -174,33 +174,33 @@ discard block |
||
174 | 174 | $result = $result_and_user['result']; |
175 | 175 | |
176 | 176 | $renderer = &$this->defaultRenderer(); |
177 | - $this->addText('score[' . $result->get_id() . ']', $this->build_stud_label($user['user_id'], $user['username'], $user['lastname'], $user['firstname']), false, array('class' => "span2", |
|
177 | + $this->addText('score['.$result->get_id().']', $this->build_stud_label($user['user_id'], $user['username'], $user['lastname'], $user['firstname']), false, array('class' => "span2", |
|
178 | 178 | 'maxlength' => 5)); |
179 | 179 | |
180 | - $this->addRule('score[' . $result->get_id() . ']', get_lang('OnlyNumbers'), 'numeric'); |
|
180 | + $this->addRule('score['.$result->get_id().']', get_lang('OnlyNumbers'), 'numeric'); |
|
181 | 181 | $this->addRule(array( |
182 | - 'score[' . $result->get_id() . ']', 'maxvalue'), get_lang('OverMax'), 'compare', '<='); |
|
182 | + 'score['.$result->get_id().']', 'maxvalue'), get_lang('OverMax'), 'compare', '<='); |
|
183 | 183 | $this->addRule(array( |
184 | - 'score[' . $result->get_id() . ']', 'minvalue'), get_lang('UnderMin'), 'compare', '>='); |
|
185 | - $defaults['score[' . $result->get_id() . ']'] = $result->get_score(); |
|
184 | + 'score['.$result->get_id().']', 'minvalue'), get_lang('UnderMin'), 'compare', '>='); |
|
185 | + $defaults['score['.$result->get_id().']'] = $result->get_score(); |
|
186 | 186 | |
187 | 187 | if (api_is_western_name_order()) { |
188 | - $user_info = '<td align="left" >' . $user['firstname'] . '</td>'; |
|
189 | - $user_info .= '<td align="left" >' . $user['lastname'] . '</td>'; |
|
188 | + $user_info = '<td align="left" >'.$user['firstname'].'</td>'; |
|
189 | + $user_info .= '<td align="left" >'.$user['lastname'].'</td>'; |
|
190 | 190 | } else { |
191 | - $user_info = '<td align="left" >' . $user['lastname'] . '</td>'; |
|
192 | - $user_info .= '<td align="left" >' . $user['firstname'] . '</td>'; |
|
191 | + $user_info = '<td align="left" >'.$user['lastname'].'</td>'; |
|
192 | + $user_info .= '<td align="left" >'.$user['firstname'].'</td>'; |
|
193 | 193 | } |
194 | 194 | |
195 | 195 | $template = '<tr> |
196 | - <td align="left" >' . $user['official_code'] . '</td> |
|
197 | - <td align="left" >' . $user['username'] . '</td> |
|
198 | - ' . $user_info . ' |
|
199 | - <td align="left">{element} / ' . $this->evaluation_object->get_max() . ' |
|
196 | + <td align="left" >' . $user['official_code'].'</td> |
|
197 | + <td align="left" >' . $user['username'].'</td> |
|
198 | + ' . $user_info.' |
|
199 | + <td align="left">{element} / ' . $this->evaluation_object->get_max().' |
|
200 | 200 | <!-- BEGIN error --><br /><span style="color: #ff0000;font-size:10px">{error}</span><!-- END error --> |
201 | 201 | </td> |
202 | 202 | </tr>'; |
203 | - $renderer->setElementTemplate($template, 'score[' . $result->get_id() . ']'); |
|
203 | + $renderer->setElementTemplate($template, 'score['.$result->get_id().']'); |
|
204 | 204 | } |
205 | 205 | $this->setDefaults($defaults); |
206 | 206 | $this->addButtonSave(get_lang('EditResult'), 'submit'); |
@@ -215,15 +215,15 @@ discard block |
||
215 | 215 | { |
216 | 216 | $renderer = & $this->defaultRenderer(); |
217 | 217 | $renderer->setCustomElementTemplate('<span>{element}</span> '); |
218 | - $this->addElement('static', null, null, '"' . $this->evaluation_object->get_name() . '" '); |
|
219 | - $this->addElement('static', null, null, get_lang('MoveTo') . ' : '); |
|
218 | + $this->addElement('static', null, null, '"'.$this->evaluation_object->get_name().'" '); |
|
219 | + $this->addElement('static', null, null, get_lang('MoveTo').' : '); |
|
220 | 220 | $select = $this->addElement('select', 'move_cat', null, null); |
221 | 221 | $line = ''; |
222 | 222 | foreach ($this->evaluation_object->get_target_categories() as $cat) { |
223 | 223 | for ($i = 0; $i < $cat[2]; $i++) { |
224 | 224 | $line .= '—'; |
225 | 225 | } |
226 | - $select->addoption($line . ' ' . $cat[1], $cat[0]); |
|
226 | + $select->addoption($line.' '.$cat[1], $cat[0]); |
|
227 | 227 | $line = ''; |
228 | 228 | } |
229 | 229 | $this->addButtonSave(get_lang('Ok'), 'submit'); |
@@ -253,21 +253,21 @@ discard block |
||
253 | 253 | if (api_is_western_name_order()) { |
254 | 254 | $renderer->setHeaderTemplate( |
255 | 255 | '<tr> |
256 | - <th>' . get_lang('OfficialCode') . '</th> |
|
257 | - <th>' . get_lang('UserName') . '</th> |
|
258 | - <th>' . get_lang('FirstName') . '</th> |
|
259 | - <th>' . get_lang('LastName') . '</th> |
|
260 | - <th>' . get_lang('Qualify') . '</th> |
|
256 | + <th>' . get_lang('OfficialCode').'</th> |
|
257 | + <th>' . get_lang('UserName').'</th> |
|
258 | + <th>' . get_lang('FirstName').'</th> |
|
259 | + <th>' . get_lang('LastName').'</th> |
|
260 | + <th>' . get_lang('Qualify').'</th> |
|
261 | 261 | </tr>' |
262 | 262 | ); |
263 | 263 | } else { |
264 | 264 | $renderer->setHeaderTemplate( |
265 | 265 | '<tr> |
266 | - <th>' . get_lang('OfficialCode') . '</th> |
|
267 | - <th>' . get_lang('UserName') . '</th> |
|
268 | - <th>' . get_lang('LastName') . '</th> |
|
269 | - <th>' . get_lang('FirstName') . '</th> |
|
270 | - <th>' . get_lang('Qualify') . '</th> |
|
266 | + <th>' . get_lang('OfficialCode').'</th> |
|
267 | + <th>' . get_lang('UserName').'</th> |
|
268 | + <th>' . get_lang('LastName').'</th> |
|
269 | + <th>' . get_lang('FirstName').'</th> |
|
270 | + <th>' . get_lang('Qualify').'</th> |
|
271 | 271 | </tr>' |
272 | 272 | ); |
273 | 273 | } |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | $firstUser = true; |
276 | 276 | foreach ($tblusers as $user) { |
277 | 277 | |
278 | - $element_name = 'score[' . $user[0] . ']'; |
|
278 | + $element_name = 'score['.$user[0].']'; |
|
279 | 279 | |
280 | 280 | $scoreColumnProperties = array('maxlength' => 5); |
281 | 281 | if ($firstUser) { |
@@ -290,19 +290,19 @@ discard block |
||
290 | 290 | $this->addRule(array($element_name, 'minvalue'), get_lang('UnderMin'), 'compare', '>='); |
291 | 291 | |
292 | 292 | if (api_is_western_name_order()) { |
293 | - $user_info = '<td align="left" >' . $user[3] . '</td>'; |
|
294 | - $user_info .= '<td align="left" >' . $user[2] . '</td>'; |
|
293 | + $user_info = '<td align="left" >'.$user[3].'</td>'; |
|
294 | + $user_info .= '<td align="left" >'.$user[2].'</td>'; |
|
295 | 295 | } else { |
296 | - $user_info = '<td align="left" >' . $user[2] . '</td>'; |
|
297 | - $user_info .= '<td align="left" >' . $user[3] . '</td>'; |
|
296 | + $user_info = '<td align="left" >'.$user[2].'</td>'; |
|
297 | + $user_info .= '<td align="left" >'.$user[3].'</td>'; |
|
298 | 298 | } |
299 | 299 | $nr_users++; |
300 | 300 | |
301 | 301 | $template = '<tr> |
302 | - <td align="left" >' . $user[4] . '</td> |
|
303 | - <td align="left" >' . $user[1] . '</td> |
|
304 | - ' . $user_info . ' |
|
305 | - <td align="left">{element} / ' . $this->evaluation_object->get_max() . ' |
|
302 | + <td align="left" >' . $user[4].'</td> |
|
303 | + <td align="left" >' . $user[1].'</td> |
|
304 | + ' . $user_info.' |
|
305 | + <td align="left">{element} / ' . $this->evaluation_object->get_max().' |
|
306 | 306 | <!-- BEGIN error --><br /><span style="color: #ff0000;font-size:10px">{error}</span><!-- END error --> |
307 | 307 | </td> |
308 | 308 | </tr>'; |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | $renderer->setCustomElementTemplate('<span>{element}</span> '); |
337 | 337 | $this->addElement('label', get_lang('User'), $userinfo['complete_name']); |
338 | 338 | |
339 | - $this->addText('score', array(get_lang('Score'), null, '/ ' . $this->evaluation_object->get_max()), false, array( |
|
339 | + $this->addText('score', array(get_lang('Score'), null, '/ '.$this->evaluation_object->get_max()), false, array( |
|
340 | 340 | 'size' => '4', |
341 | 341 | 'class' => 'span1', |
342 | 342 | 'maxlength' => '5' |
@@ -471,7 +471,7 @@ discard block |
||
471 | 471 | } |
472 | 472 | } |
473 | 473 | |
474 | - $this->addText('weight_mask', array(get_lang('Weight'), null, ' [0 .. <span id="max_weight">' . $all_categories[0]->get_weight() . '</span>] '), true, array( |
|
474 | + $this->addText('weight_mask', array(get_lang('Weight'), null, ' [0 .. <span id="max_weight">'.$all_categories[0]->get_weight().'</span>] '), true, array( |
|
475 | 475 | 'size' => '4', |
476 | 476 | 'maxlength' => '5', |
477 | 477 | 'class' => 'span1' |
@@ -543,11 +543,11 @@ discard block |
||
543 | 543 | $link = LinkFactory :: get_evaluation_link($this->evaluation_object->get_id()); |
544 | 544 | $doc_url = $link->get_view_url($id); |
545 | 545 | if ($doc_url != null) { |
546 | - $opendocurl_start .= '<a href="' . $doc_url . '" target="_blank">'; |
|
546 | + $opendocurl_start .= '<a href="'.$doc_url.'" target="_blank">'; |
|
547 | 547 | $opendocurl_end = '</a>'; |
548 | 548 | } |
549 | 549 | } |
550 | - return $opendocurl_start . api_get_person_name($firstname, $lastname) . ' (' . $username . ')' . $opendocurl_end; |
|
550 | + return $opendocurl_start.api_get_person_name($firstname, $lastname).' ('.$username.')'.$opendocurl_end; |
|
551 | 551 | } |
552 | 552 | |
553 | 553 | function sort_by_user($item1, $item2) |