@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | // We exit here if there is no valid $_GET parameter |
45 | 45 | if (!isset($_GET['survey_id']) || !is_numeric($_GET['survey_id'])) { |
46 | 46 | api_not_allowed(true, Display::return_message(get_lang('InvallidSurvey'), 'error', false)); |
47 | - exit; |
|
47 | + exit; |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | // Getting the survey information |
@@ -53,13 +53,13 @@ discard block |
||
53 | 53 | |
54 | 54 | if (empty($survey_data)) { |
55 | 55 | api_not_allowed(true, Display::return_message(get_lang('InvallidSurvey'), 'error', false)); |
56 | - exit; |
|
56 | + exit; |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | $urlname = strip_tags($survey_data['title']); |
60 | 60 | if (api_is_allowed_to_edit()) { |
61 | - // Breadcrumbs |
|
62 | - $interbreadcrumb[] = array( |
|
61 | + // Breadcrumbs |
|
62 | + $interbreadcrumb[] = array( |
|
63 | 63 | 'url' => api_get_path(WEB_CODE_PATH).'survey/survey_list.php?'.api_get_cidreq(), |
64 | 64 | 'name' => get_lang('SurveyList') |
65 | 65 | ); |
@@ -86,57 +86,57 @@ discard block |
||
86 | 86 | $counter_question = 0; |
87 | 87 | // Only a course admin is allowed to preview a survey: you are a course admin |
88 | 88 | if (api_is_course_admin() || |
89 | - (api_is_course_admin() && $_GET['isStudentView'] == 'true') || |
|
90 | - api_is_allowed_to_session_edit(false, true) |
|
89 | + (api_is_course_admin() && $_GET['isStudentView'] == 'true') || |
|
90 | + api_is_allowed_to_session_edit(false, true) |
|
91 | 91 | ) { |
92 | - // Survey information |
|
93 | - echo '<div id="survey_title">'.$survey_data['survey_title'].'</div>'; |
|
94 | - echo '<div id="survey_subtitle">'.$survey_data['survey_subtitle'].'</div>'; |
|
92 | + // Survey information |
|
93 | + echo '<div id="survey_title">'.$survey_data['survey_title'].'</div>'; |
|
94 | + echo '<div id="survey_subtitle">'.$survey_data['survey_subtitle'].'</div>'; |
|
95 | 95 | |
96 | - // Displaying the survey introduction |
|
97 | - if (!isset($_GET['show'])) { |
|
96 | + // Displaying the survey introduction |
|
97 | + if (!isset($_GET['show'])) { |
|
98 | 98 | if (!empty($survey_data['survey_introduction'])) { |
99 | 99 | echo '<div id="survey_content" class="survey_content">'.$survey_data['survey_introduction'].'</div>'; |
100 | 100 | } |
101 | - $limit = 0; |
|
102 | - } |
|
101 | + $limit = 0; |
|
102 | + } |
|
103 | 103 | |
104 | - // Displaying the survey thanks message |
|
105 | - if (isset($_POST['finish_survey'])) { |
|
106 | - Display::display_confirmation_message(get_lang('SurveyFinished')); |
|
104 | + // Displaying the survey thanks message |
|
105 | + if (isset($_POST['finish_survey'])) { |
|
106 | + Display::display_confirmation_message(get_lang('SurveyFinished')); |
|
107 | 107 | echo $survey_data['survey_thanks']; |
108 | - Display :: display_footer(); |
|
109 | - exit; |
|
110 | - } |
|
108 | + Display :: display_footer(); |
|
109 | + exit; |
|
110 | + } |
|
111 | 111 | |
112 | 112 | $questions = array(); |
113 | 113 | |
114 | - if (isset($_GET['show'])) { |
|
115 | - // Getting all the questions for this page and add them to a |
|
116 | - // multidimensional array where the first index is the page. |
|
117 | - // as long as there is no pagebreak fount we keep adding questions to the page |
|
118 | - $questions_displayed = array(); |
|
119 | - $paged_questions = array(); |
|
120 | - $counter = 0; |
|
121 | - $sql = "SELECT * FROM $table_survey_question |
|
114 | + if (isset($_GET['show'])) { |
|
115 | + // Getting all the questions for this page and add them to a |
|
116 | + // multidimensional array where the first index is the page. |
|
117 | + // as long as there is no pagebreak fount we keep adding questions to the page |
|
118 | + $questions_displayed = array(); |
|
119 | + $paged_questions = array(); |
|
120 | + $counter = 0; |
|
121 | + $sql = "SELECT * FROM $table_survey_question |
|
122 | 122 | WHERE c_id = $course_id AND survey_id = '".intval($survey_id)."' |
123 | 123 | ORDER BY sort ASC"; |
124 | - $result = Database::query($sql); |
|
124 | + $result = Database::query($sql); |
|
125 | 125 | $questions_exists = true; |
126 | 126 | if (Database::num_rows($result)) { |
127 | - while ($row = Database::fetch_array($result)) { |
|
128 | - if ($row['type'] == 'pagebreak') { |
|
129 | - $counter++; |
|
130 | - } else { |
|
131 | - $paged_questions[$counter][] = $row['question_id']; |
|
132 | - } |
|
133 | - } |
|
127 | + while ($row = Database::fetch_array($result)) { |
|
128 | + if ($row['type'] == 'pagebreak') { |
|
129 | + $counter++; |
|
130 | + } else { |
|
131 | + $paged_questions[$counter][] = $row['question_id']; |
|
132 | + } |
|
133 | + } |
|
134 | 134 | } else { |
135 | 135 | $questions_exists = false; |
136 | 136 | } |
137 | 137 | |
138 | - if (array_key_exists($_GET['show'], $paged_questions)) { |
|
139 | - $sql = "SELECT |
|
138 | + if (array_key_exists($_GET['show'], $paged_questions)) { |
|
139 | + $sql = "SELECT |
|
140 | 140 | survey_question.question_id, |
141 | 141 | survey_question.survey_id, |
142 | 142 | survey_question.survey_question, |
@@ -158,75 +158,75 @@ discard block |
||
158 | 158 | survey_question.c_id = $course_id |
159 | 159 | ORDER BY survey_question.sort, survey_question_option.sort ASC"; |
160 | 160 | |
161 | - $result = Database::query($sql); |
|
162 | - $question_counter_max = Database::num_rows($result); |
|
163 | - $limit = 0; |
|
164 | - while ($row = Database::fetch_array($result)) { |
|
165 | - // If the type is not a pagebreak we store it in the $questions array |
|
166 | - if ($row['type'] != 'pagebreak') { |
|
167 | - $questions[$row['sort']]['question_id'] = $row['question_id']; |
|
168 | - $questions[$row['sort']]['survey_id'] = $row['survey_id']; |
|
169 | - $questions[$row['sort']]['survey_question'] = $row['survey_question']; |
|
170 | - $questions[$row['sort']]['display'] = $row['display']; |
|
171 | - $questions[$row['sort']]['type'] = $row['type']; |
|
172 | - $questions[$row['sort']]['options'][intval($row['option_sort'])] = $row['option_text']; |
|
173 | - $questions[$row['sort']]['maximum_score'] = $row['max_value']; |
|
174 | - } else { |
|
175 | - // If the type is a pagebreak we are finished loading the questions for this page |
|
176 | - break; |
|
177 | - } |
|
178 | - $counter_question++; |
|
179 | - } |
|
180 | - } |
|
181 | - } |
|
182 | - |
|
183 | - // Selecting the maximum number of pages |
|
184 | - $sql = "SELECT * FROM $table_survey_question |
|
161 | + $result = Database::query($sql); |
|
162 | + $question_counter_max = Database::num_rows($result); |
|
163 | + $limit = 0; |
|
164 | + while ($row = Database::fetch_array($result)) { |
|
165 | + // If the type is not a pagebreak we store it in the $questions array |
|
166 | + if ($row['type'] != 'pagebreak') { |
|
167 | + $questions[$row['sort']]['question_id'] = $row['question_id']; |
|
168 | + $questions[$row['sort']]['survey_id'] = $row['survey_id']; |
|
169 | + $questions[$row['sort']]['survey_question'] = $row['survey_question']; |
|
170 | + $questions[$row['sort']]['display'] = $row['display']; |
|
171 | + $questions[$row['sort']]['type'] = $row['type']; |
|
172 | + $questions[$row['sort']]['options'][intval($row['option_sort'])] = $row['option_text']; |
|
173 | + $questions[$row['sort']]['maximum_score'] = $row['max_value']; |
|
174 | + } else { |
|
175 | + // If the type is a pagebreak we are finished loading the questions for this page |
|
176 | + break; |
|
177 | + } |
|
178 | + $counter_question++; |
|
179 | + } |
|
180 | + } |
|
181 | + } |
|
182 | + |
|
183 | + // Selecting the maximum number of pages |
|
184 | + $sql = "SELECT * FROM $table_survey_question |
|
185 | 185 | WHERE |
186 | 186 | c_id = $course_id AND |
187 | 187 | type='".Database::escape_string('pagebreak')."' AND |
188 | 188 | survey_id='".intval($survey_id)."'"; |
189 | - $result = Database::query($sql); |
|
190 | - $numberofpages = Database::num_rows($result) + 1; |
|
191 | - |
|
192 | - // Displaying the form with the questions |
|
193 | - if (isset($_GET['show'])) { |
|
194 | - $show = (int)$_GET['show'] + 1; |
|
195 | - } else { |
|
196 | - $show = 0; |
|
197 | - } |
|
198 | - |
|
199 | - $url = api_get_self().'?survey_id='.Security::remove_XSS($survey_id).'&show='.$show; |
|
200 | - $form = new FormValidator('question', 'post', $url); |
|
201 | - |
|
202 | - if (is_array($questions) && count($questions) > 0) { |
|
203 | - foreach ($questions as $key => & $question) { |
|
204 | - $ch_type = 'ch_'.$question['type']; |
|
205 | - /** @var survey_question $display */ |
|
206 | - $display = new $ch_type; |
|
207 | - $form->addHtml('<div class="survey_question_wrapper"><div class="survey_question">'); |
|
208 | - $form->addHtml($question['survey_question']); |
|
209 | - $display->render($form, $question); |
|
210 | - $form->addHtml('</div></div>'); |
|
211 | - } |
|
212 | - } |
|
213 | - |
|
214 | - if (($show < $numberofpages) || (!$_GET['show'] && count($questions) > 0)) { |
|
189 | + $result = Database::query($sql); |
|
190 | + $numberofpages = Database::num_rows($result) + 1; |
|
191 | + |
|
192 | + // Displaying the form with the questions |
|
193 | + if (isset($_GET['show'])) { |
|
194 | + $show = (int)$_GET['show'] + 1; |
|
195 | + } else { |
|
196 | + $show = 0; |
|
197 | + } |
|
198 | + |
|
199 | + $url = api_get_self().'?survey_id='.Security::remove_XSS($survey_id).'&show='.$show; |
|
200 | + $form = new FormValidator('question', 'post', $url); |
|
201 | + |
|
202 | + if (is_array($questions) && count($questions) > 0) { |
|
203 | + foreach ($questions as $key => & $question) { |
|
204 | + $ch_type = 'ch_'.$question['type']; |
|
205 | + /** @var survey_question $display */ |
|
206 | + $display = new $ch_type; |
|
207 | + $form->addHtml('<div class="survey_question_wrapper"><div class="survey_question">'); |
|
208 | + $form->addHtml($question['survey_question']); |
|
209 | + $display->render($form, $question); |
|
210 | + $form->addHtml('</div></div>'); |
|
211 | + } |
|
212 | + } |
|
213 | + |
|
214 | + if (($show < $numberofpages) || (!$_GET['show'] && count($questions) > 0)) { |
|
215 | 215 | if ($show == 0) { |
216 | - $form->addButton('next_survey_page', get_lang('StartSurvey'), 'arrow-right', 'success', 'large'); |
|
216 | + $form->addButton('next_survey_page', get_lang('StartSurvey'), 'arrow-right', 'success', 'large'); |
|
217 | 217 | } else { |
218 | - $form->addButton('next_survey_page', get_lang('NextQuestion'), 'arrow-right'); |
|
218 | + $form->addButton('next_survey_page', get_lang('NextQuestion'), 'arrow-right'); |
|
219 | 219 | } |
220 | - } |
|
221 | - if ($show >= $numberofpages && $_GET['show'] || (isset($_GET['show']) && count($questions) == 0)) { |
|
222 | - if ($questions_exists == false) { |
|
223 | - echo '<p>'.get_lang('ThereAreNotQuestionsForthisSurvey').'</p>'; |
|
224 | - } |
|
225 | - $form->addButton('finish_survey', get_lang('FinishSurvey'), 'arrow-right'); |
|
226 | - } |
|
227 | - $form->display(); |
|
220 | + } |
|
221 | + if ($show >= $numberofpages && $_GET['show'] || (isset($_GET['show']) && count($questions) == 0)) { |
|
222 | + if ($questions_exists == false) { |
|
223 | + echo '<p>'.get_lang('ThereAreNotQuestionsForthisSurvey').'</p>'; |
|
224 | + } |
|
225 | + $form->addButton('finish_survey', get_lang('FinishSurvey'), 'arrow-right'); |
|
226 | + } |
|
227 | + $form->display(); |
|
228 | 228 | } else { |
229 | - Display :: display_error_message(get_lang('NotAllowed'), false); |
|
229 | + Display :: display_error_message(get_lang('NotAllowed'), false); |
|
230 | 230 | } |
231 | 231 | |
232 | 232 | Display :: display_footer(); |
@@ -94,12 +94,12 @@ |
||
94 | 94 | */ |
95 | 95 | protected $assignedLastUser; |
96 | 96 | |
97 | - /** |
|
98 | - * @var Status |
|
99 | - * |
|
100 | - * @ORM\ManyToOne(targetEntity="Chamilo\TicketBundle\Entity\Status") |
|
101 | - * @ORM\JoinColumn(name="status_id", referencedColumnName="id") |
|
102 | - **/ |
|
97 | + /** |
|
98 | + * @var Status |
|
99 | + * |
|
100 | + * @ORM\ManyToOne(targetEntity="Chamilo\TicketBundle\Entity\Status") |
|
101 | + * @ORM\JoinColumn(name="status_id", referencedColumnName="id") |
|
102 | + **/ |
|
103 | 103 | protected $status; |
104 | 104 | |
105 | 105 | /** |
@@ -56,7 +56,7 @@ |
||
56 | 56 | */ |
57 | 57 | protected $filename; |
58 | 58 | |
59 | - /** |
|
59 | + /** |
|
60 | 60 | * @var integer |
61 | 61 | * |
62 | 62 | * @ORM\Column(name="size", type="integer", nullable=false, unique=false) |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | // When creating a new course this settings are added to the course |
12 | 12 | public $course_settings = array( |
13 | - array( |
|
13 | + array( |
|
14 | 14 | 'name' => 'course_block_pre_footer', |
15 | 15 | 'type' => 'textarea' |
16 | 16 | ), |
@@ -66,9 +66,9 @@ discard block |
||
66 | 66 | } |
67 | 67 | |
68 | 68 | /** |
69 | - * @param string $region |
|
70 | - * @return string |
|
71 | - */ |
|
69 | + * @param string $region |
|
70 | + * @return string |
|
71 | + */ |
|
72 | 72 | public function renderRegion($region) |
73 | 73 | { |
74 | 74 | $content = ''; |
@@ -53,12 +53,12 @@ |
||
53 | 53 | */ |
54 | 54 | protected $ipAddress; |
55 | 55 | |
56 | - /** |
|
57 | - * @var Ticket |
|
58 | - * |
|
59 | - * @ORM\ManyToOne(targetEntity="Chamilo\TicketBundle\Entity\Ticket") |
|
60 | - * @ORM\JoinColumn(name="ticket_id", referencedColumnName="id") |
|
61 | - **/ |
|
56 | + /** |
|
57 | + * @var Ticket |
|
58 | + * |
|
59 | + * @ORM\ManyToOne(targetEntity="Chamilo\TicketBundle\Entity\Ticket") |
|
60 | + * @ORM\JoinColumn(name="ticket_id", referencedColumnName="id") |
|
61 | + **/ |
|
62 | 62 | protected $ticket; |
63 | 63 | |
64 | 64 | /** |
@@ -10,7 +10,7 @@ |
||
10 | 10 | |
11 | 11 | api_protect_course_script(); |
12 | 12 | if (!api_is_allowed_to_edit()) { |
13 | - api_not_allowed(); |
|
13 | + api_not_allowed(); |
|
14 | 14 | } |
15 | 15 | $course_info = api_get_course_info(); |
16 | 16 | $course_code = $course_info['code']; |
@@ -101,7 +101,7 @@ |
||
101 | 101 | "categories.php?action=delete&id={$row['id']}" |
102 | 102 | ); |
103 | 103 | |
104 | - return $result; |
|
104 | + return $result; |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | Display::display_header($plugin->get_lang('MyTickets')); |
@@ -49,12 +49,12 @@ discard block |
||
49 | 49 | ); |
50 | 50 | } |
51 | 51 | |
52 | - /** |
|
53 | - * Displays the page header |
|
54 | - * @param string The name of the page (will be showed in the page title) |
|
55 | - * @param string Optional help file name |
|
56 | - * @param string $page_header |
|
57 | - */ |
|
52 | + /** |
|
53 | + * Displays the page header |
|
54 | + * @param string The name of the page (will be showed in the page title) |
|
55 | + * @param string Optional help file name |
|
56 | + * @param string $page_header |
|
57 | + */ |
|
58 | 58 | public static function display_header($tool_name ='', $help = null, $page_header = null) |
59 | 59 | { |
60 | 60 | $origin = api_get_origin(); |
@@ -448,7 +448,7 @@ discard block |
||
448 | 448 | */ |
449 | 449 | public static function display_normal_message($message, $filter = true, $returnValue = false) |
450 | 450 | { |
451 | - $message = self::return_message($message, 'normal', $filter); |
|
451 | + $message = self::return_message($message, 'normal', $filter); |
|
452 | 452 | if ($returnValue) { |
453 | 453 | return $message; |
454 | 454 | } else { |
@@ -528,22 +528,22 @@ discard block |
||
528 | 528 | } |
529 | 529 | |
530 | 530 | if ($filter) { |
531 | - $message = api_htmlentities($message, ENT_QUOTES, api_is_xml_http_request() ? 'UTF-8' : api_get_system_encoding()); |
|
531 | + $message = api_htmlentities($message, ENT_QUOTES, api_is_xml_http_request() ? 'UTF-8' : api_get_system_encoding()); |
|
532 | 532 | } |
533 | 533 | |
534 | 534 | $class = ""; |
535 | 535 | switch($type) { |
536 | 536 | case 'warning': |
537 | 537 | $class .= 'alert alert-warning'; |
538 | - break; |
|
538 | + break; |
|
539 | 539 | case 'error': |
540 | 540 | $class .= 'alert alert-danger'; |
541 | - break; |
|
541 | + break; |
|
542 | 542 | case 'confirmation': |
543 | 543 | case 'confirm': |
544 | 544 | case 'success': |
545 | 545 | $class .= 'alert alert-success'; |
546 | - break; |
|
546 | + break; |
|
547 | 547 | case 'normal': |
548 | 548 | default: |
549 | 549 | $class .= 'alert alert-info'; |
@@ -686,7 +686,7 @@ discard block |
||
686 | 686 | * @param array additional attributes (for instance height, width, onclick, ...) |
687 | 687 | * @param integer The wanted width of the icon (to be looked for in the corresponding img/icons/ folder) |
688 | 688 | * @return void |
689 | - */ |
|
689 | + */ |
|
690 | 690 | public static function display_icon( |
691 | 691 | $image, |
692 | 692 | $alt_text = '', |
@@ -722,7 +722,7 @@ discard block |
||
722 | 722 | * @author Julio Montoya 2010 Function improved, adding image constants |
723 | 723 | * @author Yannick Warnier 2011 Added size handler |
724 | 724 | * @version Feb 2011 |
725 | - */ |
|
725 | + */ |
|
726 | 726 | public static function return_icon( |
727 | 727 | $image, |
728 | 728 | $alt_text = '', |
@@ -911,14 +911,14 @@ discard block |
||
911 | 911 | */ |
912 | 912 | public static function input($type, $name, $value, $attributes = array()) |
913 | 913 | { |
914 | - if (isset($type)) { |
|
915 | - $attributes['type']= $type; |
|
916 | - } |
|
917 | - if (isset($name)) { |
|
918 | - $attributes['name']= $name; |
|
919 | - } |
|
920 | - if (isset($value)) { |
|
921 | - $attributes['value']= $value; |
|
914 | + if (isset($type)) { |
|
915 | + $attributes['type']= $type; |
|
916 | + } |
|
917 | + if (isset($name)) { |
|
918 | + $attributes['name']= $name; |
|
919 | + } |
|
920 | + if (isset($value)) { |
|
921 | + $attributes['value']= $value; |
|
922 | 922 | } |
923 | 923 | return self::tag('input', '', $attributes); |
924 | 924 | } |
@@ -931,10 +931,10 @@ discard block |
||
931 | 931 | */ |
932 | 932 | public static function button($name, $value, $attributes = array()) |
933 | 933 | { |
934 | - if (!empty($name)) { |
|
934 | + if (!empty($name)) { |
|
935 | 935 | $attributes['name'] = $name; |
936 | - } |
|
937 | - return self::tag('button', $value, $attributes); |
|
936 | + } |
|
937 | + return self::tag('button', $value, $attributes); |
|
938 | 938 | } |
939 | 939 | |
940 | 940 | /** |
@@ -1001,7 +1001,7 @@ discard block |
||
1001 | 1001 | * in the $htmlHeadXtra variable before the display_header |
1002 | 1002 | * Add this script |
1003 | 1003 | * @example |
1004 | - * <script> |
|
1004 | + * <script> |
|
1005 | 1005 | $(function() { |
1006 | 1006 | $( "#tabs" ).tabs(); |
1007 | 1007 | }); |
@@ -1067,20 +1067,20 @@ discard block |
||
1067 | 1067 | */ |
1068 | 1068 | public static function tabsOnlyLink($headers, $selected = null) |
1069 | 1069 | { |
1070 | - $id = uniqid(); |
|
1071 | - $i = 1; |
|
1072 | - $lis = null; |
|
1073 | - foreach ($headers as $item) { |
|
1070 | + $id = uniqid(); |
|
1071 | + $i = 1; |
|
1072 | + $lis = null; |
|
1073 | + foreach ($headers as $item) { |
|
1074 | 1074 | $class = null; |
1075 | 1075 | if ($i == $selected) { |
1076 | 1076 | $class = 'active'; |
1077 | 1077 | } |
1078 | - $item = self::tag( |
|
1079 | - 'a', |
|
1080 | - $item['content'], |
|
1081 | - array('id' => $id.'-'.$i, 'href' => $item['url']) |
|
1082 | - ); |
|
1083 | - $lis .= self::tag('li', $item, array('class' => $class)); |
|
1078 | + $item = self::tag( |
|
1079 | + 'a', |
|
1080 | + $item['content'], |
|
1081 | + array('id' => $id.'-'.$i, 'href' => $item['url']) |
|
1082 | + ); |
|
1083 | + $lis .= self::tag('li', $item, array('class' => $class)); |
|
1084 | 1084 | $i++; |
1085 | 1085 | } |
1086 | 1086 | return self::tag('ul', $lis, array('class' => 'nav nav-tabs tabs-margin')); |
@@ -1292,8 +1292,8 @@ discard block |
||
1292 | 1292 | */ |
1293 | 1293 | public static function table($headers, $rows, $attributes = array()) |
1294 | 1294 | { |
1295 | - if (empty($attributes)) { |
|
1296 | - $attributes['class'] = 'data_table'; |
|
1295 | + if (empty($attributes)) { |
|
1296 | + $attributes['class'] = 'data_table'; |
|
1297 | 1297 | } |
1298 | 1298 | $table = new HTML_Table($attributes); |
1299 | 1299 | $row = 0; |
@@ -1301,17 +1301,17 @@ discard block |
||
1301 | 1301 | |
1302 | 1302 | // Course headers |
1303 | 1303 | if (!empty($headers)) { |
1304 | - foreach ($headers as $item) { |
|
1305 | - $table->setHeaderContents($row, $column, $item); |
|
1306 | - $column++; |
|
1307 | - } |
|
1308 | - $row = 1; |
|
1309 | - $column = 0; |
|
1304 | + foreach ($headers as $item) { |
|
1305 | + $table->setHeaderContents($row, $column, $item); |
|
1306 | + $column++; |
|
1307 | + } |
|
1308 | + $row = 1; |
|
1309 | + $column = 0; |
|
1310 | 1310 | } |
1311 | 1311 | |
1312 | 1312 | if (!empty($rows)) { |
1313 | - foreach($rows as $content) { |
|
1314 | - $table->setCellContents($row, $column, $content); |
|
1313 | + foreach($rows as $content) { |
|
1314 | + $table->setCellContents($row, $column, $content); |
|
1315 | 1315 | $row++; |
1316 | 1316 | } |
1317 | 1317 | } |
@@ -1417,7 +1417,7 @@ discard block |
||
1417 | 1417 | //$item_property['tool'] != TOOL_DROPBOX && |
1418 | 1418 | $item_property['tool'] != TOOL_NOTEBOOK && |
1419 | 1419 | $item_property['tool'] != TOOL_CHAT) |
1420 | - ) |
|
1420 | + ) |
|
1421 | 1421 | ) |
1422 | 1422 | // Take only what's visible or "invisible but where the user is a teacher" or where the visibility is unset. |
1423 | 1423 | && ($item_property['visibility'] == '1' |
@@ -1433,7 +1433,7 @@ discard block |
||
1433 | 1433 | ($item_property['to_user_id'] != $user_id) && |
1434 | 1434 | (!isset($item_property['to_group_id']) || !in_array($item_property['to_group_id'], $group_ids))) |
1435 | 1435 | ) { |
1436 | - continue; |
|
1436 | + continue; |
|
1437 | 1437 | } |
1438 | 1438 | |
1439 | 1439 | // If it's a survey, make sure the user's invited. Otherwise drop it. |
@@ -1651,21 +1651,21 @@ discard block |
||
1651 | 1651 | * |
1652 | 1652 | * @param string id of the rating ul element |
1653 | 1653 | * @param string url that will be added (for jquery see hot_courses.tpl) |
1654 | - * @param string point info array see function CourseManager::get_course_ranking() |
|
1655 | - * @param bool add a div wrapper |
|
1656 | - * @todo use templates |
|
1654 | + * @param string point info array see function CourseManager::get_course_ranking() |
|
1655 | + * @param bool add a div wrapper |
|
1656 | + * @todo use templates |
|
1657 | 1657 | **/ |
1658 | 1658 | public static function return_rating_system($id, $url, $point_info = array(), $add_div_wrapper = true) |
1659 | 1659 | { |
1660 | - $number_of_users_who_voted = isset($point_info['users_who_voted']) ? $point_info['users_who_voted'] : null; |
|
1661 | - $percentage = isset($point_info['point_average']) ? $point_info['point_average'] : 0; |
|
1660 | + $number_of_users_who_voted = isset($point_info['users_who_voted']) ? $point_info['users_who_voted'] : null; |
|
1661 | + $percentage = isset($point_info['point_average']) ? $point_info['point_average'] : 0; |
|
1662 | 1662 | |
1663 | - if (!empty($percentage)) { |
|
1663 | + if (!empty($percentage)) { |
|
1664 | 1664 | $percentage = $percentage*125/100; |
1665 | 1665 | } |
1666 | - $accesses = isset($point_info['accesses']) ? $point_info['accesses'] : 0; |
|
1666 | + $accesses = isset($point_info['accesses']) ? $point_info['accesses'] : 0; |
|
1667 | 1667 | |
1668 | - $star_label = sprintf(get_lang('XStarsOutOf5'), $point_info['point_average_star']); |
|
1668 | + $star_label = sprintf(get_lang('XStarsOutOf5'), $point_info['point_average_star']); |
|
1669 | 1669 | |
1670 | 1670 | $html = '<ul id="'.$id.'" class="star-rating"> |
1671 | 1671 | <li class="current-rating" style="width:'.$percentage.'px;"></li> |
@@ -1676,26 +1676,26 @@ discard block |
||
1676 | 1676 | <li><a href="javascript:void(0);" data-link="'.$url.'&star=5" title="'.$star_label.'" class="five-stars">5</a></li> |
1677 | 1677 | </ul>'; |
1678 | 1678 | |
1679 | - $labels = array(); |
|
1679 | + $labels = array(); |
|
1680 | 1680 | |
1681 | - $labels[]= $number_of_users_who_voted == 1 ? $number_of_users_who_voted.' '.get_lang('Vote') : $number_of_users_who_voted.' '.get_lang('Votes'); |
|
1682 | - $labels[]= $accesses == 1 ? $accesses.' '.get_lang('Visit') : $accesses.' '.get_lang('Visits'); |
|
1683 | - /* if (!empty($number_of_users_who_voted)) { |
|
1681 | + $labels[]= $number_of_users_who_voted == 1 ? $number_of_users_who_voted.' '.get_lang('Vote') : $number_of_users_who_voted.' '.get_lang('Votes'); |
|
1682 | + $labels[]= $accesses == 1 ? $accesses.' '.get_lang('Visit') : $accesses.' '.get_lang('Visits'); |
|
1683 | + /* if (!empty($number_of_users_who_voted)) { |
|
1684 | 1684 | $labels[]= get_lang('Average').' '.$point_info['point_average_star'].'/5'; |
1685 | 1685 | } */ |
1686 | 1686 | |
1687 | - $labels[]= $point_info['user_vote'] ? get_lang('YourVote').' ['.$point_info['user_vote'].']' : get_lang('YourVote'). ' [?] '; |
|
1687 | + $labels[]= $point_info['user_vote'] ? get_lang('YourVote').' ['.$point_info['user_vote'].']' : get_lang('YourVote'). ' [?] '; |
|
1688 | 1688 | |
1689 | - if (!$add_div_wrapper && api_is_anonymous()) { |
|
1690 | - $labels[]= Display::tag('span', get_lang('LoginToVote'), array('class' => 'error')); |
|
1691 | - } |
|
1689 | + if (!$add_div_wrapper && api_is_anonymous()) { |
|
1690 | + $labels[]= Display::tag('span', get_lang('LoginToVote'), array('class' => 'error')); |
|
1691 | + } |
|
1692 | 1692 | |
1693 | 1693 | $html .= Display::div(implode(' | ', $labels) , array('id' => 'vote_label_'.$id, 'class' => 'vote_label_info')); |
1694 | 1694 | $html .= ' '.Display::span(' ', array('id' => 'vote_label2_'.$id)); |
1695 | 1695 | |
1696 | 1696 | if ($add_div_wrapper) { |
1697 | - $html = Display::div($html, array('id' => 'rating_wrapper_'.$id)); |
|
1698 | - } |
|
1697 | + $html = Display::div($html, array('id' => 'rating_wrapper_'.$id)); |
|
1698 | + } |
|
1699 | 1699 | |
1700 | 1700 | return $html; |
1701 | 1701 | } |
@@ -1733,8 +1733,8 @@ discard block |
||
1733 | 1733 | return self::page_header($title, $second_title); |
1734 | 1734 | } |
1735 | 1735 | |
1736 | - public static function page_subheader_and_translate($title, $second_title = null) |
|
1737 | - { |
|
1736 | + public static function page_subheader_and_translate($title, $second_title = null) |
|
1737 | + { |
|
1738 | 1738 | $title = get_lang($title); |
1739 | 1739 | return self::page_subheader($title, $second_title); |
1740 | 1740 | } |
@@ -105,8 +105,8 @@ discard block |
||
105 | 105 | |
106 | 106 | if (isset($_POST['language'])) { |
107 | 107 | |
108 | - $form->addElement('static', Security::remove_XSS($_POST['language'])); |
|
109 | - $form->addElement('hidden', 'language', Security::remove_XSS($_POST['language'])); |
|
108 | + $form->addElement('static', Security::remove_XSS($_POST['language'])); |
|
109 | + $form->addElement('hidden', 'language', Security::remove_XSS($_POST['language'])); |
|
110 | 110 | $form->addHtmlEditor( |
111 | 111 | 'content', |
112 | 112 | get_lang('Content'), |
@@ -136,8 +136,8 @@ discard block |
||
136 | 136 | $form->addElement('html', $buttons); |
137 | 137 | |
138 | 138 | } else { |
139 | - $form->addElement('select_language', 'language', get_lang('Language'),null,array()); |
|
140 | - $form->addButtonSearch(get_lang('Load'), 'send'); |
|
139 | + $form->addElement('select_language', 'language', get_lang('Language'),null,array()); |
|
140 | + $form->addButtonSearch(get_lang('Load'), 'send'); |
|
141 | 141 | |
142 | 142 | } |
143 | 143 |