Passed
Push — 1.10.x ( b65d66...f75118 )
by
unknown
51:21
created
main/document/edit_draw.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -29,25 +29,25 @@  discard block
 block discarded – undo
29 29
     $my_cur_dir_path = Security::remove_XSS($_GET['curdirpath']);
30 30
 }
31 31
 
32
-$dir= str_replace('\\', '/',$dir);//and urlencode each url $curdirpath (hack clean $curdirpath under Windows - Bug #3261)
32
+$dir = str_replace('\\', '/', $dir); //and urlencode each url $curdirpath (hack clean $curdirpath under Windows - Bug #3261)
33 33
 
34 34
 /* Constants & Variables */
35
-$current_session_id=api_get_session_id();
35
+$current_session_id = api_get_session_id();
36 36
 $group_id = api_get_group_id();
37 37
 
38 38
 //path for svg-edit save
39
-$_SESSION['draw_dir']=Security::remove_XSS($dir);
40
-if ($_SESSION['draw_dir']=='/'){
39
+$_SESSION['draw_dir'] = Security::remove_XSS($dir);
40
+if ($_SESSION['draw_dir'] == '/') {
41 41
 	$_SESSION['draw_dir'] = '';
42 42
 }
43
-$_SESSION['draw_file']=basename(Security::remove_XSS($file_path));
43
+$_SESSION['draw_file'] = basename(Security::remove_XSS($file_path));
44 44
 $get_file = Security::remove_XSS($file_path);
45 45
 $file = basename($get_file);
46
-$temp_file = explode(".",$file);
47
-$filename=$temp_file[0];
48
-$nameTools = get_lang('EditDocument') . ': '.$filename;
46
+$temp_file = explode(".", $file);
47
+$filename = $temp_file[0];
48
+$nameTools = get_lang('EditDocument').': '.$filename;
49 49
 
50
-$courseDir   = $_course['path'].'/document';
50
+$courseDir = $_course['path'].'/document';
51 51
 $is_allowed_to_edit = api_is_allowed_to_edit(null, true);
52 52
 
53 53
 /*	Other initialization code */
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 //groups //TODO:clean
81 81
 if (!empty($group_id)) {
82 82
 	$req_gid = '&gidReq='.$group_id;
83
-	$interbreadcrumb[] = array ('url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?gidReq='.$group_id, 'name' => get_lang('GroupSpace'));
83
+	$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?gidReq='.$group_id, 'name' => get_lang('GroupSpace'));
84 84
 	$group_document = true;
85 85
 	$noPHP_SELF = true;
86 86
 }
@@ -88,15 +88,15 @@  discard block
 block discarded – undo
88 88
 $is_certificate_mode = DocumentManager::is_certificate_mode($dir);
89 89
 
90 90
 if (!$is_certificate_mode)
91
-	$interbreadcrumb[]= array("url" => "./document.php?curdirpath=".urlencode($my_cur_dir_path).$req_gid, "name"=> get_lang('Documents'));
91
+	$interbreadcrumb[] = array("url" => "./document.php?curdirpath=".urlencode($my_cur_dir_path).$req_gid, "name"=> get_lang('Documents'));
92 92
 else
93
-	$interbreadcrumb[]= array ('url' => '../gradebook/'.$_SESSION['gradebook_dest'], 'name' => get_lang('Gradebook'));
93
+	$interbreadcrumb[] = array('url' => '../gradebook/'.$_SESSION['gradebook_dest'], 'name' => get_lang('Gradebook'));
94 94
 
95 95
 // Interbreadcrumb for the current directory root path
96 96
 if (empty($document_data['parents'])) {
97 97
     $interbreadcrumb[] = array('url' => '#', 'name' => $document_data['title']);
98 98
 } else {
99
-    foreach($document_data['parents'] as $document_sub_data) {
99
+    foreach ($document_data['parents'] as $document_sub_data) {
100 100
         if ($document_data['title'] == $document_sub_data['title']) {
101 101
             continue;
102 102
         }
@@ -115,18 +115,18 @@  discard block
 block discarded – undo
115 115
 
116 116
 Display :: display_header($nameTools, 'Doc');
117 117
 echo '<div class="actions">';
118
-		echo '<a href="document.php?id='.$parent_id.'">'.Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>';
119
-		echo '<a href="edit_document.php?'.api_get_cidreq().'&id='.$document_id.$req_gid.'&origin=editdraw">'.Display::return_icon('edit.png',get_lang('Rename').'/'.get_lang('Comments'),'',ICON_SIZE_MEDIUM).'</a>';
118
+		echo '<a href="document.php?id='.$parent_id.'">'.Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview'), '', ICON_SIZE_MEDIUM).'</a>';
119
+		echo '<a href="edit_document.php?'.api_get_cidreq().'&id='.$document_id.$req_gid.'&origin=editdraw">'.Display::return_icon('edit.png', get_lang('Rename').'/'.get_lang('Comments'), '', ICON_SIZE_MEDIUM).'</a>';
120 120
 echo '</div>';
121 121
 
122 122
 if (api_browser_support('svg')) {
123 123
 	//automatic loading the course language
124 124
 	$svgedit_code_translation_table = array('' => 'en', 'pt' => 'pt-Pt', 'sr' => 'sr_latn');
125
-	$langsvgedit  = api_get_language_isocode();
125
+	$langsvgedit = api_get_language_isocode();
126 126
 	$langsvgedit = isset($svgedit_code_translation_table[$langsvgedit]) ? $svgedit_code_translation_table[$langsvgedit] : $langsvgedit;
127 127
 	$langsvgedit = file_exists(api_get_path(LIBRARY_PATH).'svg-edit/locale/lang.'.$langsvgedit.'.js') ? $langsvgedit : 'en';
128 128
 
129
-	$svg_url= api_get_path(WEB_LIBRARY_PATH).'svg-edit/svg-editor.php?url=../../../../courses/'.$courseDir.$dir.$file.'&amp;lang='.$langsvgedit;
129
+	$svg_url = api_get_path(WEB_LIBRARY_PATH).'svg-edit/svg-editor.php?url=../../../../courses/'.$courseDir.$dir.$file.'&amp;lang='.$langsvgedit;
130 130
 
131 131
 	?>
132 132
 
Please login to merge, or discard this patch.
main/document/edit_paint.php 1 patch
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -33,26 +33,26 @@  discard block
 block discarded – undo
33 33
     $my_cur_dir_path = isset($_GET['curdirpath']) ? Security::remove_XSS($_GET['curdirpath']) : null;
34 34
 }
35 35
 
36
-$dir= str_replace('\\', '/', $dir);//and urlencode each url $curdirpath (hack clean $curdirpath under Windows - Bug #3261)
36
+$dir = str_replace('\\', '/', $dir); //and urlencode each url $curdirpath (hack clean $curdirpath under Windows - Bug #3261)
37 37
 
38 38
 /* Constants & Variables */
39
-$current_session_id=api_get_session_id();
39
+$current_session_id = api_get_session_id();
40 40
 //path for pixlr save
41
-$_SESSION['paint_dir']=Security::remove_XSS($dir);
42
-if($_SESSION['paint_dir']=='/'){
43
-    $_SESSION['paint_dir']='';
41
+$_SESSION['paint_dir'] = Security::remove_XSS($dir);
42
+if ($_SESSION['paint_dir'] == '/') {
43
+    $_SESSION['paint_dir'] = '';
44 44
 }
45
-$_SESSION['paint_file']=basename(Security::remove_XSS($file_path));
45
+$_SESSION['paint_file'] = basename(Security::remove_XSS($file_path));
46 46
 
47 47
 $get_file = Security::remove_XSS($file_path);
48 48
 
49 49
 $file = basename($get_file);
50 50
 
51
-$temp_file = explode(".",$file);
52
-$filename=$temp_file[0];
53
-$nameTools = get_lang('EditDocument') . ': '.$filename;
51
+$temp_file = explode(".", $file);
52
+$filename = $temp_file[0];
53
+$nameTools = get_lang('EditDocument').': '.$filename;
54 54
 
55
-$courseDir   = $_course['path'].'/document';
55
+$courseDir = $_course['path'].'/document';
56 56
 
57 57
 $is_allowed_to_edit = api_is_allowed_to_edit(null, true);
58 58
 
@@ -96,15 +96,15 @@  discard block
 block discarded – undo
96 96
 $is_certificate_mode = DocumentManager::is_certificate_mode($dir);
97 97
 
98 98
 if (!$is_certificate_mode)
99
-	$interbreadcrumb[]= array("url" => "./document.php?curdirpath=".urlencode($my_cur_dir_path).'&'.api_get_cidreq(), "name"=> get_lang('Documents'));
99
+	$interbreadcrumb[] = array("url" => "./document.php?curdirpath=".urlencode($my_cur_dir_path).'&'.api_get_cidreq(), "name"=> get_lang('Documents'));
100 100
 else
101
-	$interbreadcrumb[]= array ('url' => '../gradebook/'.$_SESSION['gradebook_dest'], 'name' => get_lang('Gradebook'));
101
+	$interbreadcrumb[] = array('url' => '../gradebook/'.$_SESSION['gradebook_dest'], 'name' => get_lang('Gradebook'));
102 102
 
103 103
 // Interbreadcrumb for the current directory root path
104 104
 if (empty($document_data['parents'])) {
105 105
     $interbreadcrumb[] = array('url' => '#', 'name' => $document_data['title']);
106 106
 } else {
107
-    foreach($document_data['parents'] as $document_sub_data) {
107
+    foreach ($document_data['parents'] as $document_sub_data) {
108 108
         if ($document_data['title'] == $document_sub_data['title']) {
109 109
             continue;
110 110
         }
@@ -124,33 +124,33 @@  discard block
 block discarded – undo
124 124
 Display :: display_header($nameTools, 'Doc');
125 125
 echo '<div class="actions">';
126 126
 echo '<a href="document.php?id='.$parent_id.'&'.api_get_cidreq().'">'.
127
-    Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>';
127
+    Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview'), '', ICON_SIZE_MEDIUM).'</a>';
128 128
 echo '<a href="edit_document.php?'.api_get_cidreq().'&id='.$document_id.'&'.api_get_cidreq().'&origin=editpaint">'.
129
-    Display::return_icon('edit.png', get_lang('Rename').'/'.get_lang('Comment'),'',ICON_SIZE_MEDIUM).'</a>';
129
+    Display::return_icon('edit.png', get_lang('Rename').'/'.get_lang('Comment'), '', ICON_SIZE_MEDIUM).'</a>';
130 130
 echo '</div>';
131 131
 
132 132
 ///pixlr
133
-$title=$file;//disk name. No sql name because pixlr return this when save
133
+$title = $file; //disk name. No sql name because pixlr return this when save
134 134
 $pixlr_code_translation_table = array('' => 'en', 'pt' => 'pt-Pt', 'sr' => 'sr_latn');
135
-$langpixlr  = api_get_language_isocode();
135
+$langpixlr = api_get_language_isocode();
136 136
 $langpixlr = isset($pixlr_code_translation_table[$langpixlr]) ? $pixlredit_code_translation_table[$langpixlr] : $langpixlr;
137
-$loc=$langpixlr;// deprecated ?? TODO:check pixlr read user browser
137
+$loc = $langpixlr; // deprecated ?? TODO:check pixlr read user browser
138 138
 
139
-$exit_path=api_get_path(WEB_CODE_PATH).'document/exit_pixlr.php';
140
-$_SESSION['exit_pixlr']= Security::remove_XSS($parent_id);
139
+$exit_path = api_get_path(WEB_CODE_PATH).'document/exit_pixlr.php';
140
+$_SESSION['exit_pixlr'] = Security::remove_XSS($parent_id);
141 141
 
142
-$referrer="Chamilo";
142
+$referrer = "Chamilo";
143 143
 
144
-$target_path=api_get_path(WEB_CODE_PATH).'document/save_pixlr.php';
145
-$target=$target_path;
144
+$target_path = api_get_path(WEB_CODE_PATH).'document/save_pixlr.php';
145
+$target = $target_path;
146 146
 
147
-$locktarget="true";
148
-$locktitle="false";
147
+$locktarget = "true";
148
+$locktitle = "false";
149 149
 
150
-if ($_SERVER['HTTP_HOST']=="localhost") {
151
-	$path_and_file= api_get_path(SYS_SERVER_ROOT_PATH).'/crossdomain.xml';
150
+if ($_SERVER['HTTP_HOST'] == "localhost") {
151
+	$path_and_file = api_get_path(SYS_SERVER_ROOT_PATH).'/crossdomain.xml';
152 152
 	if (!file_exists($path_and_file)) {
153
-		$crossdomain='<?xml version="1.0"?>
153
+		$crossdomain = '<?xml version="1.0"?>
154 154
 			<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
155 155
 			<cross-domain-policy>
156 156
 				<allow-access-from domain="cdn.pixlr.com" />
@@ -159,23 +159,23 @@  discard block
 block discarded – undo
159 159
 			</cross-domain-policy>';//more open domain="*"
160 160
 		@file_put_contents($path_and_file, $crossdomain);
161 161
 	}
162
-	$credentials="true";
162
+	$credentials = "true";
163 163
 }
164 164
 else {
165
-	$credentials="false";
165
+	$credentials = "false";
166 166
 }
167 167
 
168 168
 //make temp images
169
-$temp_folder=api_get_path(SYS_ARCHIVE_PATH).'temp/images';
169
+$temp_folder = api_get_path(SYS_ARCHIVE_PATH).'temp/images';
170 170
 if (!file_exists($temp_folder)) {
171
-    @mkdir($temp_folder, api_get_permissions_for_new_directories(), true);//TODO:check $permissions value, now empty;
171
+    @mkdir($temp_folder, api_get_permissions_for_new_directories(), true); //TODO:check $permissions value, now empty;
172 172
 }
173 173
 
174 174
 //make htaccess with allow from all, and file index.html into temp/images
175
-$htaccess=api_get_path(SYS_ARCHIVE_PATH).'temp/images/.htaccess';
175
+$htaccess = api_get_path(SYS_ARCHIVE_PATH).'temp/images/.htaccess';
176 176
 if (!file_exists($htaccess)) {
177 177
 
178
-	$htaccess_content="order deny,allow\r\nallow from all\r\nOptions -Indexes";
178
+	$htaccess_content = "order deny,allow\r\nallow from all\r\nOptions -Indexes";
179 179
 
180 180
 	$fp = @ fopen(api_get_path(SYS_ARCHIVE_PATH).'temp/images/.htaccess', 'w');
181 181
 	if ($fp) {
@@ -184,9 +184,9 @@  discard block
 block discarded – undo
184 184
 	}
185 185
 }
186 186
 
187
-$html_index=api_get_path(SYS_ARCHIVE_PATH).'temp/images/index.html';
187
+$html_index = api_get_path(SYS_ARCHIVE_PATH).'temp/images/index.html';
188 188
 if (!file_exists($html_index)) {
189
-	$html_index_content="<html><head></head><body></body></html>";
189
+	$html_index_content = "<html><head></head><body></body></html>";
190 190
 	$fp = @ fopen(api_get_path(SYS_ARCHIVE_PATH).'temp/images/index.html', 'w');
191 191
 	if ($fp) {
192 192
 		fwrite($fp, $html_index_content);
@@ -195,20 +195,20 @@  discard block
 block discarded – undo
195 195
 }
196 196
 
197 197
 //encript temp name file
198
-$name_crip=sha1(uniqid());//encript
199
-$findext= explode(".", $file);
200
-$extension= $findext[count($findext)-1];
201
-$file_crip=$name_crip.'.'.$extension;
198
+$name_crip = sha1(uniqid()); //encript
199
+$findext = explode(".", $file);
200
+$extension = $findext[count($findext) - 1];
201
+$file_crip = $name_crip.'.'.$extension;
202 202
 
203 203
 //copy file to temp/images directory
204
-$from=$filepath.$file;
205
-$to=api_get_path(SYS_ARCHIVE_PATH).'temp/images/'.$file_crip;
204
+$from = $filepath.$file;
205
+$to = api_get_path(SYS_ARCHIVE_PATH).'temp/images/'.$file_crip;
206 206
 copy($from, $to);
207
-$_SESSION['temp_realpath_image']=$to;
207
+$_SESSION['temp_realpath_image'] = $to;
208 208
 
209 209
 //load image to url
210
-$to_url=api_get_path(WEB_ARCHIVE_PATH).'temp/images/'.$file_crip;
211
-$image=urlencode($to_url);
210
+$to_url = api_get_path(WEB_ARCHIVE_PATH).'temp/images/'.$file_crip;
211
+$image = urlencode($to_url);
212 212
 $pixlr_url = api_get_protocol().'://pixlr.com/editor/?title='.$title.'&image='.$image.'&loc='.$loc.'&referrer='.$referrer.'&target='.$target.'&exit='.$exit_path.'&locktarget='.$locktarget.'&locktitle='.$locktitle.'&credentials='.$credentials;
213 213
 
214 214
 //make frame an send image
Please login to merge, or discard this patch.
main/forum/newthread.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -54,12 +54,12 @@  discard block
 block discarded – undo
54 54
 
55 55
 /* Breadcrumbs */
56 56
 
57
-if (isset($_SESSION['gradebook'])){
57
+if (isset($_SESSION['gradebook'])) {
58 58
     $gradebook = Security::remove_XSS($_SESSION['gradebook']);
59 59
 }
60 60
 
61 61
 if (!empty($gradebook) && $gradebook == 'view') {
62
-    $interbreadcrumb[] = array (
62
+    $interbreadcrumb[] = array(
63 63
         'url' => '../gradebook/'.Security::remove_XSS($_SESSION['gradebook_dest']),
64 64
         'name' => get_lang('ToolGradebook')
65 65
     );
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group.php?'.$cidreq, 'name' => get_lang('Groups'));
118 118
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.$cidreq, 'name' => get_lang('GroupSpace').' '.$groupProperties['name']);
119 119
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?'.$cidreq.'&forum='.intval($_GET['forum']), 'name' => $current_forum['forum_title']);
120
-    $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/newthread.php?'.$cidreq.'&forum='.intval($_GET['forum']),'name' => get_lang('NewTopic'));
120
+    $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/newthread.php?'.$cidreq.'&forum='.intval($_GET['forum']), 'name' => get_lang('NewTopic'));
121 121
 } else {
122 122
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/index.php?'.$cidreq, 'name' => $nameTools);
123 123
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/viewforumcategory.php?'.$cidreq.'&forumcategory='.$current_forum_category['cat_id'], 'name' => $current_forum_category['cat_title']);
@@ -127,9 +127,9 @@  discard block
 block discarded – undo
127 127
 
128 128
 /* Resource Linker */
129 129
 if (isset($_POST['add_resources']) AND $_POST['add_resources'] == get_lang('Resources')) {
130
-    $_SESSION['formelements']	= $_POST;
131
-    $_SESSION['origin']			= $_SERVER['REQUEST_URI'];
132
-    $_SESSION['breadcrumbs']	= $interbreadcrumb;
130
+    $_SESSION['formelements'] = $_POST;
131
+    $_SESSION['origin'] = $_SERVER['REQUEST_URI'];
132
+    $_SESSION['breadcrumbs'] = $interbreadcrumb;
133 133
     header('Location: ../resourcelinker/resourcelinker.php');
134 134
     exit;
135 135
 }
Please login to merge, or discard this patch.
main/forum/editthread.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 }
46 46
 
47 47
 if (!empty($gradebook) && $gradebook == 'view') {
48
-    $interbreadcrumb[] = array (
48
+    $interbreadcrumb[] = array(
49 49
         'url' => '../gradebook/'.Security::remove_XSS($_SESSION['gradebook_dest']),
50 50
         'name' => get_lang('ToolGradebook')
51 51
     );
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group.php?'.$cidreq, 'name' => get_lang('Groups'));
108 108
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.$cidreq, 'name' => get_lang('GroupSpace').' '.$groupProperties['name']);
109 109
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?'.$cidreq.'&forum='.intval($_GET['forum']), 'name' => $currentForum['forum_title']);
110
-    $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/newthread.php?'.$cidreq.'&forum='.intval($_GET['forum']),'name' => get_lang('EditThread'));
110
+    $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/newthread.php?'.$cidreq.'&forum='.intval($_GET['forum']), 'name' => get_lang('EditThread'));
111 111
 } else {
112 112
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/index.php?'.$cidreq, 'name' => $nameTools);
113 113
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/viewforumcategory.php?'.$cidreq.'&forumcategory='.$currentForumCategory['cat_id'], 'name' => $currentForumCategory['cat_title']);
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 echo '<div class="actions">';
157 157
 echo '<span style="float:right;">'.search_link().'</span>';
158 158
 echo '<a href="viewforum.php?forum='.intval($_GET['forum']).'&'.$cidreq.'">'.
159
-    Display::return_icon('back.png',get_lang('BackToForum'),'',ICON_SIZE_MEDIUM).'</a>';
159
+    Display::return_icon('back.png', get_lang('BackToForum'), '', ICON_SIZE_MEDIUM).'</a>';
160 160
 echo '</div>';
161 161
 
162 162
 $threadData = getThreadInfo($threadId, $cId);
Please login to merge, or discard this patch.
main/forum/viewthread.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
  */
8 8
 
9 9
 require_once '../inc/global.inc.php';
10
-$current_course_tool  = TOOL_FORUM;
10
+$current_course_tool = TOOL_FORUM;
11 11
 
12 12
 $this_section = SECTION_COURSES;
13 13
 
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 // Are we in a lp ?
24 24
 $origin = '';
25 25
 if (isset($_GET['origin'])) {
26
-    $origin =  Security::remove_XSS($_GET['origin']);
26
+    $origin = Security::remove_XSS($_GET['origin']);
27 27
 }
28 28
 $my_search = null;
29 29
 $gradebook = null;
@@ -36,10 +36,10 @@  discard block
 block discarded – undo
36 36
 // Note pcool: I tried to use only one sql statement (and function) for this,
37 37
 // but the problem is that the visibility of the forum AND forum category are stored in the item_property table.
38 38
 // Note: This has to be validated that it is an existing thread
39
-$current_thread	= get_thread_information($_GET['thread']);
39
+$current_thread = get_thread_information($_GET['thread']);
40 40
 // Note: This has to be validated that it is an existing forum.
41
-$current_forum	= get_forum_information($current_thread['forum_id']);
42
-$current_forum_category	= get_forumcategory_information($current_forum['forum_category']);
41
+$current_forum = get_forum_information($current_thread['forum_id']);
42
+$current_forum_category = get_forumcategory_information($current_forum['forum_category']);
43 43
 $whatsnew_post_info = isset($_SESSION['whatsnew_post_info']) ? $_SESSION['whatsnew_post_info'] : null;
44 44
 /* Header and Breadcrumbs */
45 45
 
@@ -49,8 +49,8 @@  discard block
 block discarded – undo
49 49
 }
50 50
 
51 51
 if (!empty($gradebook) && $gradebook == 'view') {
52
-    $interbreadcrumb[] = array (
53
-        'url' => '../gradebook/' . $_SESSION['gradebook_dest'],
52
+    $interbreadcrumb[] = array(
53
+        'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
54 54
         'name' => get_lang('ToolGradebook')
55 55
     );
56 56
 }
@@ -65,15 +65,15 @@  discard block
 block discarded – undo
65 65
         'name' => get_lang('Groups')
66 66
     );
67 67
     $interbreadcrumb[] = array(
68
-        'url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?' . api_get_cidreq(),
69
-        'name' => get_lang('GroupSpace') . ' ' . $group_properties['name']
68
+        'url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.api_get_cidreq(),
69
+        'name' => get_lang('GroupSpace').' '.$group_properties['name']
70 70
     );
71 71
     $interbreadcrumb[] = array(
72
-        'url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?forum='.intval($_GET['forum']).'&'.api_get_cidreq(). "&origin=$origin&search=" . Security::remove_XSS(urlencode($my_search)),
72
+        'url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?forum='.intval($_GET['forum']).'&'.api_get_cidreq()."&origin=$origin&search=".Security::remove_XSS(urlencode($my_search)),
73 73
         'name' => Security::remove_XSS($current_forum['forum_title'])
74 74
     );
75 75
     $interbreadcrumb[] = array(
76
-        'url' => 'viewthread.php?forum=' . intval($_GET['forum']) . '&' . api_get_cidreq(). '&thread=' . intval($_GET['thread']),
76
+        'url' => 'viewthread.php?forum='.intval($_GET['forum']).'&'.api_get_cidreq().'&thread='.intval($_GET['thread']),
77 77
         'name' => Security::remove_XSS($current_thread['thread_title'])
78 78
     );
79 79
 
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
         $interbreadcrumb[] = array(
87 87
             'url' => api_get_path(WEB_CODE_PATH).'forum/index.php?'
88 88
                 . (isset($gradebook) ? "gradebook=$gradebook&" : '')
89
-                . 'search=' . Security::remove_XSS(urlencode($my_search)),
89
+                . 'search='.Security::remove_XSS(urlencode($my_search)),
90 90
             'name' => $nameTools
91 91
         );
92 92
         $interbreadcrumb[] = array(
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
             'name' => Security::remove_XSS($current_forum_category['cat_title'])
98 98
         );
99 99
         $interbreadcrumb[] = array(
100
-            'url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?forum=' . intval($_GET['forum'])
100
+            'url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?forum='.intval($_GET['forum'])
101 101
                 . "&origin=$origin&search="
102 102
                 . Security::remove_XSS(urlencode($my_search)),
103 103
             'name' => Security::remove_XSS($current_forum['forum_title'])
@@ -168,9 +168,9 @@  discard block
 block discarded – undo
168 168
     echo '<div class="actions">';
169 169
     echo '<span style="float:right;">'.search_link().'</span>';
170 170
     if ($origin != 'learnpath') {
171
-        echo '<a href="' . $forumUrl . 'viewforum.php?forum='
172
-            . intval($_GET['forum']) . '&' . api_get_cidreq() . '">'
173
-            . Display::return_icon('back.png', get_lang('BackToForum'), '', ICON_SIZE_MEDIUM) . '</a>';
171
+        echo '<a href="'.$forumUrl.'viewforum.php?forum='
172
+            . intval($_GET['forum']).'&'.api_get_cidreq().'">'
173
+            . Display::return_icon('back.png', get_lang('BackToForum'), '', ICON_SIZE_MEDIUM).'</a>';
174 174
     }
175 175
     // The reply to thread link should only appear when the forum_category is
176 176
     // not locked AND the forum is not locked AND the thread is not locked.
@@ -186,9 +186,9 @@  discard block
 block discarded – undo
186 186
         if ($_user['user_id'] || ($current_forum['allow_anonymous'] == 1 && !$_user['user_id'])) {
187 187
             // reply link
188 188
             if (!api_is_anonymous() && api_is_allowed_to_session_edit(false, true)) {
189
-                echo '<a href="' . $forumUrl . 'reply.php?' . api_get_cidreq() . '&forum='
190
-                    . intval($_GET['forum']) . '&thread='
191
-                    . intval($_GET['thread']) . '&action=replythread">'
189
+                echo '<a href="'.$forumUrl.'reply.php?'.api_get_cidreq().'&forum='
190
+                    . intval($_GET['forum']).'&thread='
191
+                    . intval($_GET['thread']).'&action=replythread">'
192 192
                     . Display::return_icon('reply_thread.png', get_lang('ReplyToThread'), '', ICON_SIZE_MEDIUM)
193 193
                     . '</a>';
194 194
             }
@@ -212,13 +212,13 @@  discard block
 block discarded – undo
212 212
 
213 213
     // The different views of the thread.
214 214
     if ($origin != 'learnpath') {
215
-        $my_url = '<a href="' . $forumUrl . 'viewthread.php?' . api_get_cidreq() . '&' . api_get_cidreq()
216
-            . '&forum=' . intval($_GET['forum']) . '&thread=' . intval($_GET['thread'])
217
-            . '&search=' . Security::remove_XSS(urlencode($my_search));
218
-        echo $my_url . '&view=flat">'
215
+        $my_url = '<a href="'.$forumUrl.'viewthread.php?'.api_get_cidreq().'&'.api_get_cidreq()
216
+            . '&forum='.intval($_GET['forum']).'&thread='.intval($_GET['thread'])
217
+            . '&search='.Security::remove_XSS(urlencode($my_search));
218
+        echo $my_url.'&view=flat">'
219 219
             . Display::return_icon('forum_listview.png', get_lang('FlatView'), null, ICON_SIZE_MEDIUM)
220 220
             . '</a>';
221
-        echo $my_url . '&view=nested">'
221
+        echo $my_url.'&view=nested">'
222 222
             . Display::return_icon('forum_nestedview.png', get_lang('NestedView'), null, ICON_SIZE_MEDIUM)
223 223
             . '</a>';
224 224
     }
Please login to merge, or discard this patch.
main/forum/forumsearch.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 // Are we in a lp ?
41 41
 $origin = '';
42 42
 if (isset($_GET['origin'])) {
43
-    $origin =  Security::remove_XSS($_GET['origin']);
43
+    $origin = Security::remove_XSS($_GET['origin']);
44 44
 }
45 45
 
46 46
 // Name of the tool
@@ -48,12 +48,12 @@  discard block
 block discarded – undo
48 48
 
49 49
 // Breadcrumbs
50 50
 
51
-if (isset($_SESSION['gradebook'])){
51
+if (isset($_SESSION['gradebook'])) {
52 52
     $gradebook = $_SESSION['gradebook'];
53 53
 }
54 54
 
55 55
 if (!empty($gradebook) && $gradebook == 'view') {
56
-    $interbreadcrumb[] = array (
56
+    $interbreadcrumb[] = array(
57 57
         'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
58 58
         'name' => get_lang('ToolGradebook')
59 59
     );
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group.php?'.api_get_cidreq(), 'name' => get_lang('Groups'));
67 67
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.api_get_cidreq(), 'name' => get_lang('GroupSpace').' ('.$group_properties['name'].')');
68 68
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?origin='.$origin.'&forum='.intval($_GET['forum']).'&'.api_get_cidreq(), 'name' => prepare4display($current_forum['forum_title']));
69
-    $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/forumsearch.php?'.api_get_cidreq(),'name' => get_lang('ForumSearch'));
69
+    $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/forumsearch.php?'.api_get_cidreq(), 'name' => get_lang('ForumSearch'));
70 70
 } else {
71 71
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/index.php?'.api_get_cidreq(), 'name' => $nameTools);
72 72
     $nameTools = get_lang('ForumSearch');
Please login to merge, or discard this patch.
main/group/group_space.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 require_once '../inc/global.inc.php';
13
-$current_course_tool  = TOOL_GROUP;
13
+$current_course_tool = TOOL_GROUP;
14 14
 
15 15
 // Notice for unauthorized people.
16 16
 api_protect_course_script(true);
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 
70 70
 echo '<div class="actions">';
71 71
 echo '<a href="group.php">'.
72
-    Display::return_icon('back.png',get_lang('BackToGroupList'),'',ICON_SIZE_MEDIUM).
72
+    Display::return_icon('back.png', get_lang('BackToGroupList'), '', ICON_SIZE_MEDIUM).
73 73
     '</a>';
74 74
 
75 75
 /*
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
  */
87 87
 $unsubscribe_group = '';
88 88
 if (GroupManager :: is_self_unregistration_allowed($user_id, $current_group['id'])) {
89
-    $unsubscribe_group = '<a class="btn btn-default" href="'.api_get_self().'?selfUnReg=1" onclick="javascript: if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES))."'".')) return false;">'.
89
+    $unsubscribe_group = '<a class="btn btn-default" href="'.api_get_self().'?selfUnReg=1" onclick="javascript: if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES))."'".')) return false;">'.
90 90
         get_lang("StudentUnsubscribe").'</a>';
91 91
 }
92 92
 echo '&nbsp;</div>';
@@ -98,8 +98,8 @@  discard block
 block discarded – undo
98 98
     GroupManager::is_tutor_of_group(api_get_user_id(), api_get_group_id())
99 99
 ) {
100 100
     $my_origin = isset($origin) ? $origin : '';
101
-    $edit_url =  '<a href="'.api_get_path(WEB_CODE_PATH).'group/settings.php?'.api_get_cidreq().'&origin='.$my_origin.'">'.
102
-        Display::return_icon('edit.png', get_lang('EditGroup'),'',ICON_SIZE_SMALL).'</a>';
101
+    $edit_url = '<a href="'.api_get_path(WEB_CODE_PATH).'group/settings.php?'.api_get_cidreq().'&origin='.$my_origin.'">'.
102
+        Display::return_icon('edit.png', get_lang('EditGroup'), '', ICON_SIZE_SMALL).'</a>';
103 103
 }
104 104
 
105 105
 echo Display::page_header(
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
     $forums_of_groups = get_forums_of_group($current_group['id']);
217 217
 
218 218
     if (is_array($forums_of_groups)) {
219
-        if ( $current_group['forum_state'] == GroupManager::TOOL_PUBLIC) {
219
+        if ($current_group['forum_state'] == GroupManager::TOOL_PUBLIC) {
220 220
             foreach ($forums_of_groups as $key => $value) {
221 221
                 if ($value['forum_group_public_private'] == 'public') {
222 222
                     $actions_array[] = array(
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
 if (count($tutors) == 0) {
299 299
     $tutor_info = get_lang('GroupNoneMasc');
300 300
 } else {
301
-    isset($origin) ? $my_origin = $origin:$my_origin='';
301
+    isset($origin) ? $my_origin = $origin : $my_origin = '';
302 302
     $tutor_info .= '<ul class="thumbnails">';
303 303
     foreach ($tutors as $index => $tutor) {
304 304
         $userInfo = api_get_user_info($tutor['user_id']);
@@ -404,8 +404,8 @@  discard block
 block discarded – undo
404 404
     global $current_group;
405 405
 
406 406
     // Database table definition
407
-    $table_group_user 	= Database :: get_course_table(TABLE_GROUP_USER);
408
-    $table_user 		= Database :: get_main_table(TABLE_MAIN_USER);
407
+    $table_group_user = Database :: get_course_table(TABLE_GROUP_USER);
408
+    $table_user = Database :: get_main_table(TABLE_MAIN_USER);
409 409
 
410 410
     $course_id = api_get_course_int_id();
411 411
 
Please login to merge, or discard this patch.
main/inc/lib/groupmanager.lib.php 1 patch
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -221,8 +221,8 @@  discard block
 block discarded – undo
221 221
             $sql = "UPDATE $table_group SET id = iid WHERE iid = $lastId";
222 222
             Database::query($sql);
223 223
 
224
-            $desired_dir_name= '/'.api_replace_dangerous_char($name).'_groupdocs';
225
-            $my_path = api_get_path(SYS_COURSE_PATH) . $currentCourseRepository . '/document';
224
+            $desired_dir_name = '/'.api_replace_dangerous_char($name).'_groupdocs';
225
+            $my_path = api_get_path(SYS_COURSE_PATH).$currentCourseRepository.'/document';
226 226
 
227 227
             $newFolderData = create_unexisting_directory(
228 228
                 $_course,
@@ -285,11 +285,11 @@  discard block
 block discarded – undo
285 285
                 $values['default_view_type_group']['default_view_type'] = api_get_setting('default_forum_view');
286 286
                 $values['group_forum'] = $lastId;
287 287
                 if ($forumState == '1') {
288
-                    $values['public_private_group_forum_group']['public_private_group_forum']='public';
288
+                    $values['public_private_group_forum_group']['public_private_group_forum'] = 'public';
289 289
                 } elseif ($forumState == '2') {
290
-                    $values['public_private_group_forum_group']['public_private_group_forum']='private';
290
+                    $values['public_private_group_forum_group']['public_private_group_forum'] = 'private';
291 291
                 } elseif ($forumState == '0') {
292
-                    $values['public_private_group_forum_group']['public_private_group_forum']='unavailable';
292
+                    $values['public_private_group_forum_group']['public_private_group_forum'] = 'unavailable';
293 293
                 }
294 294
                 store_forum($values);
295 295
             }
@@ -320,9 +320,9 @@  discard block
 block discarded – undo
320 320
             1
321 321
         );
322 322
         $users = self::get_users($group_id);
323
-        $group_ids = array ();
323
+        $group_ids = array();
324 324
 
325
-        for ($group_nr = 1; $group_nr <= $number_of_groups; $group_nr ++) {
325
+        for ($group_nr = 1; $group_nr <= $number_of_groups; $group_nr++) {
326 326
             $group_ids[] = self::create_group(
327 327
                 get_lang('Subgroup').' '.$group_nr,
328 328
                 $category_id,
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
                 0,
367 367
                 count($users_ids)
368 368
             );
369
-            self::subscribe_users($users_ids,$group_id);
369
+            self::subscribe_users($users_ids, $group_id);
370 370
             $group_ids[] = $group_id;
371 371
         }
372 372
         return $group_ids;
@@ -391,14 +391,14 @@  discard block
 block discarded – undo
391 391
         $group_table = Database:: get_course_table(TABLE_GROUP);
392 392
         $forum_table = Database:: get_course_table(TABLE_FORUM);
393 393
 
394
-        $group_ids = is_array($group_ids) ? $group_ids : array ($group_ids);
395
-        $group_ids = array_map('intval',$group_ids);
394
+        $group_ids = is_array($group_ids) ? $group_ids : array($group_ids);
395
+        $group_ids = array_map('intval', $group_ids);
396 396
 
397 397
         if (api_is_course_coach()) {
398 398
             //a coach can only delete courses from his session
399
-            for ($i=0 ; $i<count($group_ids) ; $i++) {
400
-                if (!api_is_element_in_the_session(TOOL_GROUP,$group_ids[$i])) {
401
-                    array_splice($group_ids,$i,1);
399
+            for ($i = 0; $i < count($group_ids); $i++) {
400
+                if (!api_is_element_in_the_session(TOOL_GROUP, $group_ids[$i])) {
401
+                    array_splice($group_ids, $i, 1);
402 402
                     $i--;
403 403
                 }
404 404
             }
@@ -633,7 +633,7 @@  discard block
 block discarded – undo
633 633
         } elseif ($forum_state === 0) {
634 634
             $sql2 .= " forum_group_public_private='unavailable' ";
635 635
         }
636
-        $sql2 .=" WHERE c_id = $course_id AND forum_of_group=".$group_id;
636
+        $sql2 .= " WHERE c_id = $course_id AND forum_of_group=".$group_id;
637 637
         Database::query($sql2);
638 638
         return $result;
639 639
     }
@@ -662,13 +662,13 @@  discard block
 block discarded – undo
662 662
     public static function get_categories($course_code = null)
663 663
     {
664 664
         $course_info = api_get_course_info($course_code);
665
-        $course_id     = $course_info['real_id'];
665
+        $course_id = $course_info['real_id'];
666 666
         $table_group_cat = Database :: get_course_table(TABLE_GROUP_CATEGORY);
667 667
         $sql = "SELECT * FROM $table_group_cat
668 668
                 WHERE c_id = $course_id
669 669
                 ORDER BY display_order";
670 670
         $res = Database::query($sql);
671
-        $cats = array ();
671
+        $cats = array();
672 672
         while ($cat = Database::fetch_array($res)) {
673 673
             $cats[] = $cat;
674 674
         }
@@ -779,7 +779,7 @@  discard block
 block discarded – undo
779 779
                 WHERE c_id = $course_id AND category_id='".$cat_id."'";
780 780
         $res = Database::query($sql);
781 781
         if (Database::num_rows($res) > 0) {
782
-            $groups_to_delete = array ();
782
+            $groups_to_delete = array();
783 783
             while ($group = Database::fetch_object($res)) {
784 784
                 $groups_to_delete[] = $group->id;
785 785
             }
@@ -947,7 +947,7 @@  discard block
 block discarded – undo
947 947
      */
948 948
     public static function get_current_max_groups_per_user($category_id = null, $course_code = null)
949 949
     {
950
-        $course_info = api_get_course_info ($course_code);
950
+        $course_info = api_get_course_info($course_code);
951 951
         $group_table = Database :: get_course_table(TABLE_GROUP);
952 952
         $group_user_table = Database :: get_course_table(TABLE_GROUP_USER);
953 953
         $sql = 'SELECT COUNT(gu.group_id) AS current_max
@@ -1186,17 +1186,17 @@  discard block
 block discarded – undo
1186 1186
     {
1187 1187
         $_course = api_get_course_info();
1188 1188
 
1189
-        $group_ids = is_array($group_ids) ? $group_ids : array ($group_ids);
1189
+        $group_ids = is_array($group_ids) ? $group_ids : array($group_ids);
1190 1190
         $group_ids = array_map('intval', $group_ids);
1191 1191
 
1192 1192
         if (api_is_course_coach()) {
1193
-            for ($i=0 ; $i< count($group_ids) ; $i++) {
1194
-                if (!api_is_element_in_the_session(TOOL_GROUP, $group_ids[$i])){
1195
-                    array_splice($group_ids,$i,1);
1193
+            for ($i = 0; $i < count($group_ids); $i++) {
1194
+                if (!api_is_element_in_the_session(TOOL_GROUP, $group_ids[$i])) {
1195
+                    array_splice($group_ids, $i, 1);
1196 1196
                     $i--;
1197 1197
                 }
1198 1198
             }
1199
-            if (count($group_ids)==0) {
1199
+            if (count($group_ids) == 0) {
1200 1200
                 return false;
1201 1201
             }
1202 1202
         }
@@ -1235,9 +1235,9 @@  discard block
 block discarded – undo
1235 1235
          * Retrieve course users (reverse) ordered by the number
1236 1236
          * of group they are already enrolled
1237 1237
          */
1238
-        for ($i = 0; $i < count($complete_user_list); $i ++) {
1238
+        for ($i = 0; $i < count($complete_user_list); $i++) {
1239 1239
             //find # of groups the user is enrolled in
1240
-            $number_of_groups = self :: user_in_number_of_groups($complete_user_list[$i]["user_id"], (isset($category['id'])?$category['id']:null));
1240
+            $number_of_groups = self :: user_in_number_of_groups($complete_user_list[$i]["user_id"], (isset($category['id']) ? $category['id'] : null));
1241 1241
             //add # of groups to user list
1242 1242
             $complete_user_list[$i]['number_groups_left'] = $number_groups_per_user - $number_of_groups;
1243 1243
         }
@@ -1249,7 +1249,7 @@  discard block
 block discarded – undo
1249 1249
 
1250 1250
         //now sort by # of group left
1251 1251
         $complete_user_list = TableSort :: sort_table($complete_user_list, 'number_groups_left', SORT_DESC);
1252
-        $userToken = array ();
1252
+        $userToken = array();
1253 1253
         foreach ($complete_user_list as $this_user) {
1254 1254
             if ($this_user['number_groups_left'] > 0) {
1255 1255
                 $userToken[$this_user['user_id']] = $this_user['number_groups_left'];
@@ -1444,7 +1444,7 @@  discard block
 block discarded – undo
1444 1444
                 if ($category['groups_per_user'] == self::GROUP_PER_MEMBER_NO_LIMIT) {
1445 1445
                     $category['groups_per_user'] = self::INFINITE;
1446 1446
                 }
1447
-                $result = self:: user_in_number_of_groups($user_id, $category['id'] ) < $category['groups_per_user'];
1447
+                $result = self:: user_in_number_of_groups($user_id, $category['id']) < $category['groups_per_user'];
1448 1448
                 if ($result == false) {
1449 1449
                     return false;
1450 1450
                 }
@@ -1555,7 +1555,7 @@  discard block
 block discarded – undo
1555 1555
                     tg.group_id='".$group_id."' AND
1556 1556
                     tg.user_id=u.user_id".$order_clause;
1557 1557
         $db_result = Database::query($sql);
1558
-        $users = array ();
1558
+        $users = array();
1559 1559
         while ($user = Database::fetch_object($db_result)) {
1560 1560
             if (!$id_only) {
1561 1561
                 $member['user_id'] = $user->user_id;
@@ -1620,8 +1620,8 @@  discard block
 block discarded – undo
1620 1620
         foreach ($user_ids as $user_id) {
1621 1621
             $user_id = intval($user_id);
1622 1622
             if (self::can_user_subscribe($user_id, $group_id, false)) {
1623
-                $sql = "INSERT INTO " . $table_group_tutor . " (c_id, user_id, group_id)
1624
-                        VALUES ('$course_id', '" . $user_id . "', '" . $group_id . "')";
1623
+                $sql = "INSERT INTO ".$table_group_tutor." (c_id, user_id, group_id)
1624
+                        VALUES ('$course_id', '".$user_id."', '".$group_id."')";
1625 1625
                 $result &= Database::query($sql);
1626 1626
             }
1627 1627
         }
@@ -1637,7 +1637,7 @@  discard block
 block discarded – undo
1637 1637
      */
1638 1638
     public static function unsubscribe_users($user_ids, $group_id)
1639 1639
     {
1640
-        $user_ids = is_array($user_ids) ? $user_ids : array ($user_ids);
1640
+        $user_ids = is_array($user_ids) ? $user_ids : array($user_ids);
1641 1641
         $table_group_user = Database :: get_course_table(TABLE_GROUP_USER);
1642 1642
         $group_id = intval($group_id);
1643 1643
         $course_id = api_get_course_int_id();
@@ -2183,7 +2183,7 @@  discard block
 block discarded – undo
2183 2183
          * Retrieve course users (reverse) ordered by the number
2184 2184
          * of group they are already enrolled
2185 2185
          */
2186
-        for ($i = 0; $i < count($complete_user_list); $i ++) {
2186
+        for ($i = 0; $i < count($complete_user_list); $i++) {
2187 2187
             // find # of groups the user is enrolled in
2188 2188
             $number_of_groups = self:: user_in_number_of_groups(
2189 2189
                 $complete_user_list[$i]["user_id"],
@@ -2315,14 +2315,14 @@  discard block
 block discarded – undo
2315 2315
                 !(api_is_course_coach() && intval($this_group['session_id']) != $session_id)
2316 2316
             ) {
2317 2317
                 $edit_actions = '<a href="'.$url.'settings.php?'.api_get_cidreq(true, false).'&gidReq='.$this_group['id'].'"  title="'.get_lang('Edit').'">'.
2318
-                    Display::return_icon('edit.png', get_lang('EditGroup'),'',ICON_SIZE_SMALL).'</a>&nbsp;';
2318
+                    Display::return_icon('edit.png', get_lang('EditGroup'), '', ICON_SIZE_SMALL).'</a>&nbsp;';
2319 2319
 
2320 2320
                 if ($this_group['status'] == 1) {
2321
-                    $edit_actions .= '<a href="' . api_get_self() . '?' . api_get_cidreq(true,false) . '&category=' . $category_id . '&action=set_invisible&id=' . $this_group['id'] . '" title="' . get_lang('Hide') . '">' .
2322
-                        Display::return_icon('visible.png', get_lang('Hide'), '', ICON_SIZE_SMALL) . '</a>&nbsp;';
2321
+                    $edit_actions .= '<a href="'.api_get_self().'?'.api_get_cidreq(true, false).'&category='.$category_id.'&action=set_invisible&id='.$this_group['id'].'" title="'.get_lang('Hide').'">'.
2322
+                        Display::return_icon('visible.png', get_lang('Hide'), '', ICON_SIZE_SMALL).'</a>&nbsp;';
2323 2323
                 } else {
2324
-                    $edit_actions .= '<a href="' . api_get_self() . '?' . api_get_cidreq(true, false) . '&category=' . $category_id . '&action=set_visible&id=' . $this_group['id'] . '" title="' . get_lang('Show') . '">' .
2325
-                        Display::return_icon('invisible.png', get_lang('Show'), '', ICON_SIZE_SMALL) . '</a>&nbsp;';
2324
+                    $edit_actions .= '<a href="'.api_get_self().'?'.api_get_cidreq(true, false).'&category='.$category_id.'&action=set_visible&id='.$this_group['id'].'" title="'.get_lang('Show').'">'.
2325
+                        Display::return_icon('invisible.png', get_lang('Show'), '', ICON_SIZE_SMALL).'</a>&nbsp;';
2326 2326
                 }
2327 2327
 
2328 2328
                 $edit_actions .= '<a href="'.$url.'member_settings.php?'.api_get_cidreq(true, false).'&gidReq='.$this_group['id'].'"  title="'.get_lang('GroupMembers').'">'.
@@ -2335,10 +2335,10 @@  discard block
 block discarded – undo
2335 2335
                     Display::return_icon('clean.png',get_lang('EmptyGroup'),'',ICON_SIZE_SMALL).'</a>&nbsp;';*/
2336 2336
 
2337 2337
                 $edit_actions .= '<a href="'.api_get_self().'?'.api_get_cidreq(true, false).'&category='.$category_id.'&action=fill_one&id='.$this_group['id'].'" onclick="javascript: if(!confirm('."'".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES))."'".')) return false;" title="'.get_lang('FillGroup').'">'.
2338
-                    Display::return_icon('fill.png',get_lang('FillGroup'),'',ICON_SIZE_SMALL).'</a>&nbsp;';
2338
+                    Display::return_icon('fill.png', get_lang('FillGroup'), '', ICON_SIZE_SMALL).'</a>&nbsp;';
2339 2339
 
2340 2340
                 $edit_actions .= '<a href="'.api_get_self().'?'.api_get_cidreq(true, false).'&category='.$category_id.'&action=delete_one&id='.$this_group['id'].'" onclick="javascript: if(!confirm('."'".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES))."'".')) return false;" title="'.get_lang('Delete').'">'.
2341
-                    Display::return_icon('delete.png', get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>&nbsp;';
2341
+                    Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>&nbsp;';
2342 2342
 
2343 2343
                 $row[] = $edit_actions;
2344 2344
             }
@@ -2710,7 +2710,7 @@  discard block
 block discarded – undo
2710 2710
         $activeTutor = null;
2711 2711
         $activeMember = null;
2712 2712
 
2713
-        switch($default) {
2713
+        switch ($default) {
2714 2714
             case 'settings':
2715 2715
                 $activeSettings = 'active';
2716 2716
                 break;
Please login to merge, or discard this patch.