Completed
Push — 1.10.x ( f2aaaf...ef00db )
by Yannick
241:15 queued 197:35
created
main/inc/global_error_message.inc.php 1 patch
Indentation   +89 added lines, -89 removed lines patch added patch discarded remove patch
@@ -56,40 +56,40 @@  discard block
 block discarded – undo
56 56
         $theme = 'chamilo';
57 57
     }
58 58
 
59
-	$css_path = 'app/Resources/public/css/';
60
-	$css_web_assets = 'web/assets/';
61
-	$css_web_path = 'web/css/';
59
+    $css_path = 'app/Resources/public/css/';
60
+    $css_web_assets = 'web/assets/';
61
+    $css_web_path = 'web/css/';
62 62
     $themePath = $css_path.'themes/'.$theme.'/default.css';
63 63
     $css_web_fontawesome = $css_web_assets.'fontawesome/css/font-awesome.css';
64
-	$bootstrap_file = $css_web_assets.'bootstrap/dist/css/bootstrap.min.css';
65
-	$css_base_file = $css_web_path.'base.css';
64
+    $bootstrap_file = $css_web_assets.'bootstrap/dist/css/bootstrap.min.css';
65
+    $css_base_file = $css_web_path.'base.css';
66 66
 
67 67
     $css_list = array($bootstrap_file, $css_base_file, $themePath);
68 68
 
69 69
     $web_img = 'main/img';
70
-	$root_sys = str_replace('\\', '/', realpath(dirname(__FILE__).'/../../')).'/';
71
-	$root_rel = htmlentities($_SERVER['PHP_SELF']);
72
-	if (!empty($root_rel)) {
73
-		$pos = strrpos($root_rel, '/');
74
-		$root_rel = substr($root_rel, 0, $pos - strlen($root_rel) + 1);
75
-		if (strpos($root_rel, '/main/') !== false) {
76
-			$pos = 0;
77
-			while (($test_pos = strpos(substr($root_rel, $pos, strlen($root_rel)), '/main/')) !== false) {
78
-				$pos = $test_pos + 1;
79
-			}
80
-			$root_rel = substr($root_rel, 0, $pos);
81
-		} elseif (strpos($root_rel, '/courses/') !== false) {
82
-			$pos = 0;
83
-			while (($test_pos = strpos(substr($root_rel, $pos, strlen($root_rel)), '/courses/')) !== false) {
84
-				$pos = $test_pos + 1;
85
-			}
86
-			$root_rel = substr($root_rel, 0, $pos);
87
-		}
88
-	}
89
-
90
-	$installation_guide_url = $root_rel.'documentation/installation_guide.html';
91
-
92
-	$css_def = '';
70
+    $root_sys = str_replace('\\', '/', realpath(dirname(__FILE__).'/../../')).'/';
71
+    $root_rel = htmlentities($_SERVER['PHP_SELF']);
72
+    if (!empty($root_rel)) {
73
+        $pos = strrpos($root_rel, '/');
74
+        $root_rel = substr($root_rel, 0, $pos - strlen($root_rel) + 1);
75
+        if (strpos($root_rel, '/main/') !== false) {
76
+            $pos = 0;
77
+            while (($test_pos = strpos(substr($root_rel, $pos, strlen($root_rel)), '/main/')) !== false) {
78
+                $pos = $test_pos + 1;
79
+            }
80
+            $root_rel = substr($root_rel, 0, $pos);
81
+        } elseif (strpos($root_rel, '/courses/') !== false) {
82
+            $pos = 0;
83
+            while (($test_pos = strpos(substr($root_rel, $pos, strlen($root_rel)), '/courses/')) !== false) {
84
+                $pos = $test_pos + 1;
85
+            }
86
+            $root_rel = substr($root_rel, 0, $pos);
87
+        }
88
+    }
89
+
90
+    $installation_guide_url = $root_rel.'documentation/installation_guide.html';
91
+
92
+    $css_def = '';
93 93
     foreach ($css_list as $css_item) {
94 94
         $css_base_chamilo_file = $root_sys.$css_item;
95 95
         if (file_exists($css_base_chamilo_file)) {
@@ -97,33 +97,33 @@  discard block
 block discarded – undo
97 97
         }
98 98
     }
99 99
 
100
-	$global_error_message = array();
101
-
102
-	switch ($global_error_code) {
103
-		case 1:
104
-			$global_error_message['section'] = $SectionSystemRequirementsProblem;
105
-			$global_error_message['title'] = $IncorrectPhpVersionTitle;
106
-			$php_version = function_exists('phpversion') ? phpversion() : (defined('PHP_VERSION') ? PHP_VERSION : '');
107
-			$php_version = empty($php_version) ? '' : '(PHP '.$php_version.')';
108
-			$IncorrectPhpVersionDescription = str_replace('%s1', $php_version, $IncorrectPhpVersionDescription);
109
-			$IncorrectPhpVersionDescription = str_replace('%s2', REQUIRED_PHP_VERSION, $IncorrectPhpVersionDescription);
110
-			$pos = strpos($IncorrectPhpVersionDescription, '%s3');
111
-			if ($pos !== false) {
112
-				$length = strlen($IncorrectPhpVersionDescription);
113
-				$read_installation_guide = substr($IncorrectPhpVersionDescription, $pos + 3, $length);
114
-				$IncorrectPhpVersionDescription = substr($IncorrectPhpVersionDescription, 0, $pos);
115
-				$IncorrectPhpVersionDescription .= '<br /><a class="btn btn-default" href="'.$installation_guide_url.'" target="_blank">'.$read_installation_guide.'</a>';
116
-			}
117
-			$global_error_message['description'] = $IncorrectPhpVersionDescription;
118
-			break;
119
-		case 2:
120
-			$global_error_message['section'] = $SectionInstallation;
121
-			$global_error_message['title'] = $InstallationTitle;
122
-			if (($pos = strpos($InstallationDescription, '%s')) === false) {
123
-				$InstallationDescription = 'Click to INSTALL Chamilo %s or read the installation guide';
124
-			}
125
-			$read_installation_guide = substr($InstallationDescription, $pos + 2);
126
-			$InstallationDescription = '<form action="'.$root_rel.'main/install/index.php" method="get">
100
+    $global_error_message = array();
101
+
102
+    switch ($global_error_code) {
103
+        case 1:
104
+            $global_error_message['section'] = $SectionSystemRequirementsProblem;
105
+            $global_error_message['title'] = $IncorrectPhpVersionTitle;
106
+            $php_version = function_exists('phpversion') ? phpversion() : (defined('PHP_VERSION') ? PHP_VERSION : '');
107
+            $php_version = empty($php_version) ? '' : '(PHP '.$php_version.')';
108
+            $IncorrectPhpVersionDescription = str_replace('%s1', $php_version, $IncorrectPhpVersionDescription);
109
+            $IncorrectPhpVersionDescription = str_replace('%s2', REQUIRED_PHP_VERSION, $IncorrectPhpVersionDescription);
110
+            $pos = strpos($IncorrectPhpVersionDescription, '%s3');
111
+            if ($pos !== false) {
112
+                $length = strlen($IncorrectPhpVersionDescription);
113
+                $read_installation_guide = substr($IncorrectPhpVersionDescription, $pos + 3, $length);
114
+                $IncorrectPhpVersionDescription = substr($IncorrectPhpVersionDescription, 0, $pos);
115
+                $IncorrectPhpVersionDescription .= '<br /><a class="btn btn-default" href="'.$installation_guide_url.'" target="_blank">'.$read_installation_guide.'</a>';
116
+            }
117
+            $global_error_message['description'] = $IncorrectPhpVersionDescription;
118
+            break;
119
+        case 2:
120
+            $global_error_message['section'] = $SectionInstallation;
121
+            $global_error_message['title'] = $InstallationTitle;
122
+            if (($pos = strpos($InstallationDescription, '%s')) === false) {
123
+                $InstallationDescription = 'Click to INSTALL Chamilo %s or read the installation guide';
124
+            }
125
+            $read_installation_guide = substr($InstallationDescription, $pos + 2);
126
+            $InstallationDescription = '<form action="'.$root_rel.'main/install/index.php" method="get">
127 127
 			<div class="row"><div class="col-md-12">
128 128
 
129 129
                     <div class="office">
@@ -135,38 +135,38 @@  discard block
 block discarded – undo
135 135
                           </p>
136 136
                     </div>
137 137
             </form>';
138
-			$global_error_message['description'] = $InstallationDescription;
139
-			break;
140
-		case 3:
141
-		case 4:
142
-		case 5:
143
-			$global_error_message['section'] = $SectionDatabaseUnavailable;
144
-			$global_error_message['title'] = $DatabaseUnavailableTitle;
145
-			$global_error_message['description'] = $DatabaseUnavailableDescription;
146
-			break;
147
-		case 6:
148
-			$global_error_message['section'] = $SectionProtection;
149
-			$global_error_message['title'] = $AlreadyInstalledTitle;
150
-			$global_error_message['description'] = $AlreadyInstalledDescription;
151
-			break;
152
-		default:
153
-			$global_error_message['section'] = $SectionTechnicalIssues;
154
-			$global_error_message['title'] = $TechnicalIssuesTitle;
155
-			$global_error_message['description'] = $TechnicalIssuesDescription;
156
-			break;
157
-	}
158
-
159
-	$show_error_codes = defined('SHOW_ERROR_CODES') && SHOW_ERROR_CODES && $global_error_code != 2;
160
-	$global_error_message['code'] = $show_error_codes ? $ErrorCode.': '.$global_error_code.'<br /><br />' : '';
161
-	$global_error_message['details'] = empty($global_error_message['details']) ? '' : ($show_error_codes ? ': '.$global_error_message['details'] : $global_error_message['details']);
162
-	$global_error_message['organisation'] = $Organisation;
163
-	$global_error_message['powered_by'] = $PoweredBy;
164
-	$global_error_message['encoding'] = 'UTF-8';
165
-	$global_error_message['chamilo_logo'] = "data:image/png;base64,".base64_encode(file_get_contents($root_sys.'web/css/themes/'.$theme.'/images/header-logo.png'));
138
+            $global_error_message['description'] = $InstallationDescription;
139
+            break;
140
+        case 3:
141
+        case 4:
142
+        case 5:
143
+            $global_error_message['section'] = $SectionDatabaseUnavailable;
144
+            $global_error_message['title'] = $DatabaseUnavailableTitle;
145
+            $global_error_message['description'] = $DatabaseUnavailableDescription;
146
+            break;
147
+        case 6:
148
+            $global_error_message['section'] = $SectionProtection;
149
+            $global_error_message['title'] = $AlreadyInstalledTitle;
150
+            $global_error_message['description'] = $AlreadyInstalledDescription;
151
+            break;
152
+        default:
153
+            $global_error_message['section'] = $SectionTechnicalIssues;
154
+            $global_error_message['title'] = $TechnicalIssuesTitle;
155
+            $global_error_message['description'] = $TechnicalIssuesDescription;
156
+            break;
157
+    }
158
+
159
+    $show_error_codes = defined('SHOW_ERROR_CODES') && SHOW_ERROR_CODES && $global_error_code != 2;
160
+    $global_error_message['code'] = $show_error_codes ? $ErrorCode.': '.$global_error_code.'<br /><br />' : '';
161
+    $global_error_message['details'] = empty($global_error_message['details']) ? '' : ($show_error_codes ? ': '.$global_error_message['details'] : $global_error_message['details']);
162
+    $global_error_message['organisation'] = $Organisation;
163
+    $global_error_message['powered_by'] = $PoweredBy;
164
+    $global_error_message['encoding'] = 'UTF-8';
165
+    $global_error_message['chamilo_logo'] = "data:image/png;base64,".base64_encode(file_get_contents($root_sys.'web/css/themes/'.$theme.'/images/header-logo.png'));
166 166
 
167 167
     $installChamiloImage = base64_encode(file_get_contents("$root_sys/main/img/install-chamilo.gif"));
168 168
 
169
-	$global_error_message_page =
169
+    $global_error_message_page =
170 170
 <<<EOM
171 171
 <!DOCTYPE html>
172 172
 <html>
@@ -236,9 +236,9 @@  discard block
 block discarded – undo
236 236
 		</body>
237 237
 </html>
238 238
 EOM;
239
-	foreach ($global_error_message as $key => $value) {
240
-		$global_error_message_page = str_replace('{'.strtoupper($key).'}', $value, $global_error_message_page);
241
-	}
242
-	header('Content-Type: text/html; charset='.$global_error_message['encoding']);
243
-	die($global_error_message_page);
239
+    foreach ($global_error_message as $key => $value) {
240
+        $global_error_message_page = str_replace('{'.strtoupper($key).'}', $value, $global_error_message_page);
241
+    }
242
+    header('Content-Type: text/html; charset='.$global_error_message['encoding']);
243
+    die($global_error_message_page);
244 244
 }
Please login to merge, or discard this patch.
main/inc/introductionSection.inc.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     $form = new FormValidator('introduction_text');
54 54
 }
55 55
 
56
-$renderer =& $form->defaultRenderer();
56
+$renderer = & $form->defaultRenderer();
57 57
 $renderer->setCustomElementTemplate('<div style="width: 80%; margin: 0px auto; padding-bottom: 10px; ">{element}</div>');
58 58
 
59 59
 $config = array(
@@ -208,11 +208,11 @@  discard block
 block discarded – undo
208 208
     if ($displayMode == '1') {
209 209
         // Show only the current course progress step
210 210
         // $information_title = get_lang('InfoAboutLastDoneAdvance');
211
-        $last_done_advance =  $thematic->get_last_done_thematic_advance();
211
+        $last_done_advance = $thematic->get_last_done_thematic_advance();
212 212
         $thematic_advance_info = $thematic->get_thematic_advance_list($last_done_advance);
213 213
         $subTitle1 = get_lang('CurrentTopic');
214 214
         $class1 = ' current';
215
-    } else if($displayMode == '2') {
215
+    } else if ($displayMode == '2') {
216 216
         // Show only the two next course progress steps
217 217
         // $information_title = get_lang('InfoAboutNextAdvanceNotDone');
218 218
         $last_done_advance = $thematic->get_next_thematic_advance_not_done();
@@ -220,10 +220,10 @@  discard block
 block discarded – undo
220 220
         $thematic_advance_info = $thematic->get_thematic_advance_list($last_done_advance);
221 221
         $thematic_advance_info2 = $thematic->get_thematic_advance_list($next_advance_not_done);
222 222
         $subTitle1 = $subTitle2 = get_lang('NextTopic');
223
-    } else if($displayMode == '3') {
223
+    } else if ($displayMode == '3') {
224 224
         // Show the current and next course progress steps
225 225
         // $information_title = get_lang('InfoAboutLastDoneAdvanceAndNextAdvanceNotDone');
226
-        $last_done_advance =  $thematic->get_last_done_thematic_advance();
226
+        $last_done_advance = $thematic->get_last_done_thematic_advance();
227 227
         $next_advance_not_done = $thematic->get_next_thematic_advance_not_done();
228 228
         $thematic_advance_info = $thematic->get_thematic_advance_list($last_done_advance);
229 229
         $thematic_advance_info2 = $thematic->get_thematic_advance_list($next_advance_not_done);
@@ -234,8 +234,8 @@  discard block
 block discarded – undo
234 234
 
235 235
     if (!empty($thematic_advance_info)) {
236 236
         $thematic_advance = get_lang('CourseThematicAdvance');
237
-        $thematicScore = $thematic->get_total_average_of_thematic_advances() . '%';
238
-        $thematicUrl = api_get_path(WEB_CODE_PATH) .
237
+        $thematicScore = $thematic->get_total_average_of_thematic_advances().'%';
238
+        $thematicUrl = api_get_path(WEB_CODE_PATH).
239 239
             'course_progress/index.php?action=thematic_details&'.api_get_cidreq();
240 240
         $thematic_info = $thematic->get_thematic_list(
241 241
             $thematic_advance_info['thematic_id']
@@ -250,13 +250,13 @@  discard block
 block discarded – undo
250 250
         );
251 251
         $userInfo = $_SESSION['_user'];
252 252
         $courseInfo = api_get_course_info();
253
-        $titleThematic = $thematic_advance .' : '. $courseInfo['name'] . ' <b>( '. $thematicScore .' )</b>';
253
+        $titleThematic = $thematic_advance.' : '.$courseInfo['name'].' <b>( '.$thematicScore.' )</b>';
254 254
 
255 255
 
256 256
 
257
-        $infoUser = '<div class="thematic-avatar"><img src="' . $userInfo['avatar'] . '" class="img-circle img-responsive"></div>';
257
+        $infoUser = '<div class="thematic-avatar"><img src="'.$userInfo['avatar'].'" class="img-circle img-responsive"></div>';
258 258
         $infoUser .= '<div class="progress">
259
-                        <div class="progress-bar progress-bar-danger" role="progressbar" style="width: ' . $thematicScore . ';">
259
+                        <div class="progress-bar progress-bar-danger" role="progressbar" style="width: ' . $thematicScore.';">
260 260
                         '.$thematicScore.'
261 261
                         </div>
262 262
                     </div>';
@@ -265,11 +265,11 @@  discard block
 block discarded – undo
265 265
         $thematicItemOne = '
266 266
         <div class="col-md-6 items-progress">
267 267
             <div class="thematic-cont '.$class1.'">
268
-            <div class="topics">' . $subTitle1 . '</div>
269
-            <h4 class="title-topics">' . Display::returnFontAwesomeIcon('book') . $thematic_info['title'] . '</h4>
270
-            <p class="date">' .  Display::returnFontAwesomeIcon('calendar-o') . $thematic_advance_info['start_date'] . '</p>
271
-            <div class="views">' . Display::returnFontAwesomeIcon('file-text-o')  . strip_tags($thematic_advance_info['content']). '</div>
272
-            <p class="time">'. Display::returnFontAwesomeIcon('clock-o') . get_lang('DurationInHours') . ' : ' . $thematic_advance_info['duration'] . ' - <a href="' . $thematicUrl . '">' . get_lang('SeeDetail') . '</a></p>
268
+            <div class="topics">' . $subTitle1.'</div>
269
+            <h4 class="title-topics">' . Display::returnFontAwesomeIcon('book').$thematic_info['title'].'</h4>
270
+            <p class="date">' .  Display::returnFontAwesomeIcon('calendar-o').$thematic_advance_info['start_date'].'</p>
271
+            <div class="views">' . Display::returnFontAwesomeIcon('file-text-o').strip_tags($thematic_advance_info['content']).'</div>
272
+            <p class="time">'. Display::returnFontAwesomeIcon('clock-o').get_lang('DurationInHours').' : '.$thematic_advance_info['duration'].' - <a href="'.$thematicUrl.'">'.get_lang('SeeDetail').'</a></p>
273 273
             </div>
274 274
         </div>';
275 275
 
@@ -282,21 +282,21 @@  discard block
 block discarded – undo
282 282
                 <div class="col-md-6 items-progress">
283 283
                     <div class="thematic-cont">
284 284
                     <div class="topics">'.$subTitle2.'</div>
285
-                    <h4 class="title-topics">'. Display::returnFontAwesomeIcon('book')  . $thematic_info2['title'].'</h4>
286
-                    <p class="date">' . Display::returnFontAwesomeIcon('calendar-o') .$thematic_advance_info2['start_date'].'</p>
287
-                    <div class="views">' . Display::returnFontAwesomeIcon('file-text-o')  . strip_tags($thematic_advance_info2['content']).'</div>
288
-                    <p class="time">'. Display::returnFontAwesomeIcon('clock-o') .get_lang('DurationInHours').' : '.$thematic_advance_info2['duration'].' - <a href="'.$thematicUrl.'">'.get_lang('SeeDetail').'</a></p>
285
+                    <h4 class="title-topics">'. Display::returnFontAwesomeIcon('book').$thematic_info2['title'].'</h4>
286
+                    <p class="date">' . Display::returnFontAwesomeIcon('calendar-o').$thematic_advance_info2['start_date'].'</p>
287
+                    <div class="views">' . Display::returnFontAwesomeIcon('file-text-o').strip_tags($thematic_advance_info2['content']).'</div>
288
+                    <p class="time">'. Display::returnFontAwesomeIcon('clock-o').get_lang('DurationInHours').' : '.$thematic_advance_info2['duration'].' - <a href="'.$thematicUrl.'">'.get_lang('SeeDetail').'</a></p>
289 289
                     </div>
290 290
                 </div>';
291 291
         }
292 292
 
293 293
 
294 294
         $thematicPanel = '<div class="row">';
295
-        $thematicPanel .= '<div class="col-md-2">' . $infoUser . '</div>';
296
-        $thematicPanel .= '<div class="col-md-10"><div class="row">' . $thematicItemOne . $thematicItemTwo . '</div></div>';
295
+        $thematicPanel .= '<div class="col-md-2">'.$infoUser.'</div>';
296
+        $thematicPanel .= '<div class="col-md-10"><div class="row">'.$thematicItemOne.$thematicItemTwo.'</div></div>';
297 297
         $thematicPanel .= '</div>';
298 298
         $thematicPanel .= '<div class="separate">
299
-                        <a href="' . $thematicUrl . '" class="btn btn-default btn-block">' . get_lang('ShowFullCourseAdvance') . '</a>
299
+                        <a href="' . $thematicUrl.'" class="btn btn-default btn-block">'.get_lang('ShowFullCourseAdvance').'</a>
300 300
                     </div>';
301 301
         $thematicProgress = Display::panelCollapse($titleThematic, $thematicPanel, 'thematic', null, 'accordion-thematic', 'collapse-thematic', false);
302 302
     }
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
     $editIconButton = Display::url(
314 314
         '<em class="fa fa-wrench"></em> ',
315 315
         api_get_path(WEB_CODE_PATH).'course_info/tools.php?'.api_get_cidreq(),
316
-        ['class' => 'btn btn-default', 'title' => get_lang('CustomizeIcons') ]
316
+        ['class' => 'btn btn-default', 'title' => get_lang('CustomizeIcons')]
317 317
     );
318 318
 }
319 319
 
@@ -324,12 +324,12 @@  discard block
 block discarded – undo
324 324
         // Displays "Add intro" commands
325 325
         $toolbar = '<div class="btn-group pull-right" role="group">';
326 326
         if (!empty($courseId)) {
327
-            $textIntro  = '<a class="btn btn-default" title="' . get_lang('AddIntro') . '" href="'.api_get_self().'?' . api_get_cidreq().'&intro_cmdAdd=1">';
327
+            $textIntro  = '<a class="btn btn-default" title="'.get_lang('AddIntro').'" href="'.api_get_self().'?'.api_get_cidreq().'&intro_cmdAdd=1">';
328 328
             $textIntro .= '<em class="fa fa-file-text"></em> ';
329 329
             $textIntro .= "</a>";
330
-            $toolbar .= $textIntro . $editIconButton;
330
+            $toolbar .= $textIntro.$editIconButton;
331 331
         } else {
332
-            $toolbar .= '<a class="btn btn-default" href="' . api_get_self() . '?intro_cmdAdd=1">"' . get_lang('AddIntro') . '</a>';
332
+            $toolbar .= '<a class="btn btn-default" href="'.api_get_self().'?intro_cmdAdd=1">"'.get_lang('AddIntro').'</a>';
333 333
             $toolbar .= $editIconButton;
334 334
         }
335 335
         $toolbar .= '</div>';
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
                 '<a  class="btn btn-default" href="'.api_get_self().'?'.api_get_cidreq().'&intro_cmdEdit=1" title="'.get_lang('Modify').'">
343 343
                 <em class="fa fa-pencil"></em></a>';
344 344
             $toolbar .= $editIconButton;
345
-            $toolbar .="<a class=\"btn btn-default\" href=\"".api_get_self()."?".api_get_cidreq()."&intro_cmdDel=1\" onclick=\"javascript:
345
+            $toolbar .= "<a class=\"btn btn-default\" href=\"".api_get_self()."?".api_get_cidreq()."&intro_cmdDel=1\" onclick=\"javascript:
346 346
                 if(!confirm('".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES, $charset)).
347 347
                 "')) return false;\"><em class=\"fa fa-trash-o\"></em></a>";
348 348
 
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
                 if(!confirm('".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES, $charset)).
357 357
                 "')) return false;\"><em class=\"fa fa-trash-o\"></em></a>";
358 358
         }
359
-        $toolbar .=  "</div>";
359
+        $toolbar .= "</div>";
360 360
         // Fix for chrome XSS filter for videos in iframes - BT#7930
361 361
         $browser = api_get_navigator();
362 362
         if (strpos($introduction_section, '<iframe') !== false && $browser['name'] == 'Chrome') {
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
     } else {
376 376
         if (api_is_allowed_to_edit()) {
377 377
             $introduction_section .= '<div class="help-course">';
378
-            $introduction_section .= get_lang('AddCustomCourseIntro') . ' ' . $textIntro;
378
+            $introduction_section .= get_lang('AddCustomCourseIntro').' '.$textIntro;
379 379
             $introduction_section .= '</div>';
380 380
         }
381 381
     }
Please login to merge, or discard this patch.
main/inc/ajax/social.ajax.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -21,13 +21,13 @@  discard block
 block discarded – undo
21 21
         }
22 22
 
23 23
         if (isset($_GET['friend_id'])) {
24
-            $my_current_friend  = $_GET['friend_id'];
24
+            $my_current_friend = $_GET['friend_id'];
25 25
             UserManager::relate_users($current_user_id, $my_current_friend, $relation_type);
26 26
             UserManager::relate_users($my_current_friend, $current_user_id, $relation_type);
27 27
             SocialManager::invitation_accepted($my_current_friend, $current_user_id);
28 28
             Display::display_normal_message(api_xml_http_response_encode(get_lang('AddedContactToList')));
29 29
 
30
-            header('Location: ' . api_get_path(WEB_CODE_PATH) . 'social/invitations.php');
30
+            header('Location: '.api_get_path(WEB_CODE_PATH).'social/invitations.php');
31 31
         }
32 32
         break;
33 33
     case 'deny_friend':
@@ -37,15 +37,15 @@  discard block
 block discarded – undo
37 37
         }
38 38
 
39 39
         if (isset($_GET['is_my_friend'])) {
40
-            $relation_type = USER_RELATION_TYPE_FRIEND;//my friend
40
+            $relation_type = USER_RELATION_TYPE_FRIEND; //my friend
41 41
         } else {
42
-            $relation_type = USER_RELATION_TYPE_UNKNOW;//Contact unknown
42
+            $relation_type = USER_RELATION_TYPE_UNKNOW; //Contact unknown
43 43
         }
44 44
         if (isset($_GET['denied_friend_id'])) {
45 45
             SocialManager::invitation_denied($_GET['denied_friend_id'], $current_user_id);
46 46
             Display::display_confirmation_message(api_xml_http_response_encode(get_lang('InvitationDenied')));
47 47
             
48
-            header('Location: ' . api_get_path(WEB_CODE_PATH) . 'social/invitations.php');
48
+            header('Location: '.api_get_path(WEB_CODE_PATH).'social/invitations.php');
49 49
         }
50 50
         break;
51 51
     case 'delete_friend':
@@ -63,8 +63,8 @@  discard block
 block discarded – undo
63 63
             echo '';
64 64
             break;
65 65
         }
66
-        $user_id	= api_get_user_id();
67
-        $name_search= Security::remove_XSS($_POST['search_name_q']);
66
+        $user_id = api_get_user_id();
67
+        $name_search = Security::remove_XSS($_POST['search_name_q']);
68 68
         $number_friends = 0;
69 69
 
70 70
         if (isset($name_search) && $name_search != 'undefined') {
@@ -78,14 +78,14 @@  discard block
 block discarded – undo
78 78
 
79 79
         $number_friends = count($friends);
80 80
         if ($number_friends != 0) {
81
-            $number_loop   = ($number_friends/$number_of_images);
81
+            $number_loop   = ($number_friends / $number_of_images);
82 82
             $loop_friends  = ceil($number_loop);
83
-            $j=0;
84
-            for ($k=0; $k<$loop_friends; $k++) {
85
-                if ($j==$number_of_images) {
86
-                    $number_of_images=$number_of_images*2;
83
+            $j = 0;
84
+            for ($k = 0; $k < $loop_friends; $k++) {
85
+                if ($j == $number_of_images) {
86
+                    $number_of_images = $number_of_images * 2;
87 87
                 }
88
-                while ($j<$number_of_images) {
88
+                while ($j < $number_of_images) {
89 89
                     if (isset($friends[$j])) {
90 90
                         $friend = $friends[$j];
91 91
                         $user_name = api_xml_http_response_encode($friend['firstName'].' '.$friend['lastName']);
@@ -93,15 +93,15 @@  discard block
 block discarded – undo
93 93
 
94 94
                         $friend_html .= '
95 95
                             <div class="col-md-3">
96
-                                <div class="thumbnail text-center" id="div_' . $friends[$j]['friend_user_id'] . '">
97
-                                    <img src="' . $userPicture . '" class="img-responsive" id="imgfriend_' . $friend['friend_user_id'] . '" title="$user_name">
96
+                                <div class="thumbnail text-center" id="div_' . $friends[$j]['friend_user_id'].'">
97
+                                    <img src="' . $userPicture.'" class="img-responsive" id="imgfriend_'.$friend['friend_user_id'].'" title="$user_name">
98 98
                                     <div class="caption">
99 99
                                         <h3>
100
-                                            <a href="profile.php?u=' . $friend['friend_user_id'] . '">' . $user_name . '</a>
100
+                                            <a href="profile.php?u=' . $friend['friend_user_id'].'">'.$user_name.'</a>
101 101
                                         </h3>
102 102
                                         <p>
103
-                                            <button class="btn btn-danger" onclick="delete_friend(this)" id=img_' . $friend['friend_user_id'] . '>
104
-                                                ' . get_lang('Delete') . '
103
+                                            <button class="btn btn-danger" onclick="delete_friend(this)" id=img_' . $friend['friend_user_id'].'>
104
+                                                ' . get_lang('Delete').'
105 105
                                             </button>
106 106
                                         </p>
107 107
                                     </div>
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 
131 131
         switch ($action) {
132 132
             case 'load_course':
133
-                $course_id =  intval($_POST['course_code']); // the int course id
133
+                $course_id = intval($_POST['course_code']); // the int course id
134 134
                 $course_info = api_get_course_info_by_id($course_id);
135 135
                 $course_code = $course_info['code'];
136 136
 
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
                     //------Forum messages
139 139
                     $forum_result = get_all_post_from_user($user_id, $course_code);
140 140
                     $all_result_data = 0;
141
-                    if ($forum_result !='') {
141
+                    if ($forum_result != '') {
142 142
                         echo '<div id="social-forum-main-title">';
143 143
                         echo api_xml_http_response_encode(get_lang('Forum'));
144 144
                         echo '</div>';
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
         if (!empty($array)) {
202 202
             ksort($array);
203 203
             $html = '';
204
-            for($i = 0; $i < count($array); $i++) {
204
+            for ($i = 0; $i < count($array); $i++) {
205 205
                 $post = $array[$i]['html'];
206 206
                 $comment = SocialManager::getWallMessagesHTML($userId, $friendId, $array[$i]['id']);
207 207
                 $html .= '<div class="panel panel-info"><div class="panel-body">'.$post.$comment.'</div></div>';
@@ -209,8 +209,8 @@  discard block
 block discarded – undo
209 209
             $html .= Display::div(
210 210
                 Display::url(
211 211
                     get_lang('SeeMore'),
212
-                    api_get_self() . '?u=' . $userId . '&a=listWallMessage&start=' .
213
-                    ($start + $length + 1) . '&length=' . $length,
212
+                    api_get_self().'?u='.$userId.'&a=listWallMessage&start='.
213
+                    ($start + $length + 1).'&length='.$length,
214 214
                     array(
215 215
                         'class' => 'nextPage',
216 216
                     )
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
     case 'readUrlWithOpenGraph':
227 227
         $url = isset($_POST['social_wall_new_msg_main']) ? $_POST['social_wall_new_msg_main'] : '';
228 228
         $html = '';
229
-        if (SocialManager::verifyUrl($url) == true){
229
+        if (SocialManager::verifyUrl($url) == true) {
230 230
             $html = Security::remove_XSS(
231 231
                 SocialManager::readContentWithOpenGraph($url)
232 232
             );
Please login to merge, or discard this patch.
main/inc/ajax/skill.ajax.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
         $return_skills = array();
40 40
         foreach ($skills as $skill) {
41 41
             $skill['caption'] = $skill['name'];
42
-            $skill['value'] =  $skill['id'];
42
+            $skill['value'] = $skill['id'];
43 43
             $return_skills[] = $skill;
44 44
         }
45 45
         echo json_encode($return_skills);
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
         if (!empty($gradebooks)) {
52 52
             foreach ($gradebooks as $gradebook) {
53 53
                 if ($gradebook['parent_id'] == 0 && !empty($gradebook['certif_min_score']) && !empty($gradebook['document_id'])) {
54
-                    $gradebook_list[]  = $gradebook;
54
+                    $gradebook_list[] = $gradebook;
55 55
                     //$gradebook['name'] = $gradebook['name'];
56 56
                     //$gradebook_list[]  = $gradebook;
57 57
                 } else {
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
         $return = array();
68 68
         foreach ($gradebooks as $item) {
69 69
             $item['caption'] = $item['name'];
70
-            $item['value'] =  $item['id'];
70
+            $item['value'] = $item['id'];
71 71
             $return[] = $item;
72 72
         }
73 73
         echo json_encode($return);
@@ -92,13 +92,13 @@  discard block
 block discarded – undo
92 92
         }
93 93
         break;
94 94
     case 'get_skills_by_profile':
95
-        $skill_rel_profile   = new SkillRelProfile();
95
+        $skill_rel_profile = new SkillRelProfile();
96 96
         $profile_id = isset($_REQUEST['profile_id']) ? $_REQUEST['profile_id'] : null;
97 97
         $skills = $skill_rel_profile->get_skills_by_profile($profile_id);
98 98
         echo json_encode($skills);
99 99
         break;
100 100
     case 'get_saved_profiles':
101
-        $skill_profile   = new SkillProfile();
101
+        $skill_profile = new SkillProfile();
102 102
         $profiles = $skill_profile->get_all();
103 103
         Display::display_no_header();
104 104
         Display::$global_template->assign('profiles', $profiles);
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
             $success = false;
188 188
         }
189 189
 
190
-        $result = array (
190
+        $result = array(
191 191
             'success' => $success,
192 192
             'data' => $return
193 193
         );
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
         $skills = $skill->get_direct_parents($id);
199 199
         $return = array();
200 200
         foreach ($skills as $skill) {
201
-            $return [$skill['data']['id']] = array (
201
+            $return [$skill['data']['id']] = array(
202 202
                 'id'        => $skill['data']['id'],
203 203
                 'parent_id' => $skill['data']['parent_id'],
204 204
                 'name'      => $skill['data']['name']
@@ -207,8 +207,8 @@  discard block
 block discarded – undo
207 207
         echo json_encode($return);
208 208
         break;
209 209
     case 'profile_matches':
210
-        $skill_rel_user  = new SkillRelUser();
211
-        $skills = (!empty($_REQUEST['skill_id'])?$_REQUEST['skill_id']:array());
210
+        $skill_rel_user = new SkillRelUser();
211
+        $skills = (!empty($_REQUEST['skill_id']) ? $_REQUEST['skill_id'] : array());
212 212
 
213 213
         $total_skills_to_search = $skills;
214 214
         $users  = $skill_rel_user->get_user_by_skills($skills);
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
                     //$gradebook['name'] = $gradebook['name'];
56 56
                     //$gradebook_list[]  = $gradebook;
57 57
                 } else {
58
-                  //  $gradebook['name'] = $gradebook_list[$gradebook['parent_id']]['name'].' > '.$gradebook['name'];
58
+                    //  $gradebook['name'] = $gradebook_list[$gradebook['parent_id']]['name'].' > '.$gradebook['name'];
59 59
                     //$gradebook_list[]  = $gradebook;
60 60
                 }
61 61
             }
Please login to merge, or discard this patch.
main/inc/ajax/forum.ajax.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  */
9 9
 
10 10
 require_once '../global.inc.php';
11
-require_once api_get_path(SYS_CODE_PATH) . 'forum/forumfunction.inc.php';
11
+require_once api_get_path(SYS_CODE_PATH).'forum/forumfunction.inc.php';
12 12
 
13 13
 // First, protect this script
14 14
 api_protect_course_script(false);
@@ -63,13 +63,13 @@  discard block
 block discarded – undo
63 63
                     break;
64 64
                 }
65 65
                 // If pass all previous control, user can edit post
66
-                $courseId = isset($_REQUEST['c_id'])? intval($_REQUEST['c_id']) : api_get_course_int_id();
66
+                $courseId = isset($_REQUEST['c_id']) ? intval($_REQUEST['c_id']) : api_get_course_int_id();
67 67
                 $json['courseId'] = $courseId;
68
-                $forumId = isset($_REQUEST['forum'])? intval($_REQUEST['forum']) : null;
68
+                $forumId = isset($_REQUEST['forum']) ? intval($_REQUEST['forum']) : null;
69 69
                 $json['forum'] = $forumId;
70
-                $threadId = isset($_REQUEST['thread'])? intval($_REQUEST['thread']) : null;
70
+                $threadId = isset($_REQUEST['thread']) ? intval($_REQUEST['thread']) : null;
71 71
                 $json['thread'] = $threadId;
72
-                $postId = isset($_REQUEST['postId'])? intval($_REQUEST['postId']) : null;
72
+                $postId = isset($_REQUEST['postId']) ? intval($_REQUEST['postId']) : null;
73 73
                 $json['postId'] = $postId;
74 74
 
75 75
                 if (!empty($courseId) &&
Please login to merge, or discard this patch.
main/inc/ajax/link.ajax.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
             // set URL and other appropriate options
24 24
             $defaults = array(
25 25
                 CURLOPT_URL => $url,
26
-                CURLOPT_FOLLOWLOCATION => true,         // follow redirects accept youtube.com
26
+                CURLOPT_FOLLOWLOCATION => true, // follow redirects accept youtube.com
27 27
                 CURLOPT_HEADER => 0,
28 28
                 CURLOPT_RETURNTRANSFER => true,
29 29
                 CURLOPT_TIMEOUT => 4
Please login to merge, or discard this patch.
main/inc/ajax/session.ajax.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
             $list_sessions = SessionManager::get_sessions_by_user($user_id, true);
16 16
             if (!empty($list_sessions)) {
17 17
                 foreach ($list_sessions as $session_item) {
18
-                    echo $session_item['session_name'] . '<br />';
18
+                    echo $session_item['session_name'].'<br />';
19 19
                 }
20 20
             } else {
21 21
                 echo get_lang('NoSessionsForThisUser');
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
                 [
30 30
                     's.name' => [
31 31
                         'operator' => 'LIKE',
32
-                        'value' => "%" . $_REQUEST['q'] . "%"
32
+                        'value' => "%".$_REQUEST['q']."%"
33 33
                     ]
34 34
                 ]
35 35
             );
Please login to merge, or discard this patch.
main/inc/ajax/nanogong.ajax.php 3 patches
Switch Indentation   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -30,44 +30,44 @@
 block discarded – undo
30 30
 }
31 31
 
32 32
 switch ($action) {
33
-	case 'get_file':
34
-		if ($nano->get_param_value('user_id') == api_get_user_id() || api_is_allowed_to_edit()) {
35
-			$file_path = $nano->load_filename_if_exists();
36
-			//$file_path = '/var/www/rocio/courses/GREAT123/exercises/0/2/5/1/1-0-1-2-5-38.mp3';
37
-			if ($file_path) {
38
-				$info = pathinfo($file_path);
39
-				$user_info = api_get_user_info($nano->params['user_id']);
40
-				$name = get_lang('Quiz').'-'.$user_info['firstname'].'-'.$user_info['lastname'].'.'.$info['extension'];
41
-				$download = true;
42
-				if (isset($_REQUEST['download'])  && $_REQUEST['download'] == 0) {
43
-					$download = false;
44
-				}
45
-				DocumentManager::file_send_for_download($file_path, $download);
46
-				exit;
47
-			}
48
-		}
49
-		break;
50
-	case 'show_audio':
51
-		if (!$is_nano) {
52
-			echo $nano->return_js($_REQUEST);
53
-		}
54
-		echo $nano->show_audio_file($is_nano);
55
-		break;
56
-	case 'delete':
57
-		$return = $nano->delete_files();
58
-		if ($return == 1) {
59
-			//cant' do this because the post that nano send doesnt take into account the session
60
-			Display::display_confirmation_message(get_lang('FileDeleted'));
61
-		} else {
62
-			Display::display_confirmation_message(get_lang('FileNotFound'));
63
-		}
64
-		break;
65
-	case 'show_form':
66
-		api_protect_course_script(true);
67
-		Display::display_reduced_header();
68
-		echo $nano->return_js($_REQUEST);
69
-		echo $nano->return_form();
70
-		break;
33
+	    case 'get_file':
34
+		    if ($nano->get_param_value('user_id') == api_get_user_id() || api_is_allowed_to_edit()) {
35
+			    $file_path = $nano->load_filename_if_exists();
36
+			    //$file_path = '/var/www/rocio/courses/GREAT123/exercises/0/2/5/1/1-0-1-2-5-38.mp3';
37
+			    if ($file_path) {
38
+				    $info = pathinfo($file_path);
39
+				    $user_info = api_get_user_info($nano->params['user_id']);
40
+				    $name = get_lang('Quiz').'-'.$user_info['firstname'].'-'.$user_info['lastname'].'.'.$info['extension'];
41
+				    $download = true;
42
+				    if (isset($_REQUEST['download'])  && $_REQUEST['download'] == 0) {
43
+					    $download = false;
44
+				    }
45
+				    DocumentManager::file_send_for_download($file_path, $download);
46
+				    exit;
47
+			    }
48
+		    }
49
+		    break;
50
+	    case 'show_audio':
51
+		    if (!$is_nano) {
52
+			    echo $nano->return_js($_REQUEST);
53
+		    }
54
+		    echo $nano->show_audio_file($is_nano);
55
+		    break;
56
+	    case 'delete':
57
+		    $return = $nano->delete_files();
58
+		    if ($return == 1) {
59
+			    //cant' do this because the post that nano send doesnt take into account the session
60
+			    Display::display_confirmation_message(get_lang('FileDeleted'));
61
+		    } else {
62
+			    Display::display_confirmation_message(get_lang('FileNotFound'));
63
+		    }
64
+		    break;
65
+	    case 'show_form':
66
+		    api_protect_course_script(true);
67
+		    Display::display_reduced_header();
68
+		    echo $nano->return_js($_REQUEST);
69
+		    echo $nano->return_form();
70
+		    break;
71 71
     case 'save_file':
72 72
     	//User access same as upload.php
73 73
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 $action = $_REQUEST['a'];
12 12
 
13 13
 unset($_REQUEST['a']);
14
-$js_path 		= api_get_path(WEB_LIBRARY_PATH).'javascript/';
14
+$js_path = api_get_path(WEB_LIBRARY_PATH).'javascript/';
15 15
 
16 16
 //Fix in order to add the exe_id
17 17
 
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 				$user_info = api_get_user_info($nano->params['user_id']);
40 40
 				$name = get_lang('Quiz').'-'.$user_info['firstname'].'-'.$user_info['lastname'].'.'.$info['extension'];
41 41
 				$download = true;
42
-				if (isset($_REQUEST['download'])  && $_REQUEST['download'] == 0) {
42
+				if (isset($_REQUEST['download']) && $_REQUEST['download'] == 0) {
43 43
 					$download = false;
44 44
 				}
45 45
 				DocumentManager::file_send_for_download($file_path, $download);
Please login to merge, or discard this patch.
Indentation   +67 added lines, -67 removed lines patch added patch discarded remove patch
@@ -16,84 +16,84 @@
 block discarded – undo
16 16
 //Fix in order to add the exe_id
17 17
 
18 18
 if (isset($_REQUEST['from_htaccess'])) {
19
-	if (isset($_REQUEST['file'])) {
20
-		$fileinfo = pathinfo($_REQUEST['file']);
21
-		$items = explode('-', $fileinfo['filename']);
22
-		$_REQUEST['exe_id'] = $items[5];
23
-	}
19
+    if (isset($_REQUEST['file'])) {
20
+        $fileinfo = pathinfo($_REQUEST['file']);
21
+        $items = explode('-', $fileinfo['filename']);
22
+        $_REQUEST['exe_id'] = $items[5];
23
+    }
24 24
 }
25 25
 $nano = new Nanogong($_REQUEST);
26 26
 $is_nano = false;
27 27
 
28 28
 if (isset($_REQUEST['is_nano'])) {
29
-	$is_nano = true;
29
+    $is_nano = true;
30 30
 }
31 31
 
32 32
 switch ($action) {
33
-	case 'get_file':
34
-		if ($nano->get_param_value('user_id') == api_get_user_id() || api_is_allowed_to_edit()) {
35
-			$file_path = $nano->load_filename_if_exists();
36
-			//$file_path = '/var/www/rocio/courses/GREAT123/exercises/0/2/5/1/1-0-1-2-5-38.mp3';
37
-			if ($file_path) {
38
-				$info = pathinfo($file_path);
39
-				$user_info = api_get_user_info($nano->params['user_id']);
40
-				$name = get_lang('Quiz').'-'.$user_info['firstname'].'-'.$user_info['lastname'].'.'.$info['extension'];
41
-				$download = true;
42
-				if (isset($_REQUEST['download'])  && $_REQUEST['download'] == 0) {
43
-					$download = false;
44
-				}
45
-				DocumentManager::file_send_for_download($file_path, $download);
46
-				exit;
47
-			}
48
-		}
49
-		break;
50
-	case 'show_audio':
51
-		if (!$is_nano) {
52
-			echo $nano->return_js($_REQUEST);
53
-		}
54
-		echo $nano->show_audio_file($is_nano);
55
-		break;
56
-	case 'delete':
57
-		$return = $nano->delete_files();
58
-		if ($return == 1) {
59
-			//cant' do this because the post that nano send doesnt take into account the session
60
-			Display::display_confirmation_message(get_lang('FileDeleted'));
61
-		} else {
62
-			Display::display_confirmation_message(get_lang('FileNotFound'));
63
-		}
64
-		break;
65
-	case 'show_form':
66
-		api_protect_course_script(true);
67
-		Display::display_reduced_header();
68
-		echo $nano->return_js($_REQUEST);
69
-		echo $nano->return_form();
70
-		break;
33
+    case 'get_file':
34
+        if ($nano->get_param_value('user_id') == api_get_user_id() || api_is_allowed_to_edit()) {
35
+            $file_path = $nano->load_filename_if_exists();
36
+            //$file_path = '/var/www/rocio/courses/GREAT123/exercises/0/2/5/1/1-0-1-2-5-38.mp3';
37
+            if ($file_path) {
38
+                $info = pathinfo($file_path);
39
+                $user_info = api_get_user_info($nano->params['user_id']);
40
+                $name = get_lang('Quiz').'-'.$user_info['firstname'].'-'.$user_info['lastname'].'.'.$info['extension'];
41
+                $download = true;
42
+                if (isset($_REQUEST['download'])  && $_REQUEST['download'] == 0) {
43
+                    $download = false;
44
+                }
45
+                DocumentManager::file_send_for_download($file_path, $download);
46
+                exit;
47
+            }
48
+        }
49
+        break;
50
+    case 'show_audio':
51
+        if (!$is_nano) {
52
+            echo $nano->return_js($_REQUEST);
53
+        }
54
+        echo $nano->show_audio_file($is_nano);
55
+        break;
56
+    case 'delete':
57
+        $return = $nano->delete_files();
58
+        if ($return == 1) {
59
+            //cant' do this because the post that nano send doesnt take into account the session
60
+            Display::display_confirmation_message(get_lang('FileDeleted'));
61
+        } else {
62
+            Display::display_confirmation_message(get_lang('FileNotFound'));
63
+        }
64
+        break;
65
+    case 'show_form':
66
+        api_protect_course_script(true);
67
+        Display::display_reduced_header();
68
+        echo $nano->return_js($_REQUEST);
69
+        echo $nano->return_form();
70
+        break;
71 71
     case 'save_file':
72
-    	//User access same as upload.php
72
+        //User access same as upload.php
73 73
 
74
-    	$return = $nano->upload_file($is_nano);
74
+        $return = $nano->upload_file($is_nano);
75 75
 
76
-    	if ($is_nano) {
77
-    		//nano looks for numbers
78
-	    	if ($return == 1) {
79
-	    		//cant' do this because the post that nano send doesnt take into account the session
80
-	    		echo 1; //Display::display_confirmation_message(get_lang('UplUploadSucceeded'));
81
-	    	} else {
82
-	    		echo 0;
83
-	    		//Display::display_warning_message(get_lang('UplUnableToSaveFileFilteredExtension'));
84
-	    	}
85
-    	} else {
86
-    		Display::display_reduced_header();
87
-    		echo $nano->return_js($_REQUEST);
88
-    		//normal form
89
-    		if ($return == 1) {
90
-    			//cant' do this because the post that nano send doesnt take into account the session
91
-    			$message = Display::return_message(get_lang('UplUploadSucceeded'), 'confirm');
92
-    		} else {
93
-    			$message = Display::return_message(get_lang('UplUnableToSaveFileFilteredExtension'), 'warning');
94
-    		}
95
-    		echo $nano->return_form($message);
96
-    	}
76
+        if ($is_nano) {
77
+            //nano looks for numbers
78
+            if ($return == 1) {
79
+                //cant' do this because the post that nano send doesnt take into account the session
80
+                echo 1; //Display::display_confirmation_message(get_lang('UplUploadSucceeded'));
81
+            } else {
82
+                echo 0;
83
+                //Display::display_warning_message(get_lang('UplUnableToSaveFileFilteredExtension'));
84
+            }
85
+        } else {
86
+            Display::display_reduced_header();
87
+            echo $nano->return_js($_REQUEST);
88
+            //normal form
89
+            if ($return == 1) {
90
+                //cant' do this because the post that nano send doesnt take into account the session
91
+                $message = Display::return_message(get_lang('UplUploadSucceeded'), 'confirm');
92
+            } else {
93
+                $message = Display::return_message(get_lang('UplUnableToSaveFileFilteredExtension'), 'warning');
94
+            }
95
+            echo $nano->return_form($message);
96
+        }
97 97
         break;
98 98
     default:
99 99
         echo '';
Please login to merge, or discard this patch.
main/inc/ajax/online.ajax.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
 
5 5
 $action = $_GET['a'];
6 6
 
7
-switch($action) {
7
+switch ($action) {
8 8
     case 'load_online_user':
9 9
         if (isset($_SESSION['who_is_online_counter'])) {
10 10
             $_SESSION['who_is_online_counter']++;
@@ -14,8 +14,8 @@  discard block
 block discarded – undo
14 14
         $images_to_show = 9;
15 15
 
16 16
         $page = intval($_REQUEST['online_page_nr']);
17
-        $max_page = ceil(who_is_online_count()/$images_to_show);
18
-        $page_rows = ($page-1)*9;
17
+        $max_page = ceil(who_is_online_count() / $images_to_show);
18
+        $page_rows = ($page - 1) * 9;
19 19
 
20 20
         if (!empty($max_page) && $page <= $max_page) {
21 21
             if (isset($_GET['cidReq']) && strlen($_GET['cidReq']) > 0) {
Please login to merge, or discard this patch.