Completed
Push — 1.11.x ( ca7787...41c0f2 )
by José
31:51
created
main/admin/system_announcements.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 
15 15
 // Setting the section (for the tabs).
16 16
 $this_section = SECTION_PLATFORM_ADMIN;
17
-$_SESSION['this_section']=$this_section;
17
+$_SESSION['this_section'] = $this_section;
18 18
 
19 19
 $action = isset($_GET['action']) ? $_GET['action'] : null;
20 20
 $action_todo = false;
@@ -35,12 +35,12 @@  discard block
 block discarded – undo
35 35
 }
36 36
 
37 37
 if (!empty($action)) {
38
-    $interbreadcrumb[] = array ("url" => "system_announcements.php", "name" => get_lang('SystemAnnouncements'));
38
+    $interbreadcrumb[] = array("url" => "system_announcements.php", "name" => get_lang('SystemAnnouncements'));
39 39
     if ($action == 'add') {
40
-        $interbreadcrumb[] = array ("url" => '#', "name" => get_lang('AddAnnouncement'));
40
+        $interbreadcrumb[] = array("url" => '#', "name" => get_lang('AddAnnouncement'));
41 41
     }
42 42
     if ($action == 'edit') {
43
-        $interbreadcrumb[] = array ("url" => '#', "name" => get_lang('Edit'));
43
+        $interbreadcrumb[] = array("url" => '#', "name" => get_lang('Edit'));
44 44
     }
45 45
 } else {
46 46
     $tool_name = get_lang('SystemAnnouncements');
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 }
67 67
 
68 68
 // Actions
69
-switch($action) {
69
+switch ($action) {
70 70
     case 'make_visible':
71 71
     case 'make_invisible':
72 72
         $status = false;
@@ -162,9 +162,9 @@  discard block
 block discarded – undo
162 162
 
163 163
     $group = array();
164 164
 
165
-    $group[]= $form->createElement('checkbox', 'visible_teacher', null, get_lang('Teacher'));
166
-    $group[]= $form->createElement('checkbox', 'visible_student', null, get_lang('Student'));
167
-    $group[]= $form->createElement('checkbox', 'visible_guest', null, get_lang('Guest'));
165
+    $group[] = $form->createElement('checkbox', 'visible_teacher', null, get_lang('Teacher'));
166
+    $group[] = $form->createElement('checkbox', 'visible_student', null, get_lang('Student'));
167
+    $group[] = $form->createElement('checkbox', 'visible_guest', null, get_lang('Guest'));
168 168
 
169 169
     $form->addGroup($group, null, get_lang('Visible'));
170 170
 
@@ -187,15 +187,15 @@  discard block
 block discarded – undo
187 187
 
188 188
     $form->addElement('checkbox', 'send_mail', null, get_lang('SendMail'));
189 189
 
190
-    if (isset($_REQUEST['action']) && $_REQUEST['action']=='add') {
190
+    if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'add') {
191 191
         $form->addElement('checkbox', 'add_to_calendar', null, get_lang('AddToCalendar'));
192
-        $text=get_lang('AddNews');
193
-        $class='add';
192
+        $text = get_lang('AddNews');
193
+        $class = 'add';
194 194
         $form->addElement('hidden', 'action', 'add');
195 195
 
196 196
     } elseif (isset($_REQUEST['action']) && $_REQUEST['action'] == 'edit') {
197
-        $text=get_lang('EditNews');
198
-        $class='save';
197
+        $text = get_lang('EditNews');
198
+        $class = 'save';
199 199
         $form->addElement('hidden', 'action', 'edit');
200 200
     }
201 201
     $form->addElement('checkbox', 'send_email_test', null, get_lang('SendOnlyAnEmailToMySelfToTest'));
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
 
294 294
 if ($show_announcement_list) {
295 295
     $announcements = SystemAnnouncementManager :: get_all_announcements();
296
-    $announcement_data = array ();
296
+    $announcement_data = array();
297 297
     foreach ($announcements as $index => $announcement) {
298 298
         $row = array();
299 299
         $row[] = $announcement->id;
@@ -301,9 +301,9 @@  discard block
 block discarded – undo
301 301
         $row[] = $announcement->title;
302 302
         $row[] = api_convert_and_format_date($announcement->date_start);
303 303
         $row[] = api_convert_and_format_date($announcement->date_end);
304
-        $row[] = "<a href=\"?id=".$announcement->id."&person=".SystemAnnouncementManager::VISIBLE_TEACHER."&action=". ($announcement->visible_teacher ? 'make_invisible' : 'make_visible')."\">".Display::return_icon(($announcement->visible_teacher  ? 'eyes.png' : 'eyes-close.png'), get_lang('ShowOrHide'))."</a>";
305
-        $row[] = "<a href=\"?id=".$announcement->id."&person=".SystemAnnouncementManager::VISIBLE_STUDENT."&action=". ($announcement->visible_student  ? 'make_invisible' : 'make_visible')."\">".Display::return_icon(($announcement->visible_student  ? 'eyes.png' : 'eyes-close.png'), get_lang('ShowOrHide'))."</a>";
306
-        $row[] = "<a href=\"?id=".$announcement->id."&person=".SystemAnnouncementManager::VISIBLE_GUEST."&action=". ($announcement->visible_guest ? 'make_invisible' : 'make_visible')."\">".Display::return_icon(($announcement->visible_guest  ? 'eyes.png' : 'eyes-close.png'), get_lang('ShowOrHide'))."</a>";
304
+        $row[] = "<a href=\"?id=".$announcement->id."&person=".SystemAnnouncementManager::VISIBLE_TEACHER."&action=".($announcement->visible_teacher ? 'make_invisible' : 'make_visible')."\">".Display::return_icon(($announcement->visible_teacher ? 'eyes.png' : 'eyes-close.png'), get_lang('ShowOrHide'))."</a>";
305
+        $row[] = "<a href=\"?id=".$announcement->id."&person=".SystemAnnouncementManager::VISIBLE_STUDENT."&action=".($announcement->visible_student ? 'make_invisible' : 'make_visible')."\">".Display::return_icon(($announcement->visible_student ? 'eyes.png' : 'eyes-close.png'), get_lang('ShowOrHide'))."</a>";
306
+        $row[] = "<a href=\"?id=".$announcement->id."&person=".SystemAnnouncementManager::VISIBLE_GUEST."&action=".($announcement->visible_guest ? 'make_invisible' : 'make_visible')."\">".Display::return_icon(($announcement->visible_guest ? 'eyes.png' : 'eyes-close.png'), get_lang('ShowOrHide'))."</a>";
307 307
 
308 308
         $row[] = $announcement->lang;
309 309
         $row[] = "<a href=\"?action=edit&id=".$announcement->id."\">".Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL)."</a> <a href=\"?action=delete&id=".$announcement->id."\"  onclick=\"javascript:if(!confirm('".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES))."')) return false;\">".Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL)."</a>";
Please login to merge, or discard this patch.
main/course_description/add.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -11,26 +11,26 @@
 block discarded – undo
11 11
 api_protect_course_script(true);
12 12
 
13 13
 // display categories
14
-$categories = array ();
14
+$categories = array();
15 15
 foreach ($default_description_titles as $id => $title) {
16 16
     $categories[$id] = $title;
17 17
 }
18 18
 $categories[ADD_BLOCK] = get_lang('NewBloc');
19 19
 
20
-$i=1;
20
+$i = 1;
21 21
 echo '<div class="actions" style="margin-bottom:30px">';
22 22
 echo '<a href="index.php?'.api_get_cidreq().'">'.
23
-	Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('ToolCourseDescription'),'',ICON_SIZE_MEDIUM).
23
+	Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('ToolCourseDescription'), '', ICON_SIZE_MEDIUM).
24 24
 	'</a>';
25 25
 ksort($categories);
26 26
 foreach ($categories as $id => $title) {
27 27
     if ($i == ADD_BLOCK) {
28 28
         echo '<a href="index.php?'.api_get_cidreq().'&action=add">'.
29
-            Display::return_icon($default_description_icon[$id], $title, '',ICON_SIZE_MEDIUM).'</a>';
29
+            Display::return_icon($default_description_icon[$id], $title, '', ICON_SIZE_MEDIUM).'</a>';
30 30
         break;
31 31
     } else {
32 32
         echo '<a href="index.php?action=edit&'.api_get_cidreq().'&description_type='.$id.'">'.
33
-            Display::return_icon($default_description_icon[$id], $title,'',ICON_SIZE_MEDIUM).'</a>';
33
+            Display::return_icon($default_description_icon[$id], $title, '', ICON_SIZE_MEDIUM).'</a>';
34 34
         $i++;
35 35
     }
36 36
 }
Please login to merge, or discard this patch.
main/blog/blog.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 api_protect_course_script(true);
22 22
 
23 23
 $lib_path = api_get_path(LIBRARY_PATH);
24
-$blog_table_attachment 	= Database::get_course_table(TABLE_BLOGS_ATTACHMENT);
24
+$blog_table_attachment = Database::get_course_table(TABLE_BLOGS_ATTACHMENT);
25 25
 
26 26
 $nameTools  = get_lang('Blogs');
27 27
 $DaysShort  = api_get_week_days_short();
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 		$safe_comment_title,
135 135
 		$safe_comment_text,
136 136
 		$blog_id,
137
-		(int)$_GET['post_id'],
137
+		(int) $_GET['post_id'],
138 138
 		$_POST['comment_parent_id'],
139 139
 		$_POST['task_id']
140 140
 	);
@@ -146,29 +146,29 @@  discard block
 block discarded – undo
146 146
 if (!empty($_POST['register'])) {
147 147
 	if (is_array($_POST['user'])) {
148 148
 		foreach ($_POST['user'] as $index => $user_id) {
149
-			Blog :: set_user_subscribed((int)$_GET['blog_id'], $user_id);
149
+			Blog :: set_user_subscribed((int) $_GET['blog_id'], $user_id);
150 150
 		}
151 151
 	}
152 152
 }
153 153
 if (!empty($_POST['unregister'])) {
154 154
 	if (is_array($_POST['user'])) {
155 155
 		foreach ($_POST['user'] as $index => $user_id) {
156
-			Blog :: set_user_unsubscribed((int)$_GET['blog_id'], $user_id);
156
+			Blog :: set_user_unsubscribed((int) $_GET['blog_id'], $user_id);
157 157
 		}
158 158
 	}
159 159
 }
160 160
 if (!empty($_GET['register'])) {
161
-	Blog :: set_user_subscribed((int)$_GET['blog_id'], (int)$_GET['user_id']);
161
+	Blog :: set_user_subscribed((int) $_GET['blog_id'], (int) $_GET['user_id']);
162 162
 	$return_message = array('type' => 'confirmation', 'message' => get_lang('UserRegistered'));
163 163
 	$flag = 1;
164 164
 }
165 165
 if (!empty($_GET['unregister'])) {
166
-	Blog :: set_user_unsubscribed((int)$_GET['blog_id'], (int)$_GET['user_id']);
166
+	Blog :: set_user_unsubscribed((int) $_GET['blog_id'], (int) $_GET['user_id']);
167 167
 }
168 168
 
169 169
 if (isset($_GET['action']) && $_GET['action'] == 'manage_tasks') {
170 170
 	if (isset($_GET['do']) && $_GET['do'] == 'delete') {
171
-		Blog :: delete_task($blog_id, (int)$_GET['task_id']);
171
+		Blog :: delete_task($blog_id, (int) $_GET['task_id']);
172 172
 		$return_message = array('type' => 'confirmation', 'message' => get_lang('TaskDeleted'));
173 173
 	}
174 174
 
@@ -181,9 +181,9 @@  discard block
 block discarded – undo
181 181
 if (isset($_GET['action']) && $_GET['action'] == 'view_post') {
182 182
 	$task_id = (isset ($_GET['task_id']) && is_numeric($_GET['task_id'])) ? $_GET['task_id'] : 0;
183 183
 
184
-	if (isset($_GET['do']) && $_GET['do'] == 'delete_comment')	{
184
+	if (isset($_GET['do']) && $_GET['do'] == 'delete_comment') {
185 185
 		if (api_is_allowed('BLOG_'.$blog_id, 'article_comments_delete', $task_id)) {
186
-			Blog :: delete_comment($blog_id, (int)$_GET['post_id'],(int)$_GET['comment_id']);
186
+			Blog :: delete_comment($blog_id, (int) $_GET['post_id'], (int) $_GET['comment_id']);
187 187
 			$return_message = array('type' => 'confirmation', 'message' => get_lang('CommentDeleted'));
188 188
 		} else {
189 189
 			$error = true;
@@ -191,9 +191,9 @@  discard block
 block discarded – undo
191 191
 		}
192 192
 	}
193 193
 
194
-	if (isset($_GET['do']) && $_GET['do'] == 'delete_article')	{
194
+	if (isset($_GET['do']) && $_GET['do'] == 'delete_article') {
195 195
 		if (api_is_allowed('BLOG_'.$blog_id, 'article_delete', $task_id)) {
196
-			Blog :: delete_post($blog_id, (int)$_GET['article_id']);
196
+			Blog :: delete_post($blog_id, (int) $_GET['article_id']);
197 197
 			$action = ''; // Article is gone, go to blog home
198 198
 			$return_message = array('type' => 'confirmation', 'message' => get_lang('BlogDeleted'));
199 199
 		} else {
@@ -204,13 +204,13 @@  discard block
 block discarded – undo
204 204
 	if (isset($_GET['do']) && $_GET['do'] == 'rate') {
205 205
 		if (isset($_GET['type']) && $_GET['type'] == 'post') {
206 206
 			if (api_is_allowed('BLOG_'.$blog_id, 'article_rate')) {
207
-				Blog :: add_rating('post', $blog_id, (int)$_GET['post_id'], (int)$_GET['rating']);
207
+				Blog :: add_rating('post', $blog_id, (int) $_GET['post_id'], (int) $_GET['rating']);
208 208
 				$return_message = array('type' => 'confirmation', 'message' => get_lang('RatingAdded'));
209 209
 			}
210 210
 		}
211 211
 		if (isset($_GET['type']) && $_GET['type'] == 'comment') {
212 212
 			if (api_is_allowed('BLOG_'.$blog_id, 'article_comments_add')) {
213
-				Blog :: add_rating('comment', $blog_id, (int)$_GET['comment_id'], (int)$_GET['rating']);
213
+				Blog :: add_rating('comment', $blog_id, (int) $_GET['comment_id'], (int) $_GET['rating']);
214 214
 				$return_message = array('type' => 'confirmation', 'message' => get_lang('RatingAdded'));
215 215
 			}
216 216
 		}
@@ -289,16 +289,16 @@  discard block
 block discarded – undo
289 289
 echo '<div class=actions>';
290 290
 ?>
291 291
 	<a href="<?php echo api_get_self(); ?>?blog_id=<?php echo $blog_id ?>&<?php echo api_get_cidreq(); ?>" title="<?php echo get_lang('Home') ?>">
292
-    <?php echo Display::return_icon('blog.png', get_lang('Home'),'',ICON_SIZE_MEDIUM); ?></a>
293
-	<?php if(api_is_allowed('BLOG_'.$blog_id, 'article_add')) { ?>
292
+    <?php echo Display::return_icon('blog.png', get_lang('Home'), '', ICON_SIZE_MEDIUM); ?></a>
293
+	<?php if (api_is_allowed('BLOG_'.$blog_id, 'article_add')) { ?>
294 294
     <a href="<?php echo api_get_self(); ?>?action=new_post&amp;blog_id=<?php echo $blog_id ?>" title="<?php echo get_lang('NewPost') ?>">
295
-    <?php echo Display::return_icon('new_article.png', get_lang('NewPost'),'',ICON_SIZE_MEDIUM); ?></a><?php } ?>
296
-	<?php if(api_is_allowed('BLOG_'.$blog_id, 'task_management')) { ?>
295
+    <?php echo Display::return_icon('new_article.png', get_lang('NewPost'), '', ICON_SIZE_MEDIUM); ?></a><?php } ?>
296
+	<?php if (api_is_allowed('BLOG_'.$blog_id, 'task_management')) { ?>
297 297
     <a href="<?php echo api_get_self(); ?>?action=manage_tasks&amp;blog_id=<?php echo $blog_id ?>" title="<?php echo get_lang('ManageTasks') ?>">
298
-    <?php echo Display::return_icon('blog_tasks.png', get_lang('TaskManager'),'',ICON_SIZE_MEDIUM); ?></a><?php } ?>
299
-	<?php if(api_is_allowed('BLOG_'.$blog_id, 'member_management')) { ?>
298
+    <?php echo Display::return_icon('blog_tasks.png', get_lang('TaskManager'), '', ICON_SIZE_MEDIUM); ?></a><?php } ?>
299
+	<?php if (api_is_allowed('BLOG_'.$blog_id, 'member_management')) { ?>
300 300
     <a href="<?php echo api_get_self(); ?>?action=manage_members&amp;blog_id=<?php echo $blog_id ?>" title="<?php echo get_lang('ManageMembers') ?>">
301
-    <?php echo Display::return_icon('blog_admin_users.png', get_lang('MemberManager'),'',ICON_SIZE_MEDIUM); ?></a><?php } ?>
301
+    <?php echo Display::return_icon('blog_admin_users.png', get_lang('MemberManager'), '', ICON_SIZE_MEDIUM); ?></a><?php } ?>
302 302
 <?php
303 303
 echo '</div>';
304 304
 
@@ -315,8 +315,8 @@  discard block
 block discarded – undo
315 315
             <div class="panel-heading"><?php echo get_lang('Calendar') ?></div>
316 316
             <div class="panel-body">
317 317
                 <?php
318
-                    $month = isset($_GET['month']) ? (int)$_GET['month'] : (int) date('m');
319
-                    $year = isset($_GET['year']) ? (int)$_GET['year'] : date('Y');
318
+                    $month = isset($_GET['month']) ? (int) $_GET['month'] : (int) date('m');
319
+                    $year = isset($_GET['year']) ? (int) $_GET['year'] : date('Y');
320 320
                     Blog::display_minimonthcalendar($month, $year, $blog_id);
321 321
                 ?>
322 322
             </div>
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
 $course_id = api_get_course_int_id();
363 363
 
364 364
 if (isset ($_GET['task_id']) && is_numeric($_GET['task_id'])) {
365
-	$task_id = (int)$_GET['task_id'];
365
+	$task_id = (int) $_GET['task_id'];
366 366
 } else {
367 367
 	$task_id = 0;
368 368
 	$tbl_blogs_tasks_rel_user = Database :: get_course_table(TABLE_BLOGS_TASKS_REL_USER);
Please login to merge, or discard this patch.
main/gradebook/gradebook_add_link.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
 GradebookUtils::block_students();
15 15
 
16 16
 $courseCode = isset($_GET['course_code']) ? Security::remove_XSS($_GET['course_code']) : null;
17
-$selectCat =  isset($_GET['selectcat']) ? (int) $_GET['selectcat'] : 0;
17
+$selectCat = isset($_GET['selectcat']) ? (int) $_GET['selectcat'] : 0;
18 18
 
19 19
 $course_info = api_get_course_info($courseCode);
20 20
 $tbl_forum_thread = Database :: get_course_table(TABLE_FORUM_THREAD);
Please login to merge, or discard this patch.
main/gradebook/gradebook_showlog_link.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -39,15 +39,15 @@
 block discarded – undo
39 39
         FROM ".$t_link_log." lk inner join ".$t_user." us
40 40
         ON lk.user_id_log=us.user_id
41 41
         WHERE lk.id_linkeval_log=".$evaledit[0]->get_id()." AND lk.type='link';";
42
-$result=Database::query($sql);
43
-$list_info=array();
44
-while ($row=Database::fetch_row($result)) {
42
+$result = Database::query($sql);
43
+$list_info = array();
44
+while ($row = Database::fetch_row($result)) {
45 45
     $list_info[] = $row;
46 46
 }
47 47
 
48 48
 foreach ($list_info as $key => $info_log) {
49
-    $list_info[$key][5]=($info_log[5]) ? api_convert_and_format_date($info_log[5]) : 'N/A';
50
-    $list_info[$key][3]=($info_log[3]==1) ? get_lang('GradebookVisible') : get_lang('GradebookInvisible');
49
+    $list_info[$key][5] = ($info_log[5]) ? api_convert_and_format_date($info_log[5]) : 'N/A';
50
+    $list_info[$key][3] = ($info_log[3] == 1) ? get_lang('GradebookVisible') : get_lang('GradebookInvisible');
51 51
 }
52 52
 
53 53
 $parameters = array(
Please login to merge, or discard this patch.
main/gradebook/lib/fe/usertable.class.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -87,8 +87,8 @@  discard block
 block discarded – undo
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];
@@ -124,15 +124,15 @@  discard block
 block discarded – undo
124 124
             // evaluation
125 125
             case 'E':
126 126
                 return '&nbsp;'
127
-                . '<a href="gradebook_view_result.php?selecteval=' . $item->get_id() . '">'
127
+                . '<a href="gradebook_view_result.php?selecteval='.$item->get_id().'">'
128 128
                 . $item->get_name()
129 129
                 . '</a>';
130 130
             // link
131 131
             case 'L':
132
-                return '&nbsp;<a href="' . $item->get_link() . '">'
132
+                return '&nbsp;<a href="'.$item->get_link().'">'
133 133
                 . $item->get_name()
134 134
                 . '</a>'
135
-                . '&nbsp;[' . $item->get_type_name() . ']';
135
+                . '&nbsp;['.$item->get_type_name().']';
136 136
         }
137 137
     }
138 138
 }
Please login to merge, or discard this patch.
main/gradebook/lib/fe/linkform.class.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
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 61
         $this->addElement(
62 62
             'static',
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
         $link = LinkFactory::create($link);
139 139
         if (!empty($courseCode)) {
140 140
             $link->set_course_code($courseCode);
141
-        } elseif(!empty($_GET['course_code'])) {
141
+        } elseif (!empty($_GET['course_code'])) {
142 142
             $link->set_course_code(Database::escape_string($_GET['course_code'], null, false));
143 143
         }
144 144
 
Please login to merge, or discard this patch.
main/gradebook/lib/user_data_generator.class.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -50,9 +50,9 @@  discard block
 block discarded – undo
50 50
 
51 51
         }
52 52
         if (count($result) == 0) {
53
-            $evals_filtered=$evals;
53
+            $evals_filtered = $evals;
54 54
         } else {
55
-            $evals_filtered=$evals_filtered_copy;
55
+            $evals_filtered = $evals_filtered_copy;
56 56
         }
57 57
         $this->items = array_merge($evals_filtered, $links);
58 58
 
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
     {
86 86
         // do some checks on count, redefine if invalid value
87 87
         if (!isset($count)) {
88
-            $count = count ($this->items) - $start;
88
+            $count = count($this->items) - $start;
89 89
         }
90 90
         if ($count < 0) {
91 91
             $count = 0;
@@ -104,20 +104,20 @@  discard block
 block discarded – undo
104 104
         } elseif ($sorting & self :: UDG_SORT_AVERAGE) {
105 105
             // if user sorts on average scores, first calculate them and cache them
106 106
             foreach ($allitems as $item) {
107
-                $this->avgcache[$item->get_item_type() . $item->get_id()]= $item->calc_score();
107
+                $this->avgcache[$item->get_item_type().$item->get_id()] = $item->calc_score();
108 108
             }
109 109
             usort($allitems, array('UserDataGenerator', 'sort_by_average'));
110 110
         } elseif ($sorting & self :: UDG_SORT_SCORE) {
111 111
             // if user sorts on student's scores, first calculate them and cache them
112 112
             foreach ($allitems as $item) {
113
-                $this->scorecache[$item->get_item_type() . $item->get_id()]
113
+                $this->scorecache[$item->get_item_type().$item->get_id()]
114 114
                     = $item->calc_score($this->userid);
115 115
             }
116 116
             usort($allitems, array('UserDataGenerator', 'sort_by_score'));
117 117
         } elseif ($sorting & self :: UDG_SORT_MASK) {
118 118
             // if user sorts on student's masks, first calculate scores and cache them
119 119
             foreach ($allitems as $item) {
120
-                $this->scorecache[$item->get_item_type() . $item->get_id()]
120
+                $this->scorecache[$item->get_item_type().$item->get_id()]
121 121
                     = $item->calc_score($this->userid);
122 122
             }
123 123
             usort($allitems, array('UserDataGenerator', 'sort_by_mask'));
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
         // fill score cache if not done yet
133 133
         if (!isset ($this->scorecache)) {
134 134
             foreach ($visibleitems as $item) {
135
-                $this->scorecache[$item->get_item_type() . $item->get_id()]
135
+                $this->scorecache[$item->get_item_type().$item->get_id()]
136 136
                     = $item->calc_score($this->userid);
137 137
             }
138 138
 
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
         $scoredisplay = ScoreDisplay :: instance();
142 142
         $data = array();
143 143
         foreach ($visibleitems as $item) {
144
-            $row = array ();
144
+            $row = array();
145 145
             $row[] = $item;
146 146
             $row[] = $item->get_name();
147 147
             $row[] = $this->build_course_name($item);
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
     function sort_by_type($item1, $item2)
164 164
     {
165 165
         if ($item1->get_item_type() == $item2->get_item_type()) {
166
-            return $this->sort_by_name($item1,$item2);
166
+            return $this->sort_by_name($item1, $item2);
167 167
         } else {
168 168
             return ($item1->get_item_type() < $item2->get_item_type() ? -1 : 1);
169 169
         }
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
      */
204 204
     function sort_by_name($item1, $item2)
205 205
     {
206
-        return api_strnatcmp($item1->get_name(),$item2->get_name());
206
+        return api_strnatcmp($item1->get_name(), $item2->get_name());
207 207
     }
208 208
 
209 209
     /**
@@ -213,8 +213,8 @@  discard block
 block discarded – undo
213 213
      */
214 214
     function sort_by_average($item1, $item2)
215 215
     {
216
-        $score1 = $this->avgcache[$item1->get_item_type() . $item1->get_id()];
217
-        $score2 = $this->avgcache[$item2->get_item_type() . $item2->get_id()];
216
+        $score1 = $this->avgcache[$item1->get_item_type().$item1->get_id()];
217
+        $score2 = $this->avgcache[$item2->get_item_type().$item2->get_id()];
218 218
 
219 219
         return $this->compare_scores($score1, $score2);
220 220
     }
@@ -226,8 +226,8 @@  discard block
 block discarded – undo
226 226
      */
227 227
     function sort_by_score($item1, $item2)
228 228
     {
229
-        $score1 = $this->scorecache[$item1->get_item_type() . $item1->get_id()];
230
-        $score2 = $this->scorecache[$item2->get_item_type() . $item2->get_id()];
229
+        $score1 = $this->scorecache[$item1->get_item_type().$item1->get_id()];
230
+        $score2 = $this->scorecache[$item2->get_item_type().$item2->get_id()];
231 231
 
232 232
         return $this->compare_scores($score1, $score2);
233 233
     }
@@ -239,8 +239,8 @@  discard block
 block discarded – undo
239 239
      */
240 240
     function sort_by_mask($item1, $item2)
241 241
     {
242
-        $score1 = $this->scorecache[$item1->get_item_type() . $item1->get_id()];
243
-        $score2 = $this->scorecache[$item2->get_item_type() . $item2->get_id()];
242
+        $score1 = $this->scorecache[$item1->get_item_type().$item1->get_id()];
243
+        $score2 = $this->scorecache[$item2->get_item_type().$item2->get_id()];
244 244
 
245 245
         return ScoreDisplay :: compare_scores_by_custom_display($score1, $score2);
246 246
     }
@@ -256,10 +256,10 @@  discard block
 block discarded – undo
256 256
             return (isset($score2) ? 1 : 0);
257 257
         } elseif (!isset($score2)) {
258 258
             return -1;
259
-        } elseif (($score1[0]/$score1[1]) == ($score2[0]/$score2[1])) {
259
+        } elseif (($score1[0] / $score1[1]) == ($score2[0] / $score2[1])) {
260 260
             return 0;
261 261
         } else {
262
-            return (($score1[0]/$score1[1]) < ($score2[0]/$score2[1]) ? -1 : 1);
262
+            return (($score1[0] / $score1[1]) < ($score2[0] / $score2[1]) ? -1 : 1);
263 263
         }
264 264
     }
265 265
 
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
     private function build_average_column($item, $ignore_score_color)
292 292
     {
293 293
         if (isset($this->avgcache)) {
294
-            $avgscore = $this->avgcache[$item->get_item_type() . $item->get_id()];
294
+            $avgscore = $this->avgcache[$item->get_item_type().$item->get_id()];
295 295
         } else {
296 296
             $avgscore = $item->calc_score();
297 297
         }
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
      */
312 312
     private function build_result_column($item, $ignore_score_color)
313 313
     {
314
-        $studscore = $this->scorecache[$item->get_item_type() . $item->get_id()];
314
+        $studscore = $this->scorecache[$item->get_item_type().$item->get_id()];
315 315
         $scoredisplay = ScoreDisplay :: instance();
316 316
         $displaytype = SCORE_DIV_PERCENT;
317 317
         if ($ignore_score_color) {
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
      */
329 329
     private function build_mask_column($item, $ignore_score_color)
330 330
     {
331
-        $studscore = $this->scorecache[$item->get_item_type() . $item->get_id()];
331
+        $studscore = $this->scorecache[$item->get_item_type().$item->get_id()];
332 332
         $scoredisplay = ScoreDisplay :: instance();
333 333
         $displaytype = SCORE_DIV_PERCENT;
334 334
         if ($ignore_score_color) {
Please login to merge, or discard this patch.
main/gradebook/lib/gradebook_result.class.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
     /**
15 15
      * constructor of the class
16 16
      */
17
-    public function __construct($get_questions=false,$get_answers=false)
17
+    public function __construct($get_questions = false, $get_answers = false)
18 18
     {
19 19
     }
20 20
 
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 
38 38
         foreach ($dato[0] as $header_col) {
39 39
             if (!empty($header_col)) {
40
-                $data .= str_replace("\r\n",'  ',api_html_entity_decode(strip_tags($header_col))).';';
40
+                $data .= str_replace("\r\n", '  ', api_html_entity_decode(strip_tags($header_col))).';';
41 41
             }
42 42
         }
43 43
 
@@ -46,10 +46,10 @@  discard block
 block discarded – undo
46 46
 
47 47
         for ($i = 0; $i < $cant_students; $i++) {
48 48
             $column = 0;
49
-            foreach($dato[1][$i] as $col_name) {
50
-                $data .= str_replace("\r\n",'  ',api_html_entity_decode(strip_tags($col_name))).';';
49
+            foreach ($dato[1][$i] as $col_name) {
50
+                $data .= str_replace("\r\n", '  ', api_html_entity_decode(strip_tags($col_name))).';';
51 51
             }
52
-            $data .="\r\n";
52
+            $data .= "\r\n";
53 53
         }
54 54
 
55 55
         //output the results
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
      */
125 125
     public function exportCompleteReportDOC($data)
126 126
     {
127
-        $filename = 'gradebook_results_'.api_get_local_time() . '.docx';
127
+        $filename = 'gradebook_results_'.api_get_local_time().'.docx';
128 128
 
129 129
         $doc = new \PhpOffice\PhpWord\PhpWord();
130 130
         $section = $doc->addSection(['orientation' => 'landscape']);
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
             }
144 144
         }
145 145
 
146
-        $file = api_get_path(SYS_ARCHIVE_PATH) . api_replace_dangerous_char($filename);
146
+        $file = api_get_path(SYS_ARCHIVE_PATH).api_replace_dangerous_char($filename);
147 147
         $doc->save($file, 'Word2007');
148 148
 
149 149
         DocumentManager::file_send_for_download($file, true, $filename);
Please login to merge, or discard this patch.