Passed
Push — 1.10.x ( 04397c...5e25f1 )
by Angel Fernando Quiroz
181:14 queued 130:00
created
main/notebook/index.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 // Including the global initialization file
11 11
 require_once '../inc/global.inc.php';
12 12
 
13
-$current_course_tool  = TOOL_NOTEBOOK;
13
+$current_course_tool = TOOL_NOTEBOOK;
14 14
 
15 15
 // The section (tabs)
16 16
 $this_section = SECTION_COURSES;
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
         NotebookManager::display_notes();
97 97
     } else {
98 98
         echo '<div class="actions">';
99
-        echo '<a href="index.php">'.Display::return_icon('back.png',get_lang('BackToNotesList'),'',ICON_SIZE_MEDIUM).'</a>';
99
+        echo '<a href="index.php">'.Display::return_icon('back.png', get_lang('BackToNotesList'), '', ICON_SIZE_MEDIUM).'</a>';
100 100
         echo '</div>';
101 101
         $token = Security::get_token();
102 102
         $form->addElement('hidden', 'sec_token');
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
     } else {
148 148
         echo '<div class="actions">';
149 149
         echo '<a href="index.php">'.
150
-            Display::return_icon('back.png',get_lang('BackToNotesList'),'',ICON_SIZE_MEDIUM).'</a>';
150
+            Display::return_icon('back.png', get_lang('BackToNotesList'), '', ICON_SIZE_MEDIUM).'</a>';
151 151
         echo '</div>';
152 152
         $token = Security::get_token();
153 153
         $form->addElement('hidden', 'sec_token');
Please login to merge, or discard this patch.
main/announcements/download.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 $doc_url = str_replace(' ', '+', $doc_url);
29 29
 $doc_url = str_replace('/..', '', $doc_url); //echo $doc_url;
30 30
 
31
-if (strpos($doc_url,'../') OR strpos($doc_url,'/..')) {
31
+if (strpos($doc_url, '../') OR strpos($doc_url, '/..')) {
32 32
     $doc_url = '';
33 33
 }
34 34
 
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
     //remove last slash if present
44 44
     //$doc_url = ($doc_url{strlen($doc_url)-1}=='/')?substr($doc_url,0,strlen($doc_url)-1):$doc_url;
45 45
     //mod_rewrite can change /some/path/ to /some/path// in some cases, so clean them all off (René)
46
-    while ($doc_url{$dul = strlen($doc_url)-1}=='/') $doc_url = substr($doc_url,0,$dul);
46
+    while ($doc_url{$dul = strlen($doc_url) - 1} == '/') $doc_url = substr($doc_url, 0, $dul);
47 47
     //create the path
48 48
     $document_explorer = api_get_path(WEB_COURSE_PATH).api_get_course_path(); // home course path
49 49
     //redirect
@@ -62,12 +62,12 @@  discard block
 block discarded – undo
62 62
 $sql = "SELECT filename FROM $tbl_announcement_attachment
63 63
   	  	WHERE c_id = $course_id AND path LIKE BINARY '$doc_url'";
64 64
 
65
-$result= Database::query($sql);
65
+$result = Database::query($sql);
66 66
 if (Database::num_rows($result) > 0) {
67
-    $row= Database::fetch_array($result);
68
-    $title = str_replace(' ','_', $row['filename']);
67
+    $row = Database::fetch_array($result);
68
+    $title = str_replace(' ', '_', $row['filename']);
69 69
     if (Security::check_abs_path($full_file_name,
70
-        api_get_path(SYS_COURSE_PATH) . api_get_course_path() . '/upload/announcements/')
70
+        api_get_path(SYS_COURSE_PATH).api_get_course_path().'/upload/announcements/')
71 71
     ) {
72 72
         DocumentManager::file_send_for_download($full_file_name, true, $title);
73 73
     }
Please login to merge, or discard this patch.
main/announcements/announcements.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 $ctok = Security::get_existing_token();
25 25
 $stok = Security::get_token();
26 26
 
27
-$current_course_tool  = TOOL_ANNOUNCEMENT;
27
+$current_course_tool = TOOL_ANNOUNCEMENT;
28 28
 $this_section = SECTION_COURSES;
29 29
 $nameTools = get_lang('ToolAnnouncement');
30 30
 
@@ -37,10 +37,10 @@  discard block
 block discarded – undo
37 37
 $display_title_list = true;
38 38
 
39 39
 // Maximum title messages to display
40
-$maximum 	= '12';
40
+$maximum = '12';
41 41
 
42 42
 // Length of the titles
43
-$length 	= '36';
43
+$length = '36';
44 44
 
45 45
 // Database Table Definitions
46 46
 $tbl_courses = Database::get_main_table(TABLE_MAIN_COURSE);
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 
84 84
         if (!empty($sortDirection)) {
85 85
             if (!in_array(trim(strtoupper($sortDirection)), array('ASC', 'DESC'))) {
86
-                $sortDirection='ASC';
86
+                $sortDirection = 'ASC';
87 87
             }
88 88
 
89 89
             $announcementInfo = AnnouncementManager::get_by_id($course_id, $thisAnnouncementId);
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
     case 'delete':
136 136
         /* Delete announcement */
137 137
         $id = intval($_GET['id']);
138
-        if (api_get_session_id()!=0 && api_is_allowed_to_session_edit(false, true) == false) {
138
+        if (api_get_session_id() != 0 && api_is_allowed_to_session_edit(false, true) == false) {
139 139
             api_not_allowed();
140 140
         }
141 141
 
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 
202 202
         // DISPLAY ADD ANNOUNCEMENT COMMAND
203 203
         $id = isset($_GET['id']) ? intval($_GET['id']) : 0;
204
-        $url = api_get_self().'?action='.$action.'&id=' . $id . '&' . api_get_cidreq();
204
+        $url = api_get_self().'?action='.$action.'&id='.$id.'&'.api_get_cidreq();
205 205
 
206 206
         $form = new FormValidator(
207 207
             'f1',
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
                 );
243 243
                 // setting the variables for the form elements: the users who need to receive the message
244 244
                 foreach ($to as &$user) {
245
-                    $user = 'USER:' . $user;
245
+                    $user = 'USER:'.$user;
246 246
                 }
247 247
                 // setting the variables for the form elements: the message has to be sent by email
248 248
                 $email_ann = '1';
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
                         $insert_id = AnnouncementManager::add_group_announcement(
406 406
                             $data['title'],
407 407
                             $data['content'],
408
-                            array('GROUP:' . $group_id),
408
+                            array('GROUP:'.$group_id),
409 409
                             $data['users'],
410 410
                             $file,
411 411
                             $file_comment,
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
 
450 450
 if (empty($_GET['origin']) or $_GET['origin'] !== 'learnpath') {
451 451
     //we are not in the learning path
452
-    Display::display_header($nameTools,get_lang('Announcements'));
452
+    Display::display_header($nameTools, get_lang('Announcements'));
453 453
 }
454 454
 
455 455
 // Tool introduction
@@ -459,35 +459,35 @@  discard block
 block discarded – undo
459 459
 
460 460
 // Actions
461 461
 $show_actions = false;
462
-if ((api_is_allowed_to_edit(false,true) ||
462
+if ((api_is_allowed_to_edit(false, true) ||
463 463
     (api_get_course_setting('allow_user_edit_announcement') && !api_is_anonymous())) &&
464 464
     (empty($_GET['origin']) || $_GET['origin'] !== 'learnpath')
465 465
 ) {
466 466
     echo '<div class="actions">';
467
-    if (in_array($action, array('add', 'modify','view'))) {
467
+    if (in_array($action, array('add', 'modify', 'view'))) {
468 468
         echo "<a href='".api_get_self()."?".api_get_cidreq()."&origin=".$origin."'>".
469
-            Display::return_icon('back.png',get_lang('Back'),'',ICON_SIZE_MEDIUM)."</a>";
469
+            Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM)."</a>";
470 470
     } else {
471 471
         echo "<a href='".api_get_self()."?".api_get_cidreq()."&action=add&origin=".$origin."'>".
472
-            Display::return_icon('new_announce.png',get_lang('AddAnnouncement'),'',ICON_SIZE_MEDIUM)."</a>";
472
+            Display::return_icon('new_announce.png', get_lang('AddAnnouncement'), '', ICON_SIZE_MEDIUM)."</a>";
473 473
     }
474 474
     $show_actions = true;
475 475
 } else {
476 476
     if (in_array($action, array('view'))) {
477 477
         echo '<div class="actions">';
478 478
         echo "<a href='".api_get_self()."?".api_get_cidreq()."&origin=".$origin."'>".
479
-            Display::return_icon('back.png',get_lang('Back'),'',ICON_SIZE_MEDIUM)."</a>";
479
+            Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM)."</a>";
480 480
         echo '</div>';
481 481
     }
482 482
 }
483 483
 
484 484
 if (api_is_allowed_to_edit() && $announcement_number > 1) {
485
-    if (api_get_group_id() == 0 ) {
485
+    if (api_get_group_id() == 0) {
486 486
         if (!$show_actions)
487 487
             echo '<div class="actions">';
488 488
         if (!isset($_GET['action'])) {
489 489
             echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&action=delete_all\" onclick=\"javascript:if(!confirm('".get_lang("ConfirmYourChoice")."')) return false;\">".
490
-                Display::return_icon('delete_announce.png',get_lang('AnnouncementDeleteAll'),'',ICON_SIZE_MEDIUM)."</a>";
490
+                Display::return_icon('delete_announce.png', get_lang('AnnouncementDeleteAll'), '', ICON_SIZE_MEDIUM)."</a>";
491 491
         }
492 492
     }
493 493
 }
Please login to merge, or discard this patch.
main/survey/survey_invite.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 $tool_name = get_lang('SurveyPublication');
65 65
 
66 66
 // Displaying the header
67
-Display::display_header($tool_name,'Survey');
67
+Display::display_header($tool_name, 'Survey');
68 68
 
69 69
 echo '<script>
70 70
 $(function() {
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 );
133 133
 
134 134
 $form->addElement('html', '<div id="check_mail">');
135
-$form->addElement('checkbox', 'send_mail','', get_lang('SendMail'));
135
+$form->addElement('checkbox', 'send_mail', '', get_lang('SendMail'));
136 136
 $form->addElement('html', '</div>');
137 137
 
138 138
 $form->addElement('html', '<div id="mail_text_wrapper">');
@@ -219,8 +219,8 @@  discard block
 block discarded – undo
219 219
 	);
220 220
 
221 221
 	// Saving the invitations for the additional users
222
-	$values['additional_users'] = $values['additional_users'].';'; 	// This is for the case when you enter only one email
223
-	$temp = str_replace(',', ';', $values['additional_users']);		// This is to allow , and ; as email separators
222
+	$values['additional_users'] = $values['additional_users'].';'; // This is for the case when you enter only one email
223
+	$temp = str_replace(',', ';', $values['additional_users']); // This is to allow , and ; as email separators
224 224
 	$additional_users = explode(';', $temp);
225 225
 	for ($i = 0; $i < count($additional_users); $i++) {
226 226
 		$additional_users[$i] = trim($additional_users[$i]);
Please login to merge, or discard this patch.
main/survey/fillsurvey.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
         $now = api_get_utc_datetime();
113 113
         if (Database :: num_rows($result) == 0) {
114 114
             $params = [
115
-                'c_id' => $course_id ,
115
+                'c_id' => $course_id,
116 116
                 'survey_code' => $surveyCode,
117 117
                 'user' => $userid,
118 118
                 'invitation_code' => $autoInvitationcode,
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
     $jquery_ready_content = $returnParams['jquery_ready_content'];
472 472
 
473 473
 // the $jquery_ready_content variable collects all functions that will be load in the $(document).ready javascript function
474
-    $htmlHeadXtra[] ='<script>
474
+    $htmlHeadXtra[] = '<script>
475 475
     $(document).ready(function(){
476 476
         '.$jquery_ready_content.'
477 477
     });
@@ -904,16 +904,16 @@  discard block
 block discarded – undo
904 904
                             $group2 = $groups[0];
905 905
                             $secondary .= " OR ( survey_group_sec1 = '$group1' AND  survey_group_sec2 = '$group2') ";
906 906
                             $secondary .= " OR ( survey_group_sec1 = '$group2' AND survey_group_sec2 = '$group1' ) ";
907
-                            $combi.= $group1.' - '.$group2." or ".$group2.' - '.$group1.'<br />';
907
+                            $combi .= $group1.' - '.$group2." or ".$group2.' - '.$group1.'<br />';
908 908
                         } else {
909 909
                             if ($i != 0) {
910 910
                                 $secondary .= " OR ( survey_group_sec1 = '$group1' AND  survey_group_sec2 = '$group2') ";
911 911
                                 $secondary .= " OR ( survey_group_sec1 = '$group2' AND survey_group_sec2 = '$group1' ) ";
912
-                                $combi.= $group1.' - '.$group2." or ".$group2.' - '.$group1.'<br />';
912
+                                $combi .= $group1.' - '.$group2." or ".$group2.' - '.$group1.'<br />';
913 913
                             } else {
914 914
                                 $secondary .= " ( survey_group_sec1 = '$group1' AND  survey_group_sec2 = '$group2') ";
915 915
                                 $secondary .= " OR ( survey_group_sec1 = '$group2' AND survey_group_sec2 = '$group1' ) ";
916
-                                $combi.= $group1.' - '.$group2." or ".$group2.' - '.$group1.'<br />';
916
+                                $combi .= $group1.' - '.$group2." or ".$group2.' - '.$group1.'<br />';
917 917
                             }
918 918
                         }
919 919
                     }
@@ -1132,7 +1132,7 @@  discard block
 block discarded – undo
1132 1132
                         $questions[$row['sort']]['survey_group_sec1'] = $row['survey_group_sec1'];
1133 1133
                         $questions[$row['sort']]['survey_group_sec2'] = $row['survey_group_sec2'];
1134 1134
                         $questions[$row['sort']]['survey_group_pri'] = $row['survey_group_pri'];
1135
-                    }  else {
1135
+                    } else {
1136 1136
                         // If the type is a page break we are finished loading the questions for this page
1137 1137
                         break;
1138 1138
                     }
Please login to merge, or discard this patch.
main/survey/ch_yesno.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
                 $class = 'radio-inline';
44 44
             }
45 45
 
46
-            $name = 'question' . $questionData['question_id'];
46
+            $name = 'question'.$questionData['question_id'];
47 47
 
48 48
             $form->addRadio(
49 49
                 $name,
Please login to merge, or discard this patch.
main/survey/reporting.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 // Actions bar
150 150
 echo '<div class="actions">';
151 151
 echo '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey.php?survey_id='.$survey_id.'">'.
152
-    Display::return_icon('back.png', get_lang('BackToSurvey'),'',ICON_SIZE_MEDIUM).'</a>';
152
+    Display::return_icon('back.png', get_lang('BackToSurvey'), '', ICON_SIZE_MEDIUM).'</a>';
153 153
 echo '</div>';
154 154
 
155 155
 // Content
@@ -159,15 +159,15 @@  discard block
 block discarded – undo
159 159
 ) {
160 160
     $myweb_survey_id = $survey_id;
161 161
     echo '<div class="sectiontitle"><a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?action=questionreport&amp;survey_id='.$myweb_survey_id.'&amp;'.$cidReq.'&amp;single_page=1">'.
162
-        Display::return_icon('survey_reporting_overall.png',get_lang('QuestionsOverallReport')).' '.get_lang('QuestionsOverallReport').'</a></div><div class="sectioncomment">'.get_lang('QuestionsOverallReportDetail').' </div>';
162
+        Display::return_icon('survey_reporting_overall.png', get_lang('QuestionsOverallReport')).' '.get_lang('QuestionsOverallReport').'</a></div><div class="sectioncomment">'.get_lang('QuestionsOverallReportDetail').' </div>';
163 163
     echo '<div class="sectiontitle"><a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?action=questionreport&amp;survey_id='.$myweb_survey_id.'&'.$cidReq.'">'.
164
-        Display::return_icon('survey_reporting_question.gif',get_lang('DetailedReportByQuestion')).' '.get_lang('DetailedReportByQuestion').'</a></div><div class="sectioncomment">'.get_lang('DetailedReportByQuestionDetail').' </div>';
164
+        Display::return_icon('survey_reporting_question.gif', get_lang('DetailedReportByQuestion')).' '.get_lang('DetailedReportByQuestion').'</a></div><div class="sectioncomment">'.get_lang('DetailedReportByQuestionDetail').' </div>';
165 165
     echo '<div class="sectiontitle"><a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?action=userreport&amp;survey_id='.$myweb_survey_id.'&'.$cidReq.'">'.
166
-        Display::return_icon('survey_reporting_user.gif',get_lang('DetailedReportByUser')).' '.get_lang('DetailedReportByUser').'</a></div><div class="sectioncomment">'.get_lang('DetailedReportByUserDetail').'.</div>';
166
+        Display::return_icon('survey_reporting_user.gif', get_lang('DetailedReportByUser')).' '.get_lang('DetailedReportByUser').'</a></div><div class="sectioncomment">'.get_lang('DetailedReportByUserDetail').'.</div>';
167 167
     echo '<div class="sectiontitle"><a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?action=comparativereport&amp;survey_id='.$myweb_survey_id.'&'.$cidReq.'">'.
168
-        Display::return_icon('survey_reporting_comparative.gif',get_lang('ComparativeReport')).' '.get_lang('ComparativeReport').'</a></div><div class="sectioncomment">'.get_lang('ComparativeReportDetail').'.</div>';
168
+        Display::return_icon('survey_reporting_comparative.gif', get_lang('ComparativeReport')).' '.get_lang('ComparativeReport').'</a></div><div class="sectioncomment">'.get_lang('ComparativeReportDetail').'.</div>';
169 169
     echo '<div class="sectiontitle"><a href="reporting.php?action=completereport&amp;survey_id='.$myweb_survey_id.'&'.$cidReq.'">'.
170
-        Display::return_icon('survey_reporting_complete.gif',get_lang('CompleteReport')).' '.get_lang('CompleteReport').'</a></div><div class="sectioncomment">'.get_lang('CompleteReportDetail').'</div>';
170
+        Display::return_icon('survey_reporting_complete.gif', get_lang('CompleteReport')).' '.get_lang('CompleteReport').'</a></div><div class="sectioncomment">'.get_lang('CompleteReportDetail').'</div>';
171 171
 }
172 172
 
173 173
 // Footer
Please login to merge, or discard this patch.
main/survey/ch_multiplechoice.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
             foreach ($formData['answers'] as $key => $value) {
32 32
                 $this->getForm()->addHtmlEditor('answers['.$key.']', null, false, false, $config);
33 33
 
34
-                if ($key < $total-1) {
34
+                if ($key < $total - 1) {
35 35
                     //$this->getForm()->addButton("move_down[$key]", get_lang('Down'));
36 36
                 }
37 37
 
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
                     //$this->getForm()->addButton("move_up[$key]", get_lang('Up'));
40 40
                 }
41 41
 
42
-                if ($total> 2) {
42
+                if ($total > 2) {
43 43
                     $this->getForm()->addButton("delete_answer[$key]", get_lang('Delete'), 'trash', 'danger');
44 44
                 }
45 45
             }
Please login to merge, or discard this patch.
main/survey/ch_personality.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@
 block discarded – undo
59 59
         if (is_array($form_content['answers'])) {
60 60
             foreach ($form_content['answers'] as $key => & $value) {
61 61
                 $this->html .= '	<tr>';
62
-                $this->html .= '		<td align="right"><label for="answers['.$key.']">'.($key+1).'</label></td>';
62
+                $this->html .= '		<td align="right"><label for="answers['.$key.']">'.($key + 1).'</label></td>';
63 63
                 //$this->html .= '		<td><input type="text" name="answers['.$key.']" id="answers['.$key.']" value="'.$form_content['answers'][$key].'" /></td>';
64 64
                 $this->html .= '		<td width="550">'.api_return_html_area('answers['.$key.']', api_html_entity_decode(stripslashes($form_content['answers'][$key])), '', '', null, array('ToolbarSet' => 'Survey', 'Width' => '100%', 'Height' => '120')).'</td>';
65 65
                 $this->html .= '		<td>';
Please login to merge, or discard this patch.